Skip to content

Commit 78c6487

Browse files
author
RadAzzouz
committed
Update for PSPDFKit 8.2 for iOS and 3.2 for macOS
1 parent 389ce8c commit 78c6487

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

Example/PSPDFKitExample/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
platform :ios, '11.0'
99
use_frameworks!
1010

11-
pod 'PSPDFKitSwift', :git => 'https://github.com/PSPDFKit/PSPDFKit.swift.git', :tag => '1.1.1'
11+
pod 'PSPDFKitSwift', :git => 'https://github.com/PSPDFKit/PSPDFKit.swift.git', :tag => '1.1.2'
1212

1313
target 'PSPDFKitExample' do
1414

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ disclaimer as stated in the license.
88
You will require a commercial PSPDFKit License to run these examples
99
in non-demo mode. Please refer to [email protected] for details.
1010

11-
Copyright (c) 2010-2017, PSPDFKit GmbH.
11+
Copyright (c) 2010-2019, PSPDFKit GmbH.
1212
All rights reserved.
1313

1414
Redistribution and use in source or binary forms,
@@ -40,4 +40,4 @@ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4040
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4141
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4242
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
43-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Your `Podfile` should look like this:
3333
```ruby
3434
# Replace `YourAppName` with your app's target name.
3535

36-
pod 'PSPDFKitSwift', :git => 'https://github.com/PSPDFKit/PSPDFKitSwift.git', :tag => '1.1.1'
36+
pod 'PSPDFKitSwift', :git => 'https://github.com/PSPDFKit/PSPDFKitSwift.git', :tag => '1.1.2'
3737

3838
target :YourAppName do
3939
use_frameworks!

Sources/PSPDFKitSwift/PSPDFDocument.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ extension PSPDFDocument {
133133

134134
/// See `PSPDFDocumentSecurityOptions`
135135
public typealias SecurityOptions = PSPDFDocumentSecurityOptions
136+
public typealias SaveStrategy = PSPDFDocumentSaveStrategy
136137

137138
/// When saving a document, you can provide various save options.
138139
public enum SaveOption {
@@ -143,9 +144,11 @@ extension PSPDFDocument {
143144
/// space over time. Forcing a rewrite means the whole document file is rewritten
144145
/// from scratch leaving out all the outdated and unused parts.
145146
case security(SecurityOptions)
147+
/// Document saving strategy
148+
case strategy(SaveStrategy)
146149
/// A `SecurityOptions` instance, specifies the security options to
147150
/// use when saving the document.
148-
case forceRewrite
151+
case forceSaving
149152
/// Applies all redactions in the document and removes the content underneath them.
150153
/// Not passing this option means redactions are not
151154
/// applied, and redaction annotations will stay in the document.
@@ -155,8 +158,10 @@ extension PSPDFDocument {
155158
switch self {
156159
case .security(let securityOptions):
157160
return [.securityOptions: securityOptions]
158-
case .forceRewrite:
159-
return [.forceRewrite: NSNumber(value: true)]
161+
case .forceSaving:
162+
return [.forceSaving: NSNumber(value: true)]
163+
case .strategy(let saveStrategy):
164+
return [.strategy: NSNumber(value: saveStrategy.rawValue)]
160165
case .applyRedactions:
161166
return [.applyRedactions: NSNumber(value: true)]
162167
}
@@ -261,8 +266,8 @@ internal class PDFDocumentTests {
261266
let document = PDFDocument()
262267
let securityOptions = try PDFDocument.SecurityOptions(ownerPassword: "0123456789012345678901234567890123456789", userPassword: "0123456789012345678901234567890123456789", keyLength: 40, permissions: [.extract, .fillForms], encryptionAlgorithm: .AES)
263268
document.add(annotations: [ /* TODO: */ ], options: [.animateView(true), .suppressNotifications(false)])
264-
try document.save(options: [.security(securityOptions), .forceRewrite])
265-
document.save(options: [.security(securityOptions), .forceRewrite]) { result in
269+
try document.save(options: [.security(securityOptions), .forceSaving])
270+
document.save(options: [.security(securityOptions), .forceSaving]) { result in
266271
_ = try! result.dematerialize()
267272
}
268273
}

0 commit comments

Comments
 (0)