Skip to content

Commit e328980

Browse files
authored
Merge pull request #27 from kaferi/master
Update to v20.7
2 parents b5e3f86 + 0739ef6 commit e328980

17 files changed

+368
-74
lines changed

AsposePdfCloud.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Pod::Spec.new do |s|
55
s.ios.deployment_target = '10.0'
66
s.osx.deployment_target = '10.11'
77
s.tvos.deployment_target = '9.0'
8-
s.version = '20.6.0'
8+
s.version = '20.7.0'
99
s.swift_version = '4.1'
1010
s.source = { :git => 'https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-swift.git', :tag => s.version.to_s }
1111
s.authors = 'Aspose PDF Cloud'

AsposePdfCloud.xcodeproj/project.pbxproj

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
125EF5DA236C7F1F0013E682 /* RadioButtonFieldsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125EF5D4236C7F1F0013E682 /* RadioButtonFieldsResponse.swift */; };
3737
125EF5DB236C7F1F0013E682 /* RadioButtonOptionField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125EF5D5236C7F1F0013E682 /* RadioButtonOptionField.swift */; };
3838
1278CC982444B50900AACF09 /* ImageFragment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1278CC972444B50900AACF09 /* ImageFragment.swift */; };
39+
1288960024D068D8007FD10A /* ImageEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128895FD24D068D8007FD10A /* ImageEncoding.swift */; };
40+
1288960124D068D8007FD10A /* ApiInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128895FE24D068D8007FD10A /* ApiInfo.swift */; };
41+
1288960224D068D8007FD10A /* ImageCompressionVersion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128895FF24D068D8007FD10A /* ImageCompressionVersion.swift */; };
3942
128B4CEB238C25F500877D55 /* ComboBoxFieldsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128B4CE7238C25F500877D55 /* ComboBoxFieldsResponse.swift */; };
4043
128B4CEC238C25F500877D55 /* ComboBoxFieldResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128B4CE8238C25F500877D55 /* ComboBoxFieldResponse.swift */; };
4144
128B4CED238C25F500877D55 /* ComboBoxField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128B4CE9238C25F500877D55 /* ComboBoxField.swift */; };
@@ -440,6 +443,9 @@
440443
125EF5D4236C7F1F0013E682 /* RadioButtonFieldsResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioButtonFieldsResponse.swift; sourceTree = "<group>"; };
441444
125EF5D5236C7F1F0013E682 /* RadioButtonOptionField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioButtonOptionField.swift; sourceTree = "<group>"; };
442445
1278CC972444B50900AACF09 /* ImageFragment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageFragment.swift; sourceTree = "<group>"; };
446+
128895FD24D068D8007FD10A /* ImageEncoding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageEncoding.swift; sourceTree = "<group>"; };
447+
128895FE24D068D8007FD10A /* ApiInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiInfo.swift; sourceTree = "<group>"; };
448+
128895FF24D068D8007FD10A /* ImageCompressionVersion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCompressionVersion.swift; sourceTree = "<group>"; };
443449
128B4CE7238C25F500877D55 /* ComboBoxFieldsResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComboBoxFieldsResponse.swift; sourceTree = "<group>"; };
444450
128B4CE8238C25F500877D55 /* ComboBoxFieldResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComboBoxFieldResponse.swift; sourceTree = "<group>"; };
445451
128B4CE9238C25F500877D55 /* ComboBoxField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComboBoxField.swift; sourceTree = "<group>"; };
@@ -862,6 +868,9 @@
862868
1E668AE72174AFC2004218A8 /* Models */ = {
863869
isa = PBXGroup;
864870
children = (
871+
128895FE24D068D8007FD10A /* ApiInfo.swift */,
872+
128895FF24D068D8007FD10A /* ImageCompressionVersion.swift */,
873+
128895FD24D068D8007FD10A /* ImageEncoding.swift */,
865874
125B282124A23A8C001CAB84 /* OutputFormat.swift */,
866875
1278CC972444B50900AACF09 /* ImageFragment.swift */,
867876
1E668B072174AFF2004218A8 /* Annotation.swift */,
@@ -1585,6 +1594,7 @@
15851594
1ED99317231E9B2F00725F99 /* FormField.swift in Sources */,
15861595
1EC94E6C2282C1FF00624E38 /* GraphInfo.swift in Sources */,
15871596
1EC94E662282C1FF00624E38 /* TableBroken.swift in Sources */,
1597+
1288960024D068D8007FD10A /* ImageEncoding.swift in Sources */,
15881598
1E84B8CA233CF53700057874 /* TextBoxFields.swift in Sources */,
15891599
1E9D85C321B55DF50026DB97 /* PopupAnnotationWithParent.swift in Sources */,
15901600
1E668BA32174AFFC004218A8 /* ImageTemplate.swift in Sources */,
@@ -1611,6 +1621,7 @@
16111621
1ECF708722562DCE0056698E /* StampsInfo.swift in Sources */,
16121622
1E52FD8F2189F2AB00DEDC40 /* PolyLineAnnotationResponse.swift in Sources */,
16131623
1E668BA62174AFFC004218A8 /* VerticalAlignment.swift in Sources */,
1624+
1288960224D068D8007FD10A /* ImageCompressionVersion.swift in Sources */,
16141625
1E668AE22174AFA4004218A8 /* Extensions.swift in Sources */,
16151626
1E9A4AD922280BBB00BE3FA5 /* ScreenAnnotation.swift in Sources */,
16161627
1E668B9B2174AFFC004218A8 /* LinkActionType.swift in Sources */,
@@ -1751,6 +1762,7 @@
17511762
1EF1EC1F220B3BF000200CEF /* RedactionAnnotation.swift in Sources */,
17521763
1E668B562174AFFC004218A8 /* FreeTextAnnotations.swift in Sources */,
17531764
1E9D85AE21B55DF50026DB97 /* HighlightAnnotationResponse.swift in Sources */,
1765+
1288960124D068D8007FD10A /* ApiInfo.swift in Sources */,
17541766
1E668BB32174AFFC004218A8 /* FieldType.swift in Sources */,
17551767
1E52FD902189F2AB00DEDC40 /* SquareAnnotationsResponse.swift in Sources */,
17561768
1E9D85CA21B55DF50026DB97 /* StrikeOutAnnotationResponse.swift in Sources */,
@@ -2013,7 +2025,7 @@
20132025
"@executable_path/Frameworks",
20142026
"@loader_path/Frameworks",
20152027
);
2016-
MARKETING_VERSION = 20.6.0;
2028+
MARKETING_VERSION = 20.7.0;
20172029
PRODUCT_BUNDLE_IDENTIFIER = com.aspose.AsposePdfCloud;
20182030
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
20192031
SKIP_INSTALL = YES;
@@ -2042,7 +2054,7 @@
20422054
"@executable_path/Frameworks",
20432055
"@loader_path/Frameworks",
20442056
);
2045-
MARKETING_VERSION = 20.6.0;
2057+
MARKETING_VERSION = 20.7.0;
20462058
PRODUCT_BUNDLE_IDENTIFIER = com.aspose.AsposePdfCloud;
20472059
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
20482060
SKIP_INSTALL = YES;

AsposePdfCloud/APIs.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ open class RequestBuilder<T> {
5151
//OAuth2.0
5252
_ = addHeader(name: "Authorization", value: "Bearer " + AsposePdfCloudAPI.accessToken!)
5353
.addHeader(name: "x-aspose-client", value: "swift sdk")
54-
.addHeader(name: "x-aspose-client-version", value: "20.6.0")
54+
.addHeader(name: "x-aspose-client-version", value: "20.7.0")
5555
}
5656

5757
open func addHeaders(_ aHeaders:[String:String]) {

AsposePdfCloud/APIs/PdfAPI.swift

Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,49 @@ open class PdfAPI {
14741474
return requestBuilder.init(method: "GET", URLString: (urlObj?.string ?? URLString), parameters: parameters, isBody: false)
14751475
}
14761476

1477+
/**
1478+
1479+
- parameter completion: completion handler to receive the data and the error objects
1480+
*/
1481+
open class func getApiInfo(completion: @escaping ((_ data: ApiInfo?,_ error: Error?) -> Void)) {
1482+
AuthAspose.checkAuth() {
1483+
(authError) in
1484+
guard authError == nil else {
1485+
completion(nil, authError)
1486+
return
1487+
}
1488+
getApiInfoWithRequestBuilder().execute { (response, error) -> Void in
1489+
completion(response?.body, error);
1490+
}
1491+
}
1492+
}
1493+
1494+
1495+
/**
1496+
- GET /pdf/info
1497+
- OAuth:
1498+
- type: oauth2
1499+
- name: JWT
1500+
- examples: [{contentType=application/json, example={
1501+
"Version" : "Version",
1502+
"Name" : "Name"
1503+
}}]
1504+
1505+
- returns: RequestBuilder<ApiInfo>
1506+
*/
1507+
open class func getApiInfoWithRequestBuilder() -> RequestBuilder<ApiInfo> {
1508+
let pathUrl = "/pdf/info"
1509+
let URLString = AsposePdfCloudAPI.basePath + pathUrl
1510+
let parameters: [String:Any]? = nil
1511+
1512+
let urlObj = NSURLComponents(string: URLString)
1513+
1514+
1515+
let requestBuilder: RequestBuilder<ApiInfo>.Type = AsposePdfCloudAPI.requestBuilderFactory.getBuilder()
1516+
1517+
return requestBuilder.init(method: "GET", URLString: (urlObj?.string ?? URLString), parameters: parameters, isBody: false)
1518+
}
1519+
14771520
/**
14781521
Read document bookmark.
14791522

@@ -1922,7 +1965,7 @@ open class PdfAPI {
19221965
}
19231966

19241967
/**
1925-
Read documant page annotations. Returns only FreeTextAnnotations, TextAnnotations, other annotations will implemented next releases.
1968+
Read document page annotations. Returns only FreeTextAnnotations, TextAnnotations, other annotations will implemented next releases.
19261969

19271970
- parameter name: (path) The document name.
19281971
- parameter storage: (query) The document storage. (optional)
@@ -1944,7 +1987,7 @@ open class PdfAPI {
19441987

19451988

19461989
/**
1947-
Read documant page annotations. Returns only FreeTextAnnotations, TextAnnotations, other annotations will implemented next releases.
1990+
Read document page annotations. Returns only FreeTextAnnotations, TextAnnotations, other annotations will implemented next releases.
19481991
- GET /pdf/{name}/annotations
19491992
- OAuth:
19501993
- type: oauth2
@@ -10563,7 +10606,7 @@ open class PdfAPI {
1056310606
}
1056410607

1056510608
/**
10566-
Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and returns resulting file response content
10609+
Converts PDF document which contains XFA form (located on storage) to PDF with AcroForm and returns resulting file response content
1056710610

1056810611
- parameter name: (path) The document name.
1056910612
- parameter folder: (query) The document folder. (optional)
@@ -10585,7 +10628,7 @@ open class PdfAPI {
1058510628

1058610629

1058710630
/**
10588-
Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and returns resulting file response content
10631+
Converts PDF document which contains XFA form (located on storage) to PDF with AcroForm and returns resulting file response content
1058910632
- GET /pdf/{name}/convert/xfatoacroform
1059010633
- OAuth:
1059110634
- type: oauth2
@@ -12968,7 +13011,7 @@ open class PdfAPI {
1296813011

1296913012
- parameter name: (path) The document name.
1297013013
- parameter pageNumber: (path) The page number.
12971-
- parameter links: (body) Array of link anotation.
13014+
- parameter links: (body) Array of link annotation.
1297213015
- parameter storage: (query) The document storage. (optional)
1297313016
- parameter folder: (query) The document folder. (optional)
1297413017
- parameter completion: completion handler to receive the data and the error objects
@@ -13000,7 +13043,7 @@ open class PdfAPI {
1300013043

1300113044
- parameter name: (path) The document name.
1300213045
- parameter pageNumber: (path) The page number.
13003-
- parameter links: (body) Array of link anotation.
13046+
- parameter links: (body) Array of link annotation.
1300413047
- parameter storage: (query) The document storage. (optional)
1300513048
- parameter folder: (query) The document folder. (optional)
1300613049

@@ -15044,7 +15087,7 @@ open class PdfAPI {
1504415087
- parameter outPath: (query) Full resulting filename (ex. /folder1/folder2/result.doc)
1504515088
- parameter password: (query) The password (encrypted Base64).
1504615089
- parameter storage: (query) The document storage. (optional)
15047-
- parameter file: (form) A file to be derypted. (optional)
15090+
- parameter file: (form) A file to be decrypted. (optional)
1504815091
- parameter completion: completion handler to receive the data and the error objects
1504915092
*/
1505015093
open class func putDecryptDocument(outPath: String, password: String, storage: String? = nil, file: URL? = nil, completion: @escaping ((_ data: AsposeResponse?,_ error: Error?) -> Void)) {
@@ -15075,7 +15118,7 @@ open class PdfAPI {
1507515118
- parameter outPath: (query) Full resulting filename (ex. /folder1/folder2/result.doc)
1507615119
- parameter password: (query) The password (encrypted Base64).
1507715120
- parameter storage: (query) The document storage. (optional)
15078-
- parameter file: (form) A file to be derypted. (optional)
15121+
- parameter file: (form) A file to be decrypted. (optional)
1507915122

1508015123
- returns: RequestBuilder<AsposeResponse>
1508115124
*/
@@ -16829,7 +16872,7 @@ open class PdfAPI {
1682916872

1683016873
- parameter name: (path) The document name.
1683116874
- parameter linkId: (path) The link ID.
16832-
- parameter link: (body) Link anotation.
16875+
- parameter link: (body) Link annotation.
1683316876
- parameter storage: (query) The document storage. (optional)
1683416877
- parameter folder: (query) The document folder. (optional)
1683516878
- parameter completion: completion handler to receive the data and the error objects
@@ -16858,7 +16901,7 @@ open class PdfAPI {
1685816901

1685916902
- parameter name: (path) The document name.
1686016903
- parameter linkId: (path) The link ID.
16861-
- parameter link: (body) Link anotation.
16904+
- parameter link: (body) Link annotation.
1686216905
- parameter storage: (query) The document storage. (optional)
1686316906
- parameter folder: (query) The document folder. (optional)
1686416907

@@ -17005,7 +17048,7 @@ open class PdfAPI {
1700517048
/**
1700617049
Merge a list of documents.
1700717050

17008-
- parameter name: (path) Resulting documen name.
17051+
- parameter name: (path) Resulting document name.
1700917052
- parameter mergeDocuments: (body) MergeDocuments with a list of documents.
1701017053
- parameter storage: (query) Resulting document storage. (optional)
1701117054
- parameter folder: (query) Resulting document folder. (optional)
@@ -17033,7 +17076,7 @@ open class PdfAPI {
1703317076
- name: JWT
1703417077
- examples: [{contentType=application/json, example=""}]
1703517078

17036-
- parameter name: (path) Resulting documen name.
17079+
- parameter name: (path) Resulting document name.
1703717080
- parameter mergeDocuments: (body) MergeDocuments with a list of documents.
1703817081
- parameter storage: (query) Resulting document storage. (optional)
1703917082
- parameter folder: (query) Resulting document folder. (optional)
@@ -21643,7 +21686,7 @@ open class PdfAPI {
2164321686
}
2164421687

2164521688
/**
21646-
Converts PDF document which contatins XFA form (in request content) to PDF with AcroForm and uploads resulting file to storage.
21689+
Converts PDF document which contains XFA form (in request content) to PDF with AcroForm and uploads resulting file to storage.
2164721690

2164821691
- parameter outPath: (query) Full resulting filename (ex. /folder1/folder2/result.pdf)
2164921692
- parameter storage: (query) The document storage. (optional)
@@ -21665,7 +21708,7 @@ open class PdfAPI {
2166521708

2166621709

2166721710
/**
21668-
Converts PDF document which contatins XFA form (in request content) to PDF with AcroForm and uploads resulting file to storage.
21711+
Converts PDF document which contains XFA form (in request content) to PDF with AcroForm and uploads resulting file to storage.
2166921712
- PUT /pdf/convert/xfatoacroform
2167021713
- OAuth:
2167121714
- type: oauth2
@@ -21704,7 +21747,7 @@ open class PdfAPI {
2170421747
}
2170521748

2170621749
/**
21707-
Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and uploads resulting file to storage
21750+
Converts PDF document which contains XFA form (located on storage) to PDF with AcroForm and uploads resulting file to storage
2170821751

2170921752
- parameter name: (path) The document name.
2171021753
- parameter outPath: (query) Full resulting filename (ex. /folder1/folder2/result.pdf)
@@ -21727,7 +21770,7 @@ open class PdfAPI {
2172721770

2172821771

2172921772
/**
21730-
Converts PDF document which contatins XFA form (located on storage) to PDF with AcroForm and uploads resulting file to storage
21773+
Converts PDF document which contains XFA form (located on storage) to PDF with AcroForm and uploads resulting file to storage
2173121774
- PUT /pdf/{name}/convert/xfatoacroform
2173221775
- OAuth:
2173321776
- type: oauth2

AsposePdfCloud/Models/ApiInfo.swift

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
*
3+
* Copyright (c) 2020 Aspose.PDF Cloud
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
* The above copyright notice and this permission notice shall be included in all
11+
* copies or substantial portions of the Software.
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18+
* SOFTWARE.
19+
*
20+
*/
21+
22+
23+
24+
25+
import Foundation
26+
27+
28+
/** Represents response for ApiInfo DTO */
29+
30+
open class ApiInfo: Codable {
31+
32+
/** Product name. */
33+
public var name: String?
34+
/** API version. */
35+
public var version: String?
36+
37+
38+
39+
public init(name: String?, version: String?) {
40+
self.name = name
41+
self.version = version
42+
}
43+
44+
45+
// Encodable protocol methods
46+
47+
public func encode(to encoder: Encoder) throws {
48+
49+
var container = encoder.container(keyedBy: String.self)
50+
51+
try container.encodeIfPresent(name, forKey: "Name")
52+
try container.encodeIfPresent(version, forKey: "Version")
53+
}
54+
55+
// Decodable protocol methods
56+
57+
public required init(from decoder: Decoder) throws {
58+
let container = try decoder.container(keyedBy: String.self)
59+
60+
name = try container.decodeIfPresent(String.self, forKey: "Name")
61+
version = try container.decodeIfPresent(String.self, forKey: "Version")
62+
}
63+
}
64+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
*
3+
* Copyright (c) 2020 Aspose.PDF Cloud
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
* The above copyright notice and this permission notice shall be included in all
11+
* copies or substantial portions of the Software.
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18+
* SOFTWARE.
19+
*
20+
*/
21+
22+
23+
24+
25+
import Foundation
26+
27+
28+
/** Describes versions of image compression algorithm. */
29+
public enum ImageCompressionVersion: String, Codable {
30+
case standard = "Standard"
31+
case fast = "Fast"
32+
case mixed = "Mixed"
33+
34+
}

0 commit comments

Comments
 (0)