Skip to content

Commit ae1a70b

Browse files
committed
fix PDF
1 parent 0bc3d41 commit ae1a70b

2 files changed

Lines changed: 79 additions & 59 deletions

File tree

OpenDocumentReader/CoreWrapper.mm

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,26 @@ - (bool)translate:(NSString *)inputPath into:(NSString *)outputPath with:(NSStri
4747
auto inputPathC = [inputPath cStringUsingEncoding:NSUTF8StringEncoding];
4848
auto inputPathCpp = std::string(inputPathC);
4949

50+
odr::FileType fileType;
51+
try {
52+
const auto types = odr::OpenDocumentReader::types(inputPathCpp);
53+
if (types.empty()) {
54+
_errorCode = @(-5);
55+
return false;
56+
}
57+
58+
fileType = types.back();
59+
} catch (odr::UnsupportedFileType &e) {
60+
_errorCode = @(-5);
61+
return false;
62+
}
63+
64+
const auto extensionCpp = odr::OpenDocumentReader::type_to_string(fileType);
65+
if (extensionCpp == "pdf") {
66+
_errorCode = @(-5);
67+
return false;
68+
}
69+
5070
auto outputPathC = [outputPath cStringUsingEncoding:NSUTF8StringEncoding];
5171
auto outputPathCpp = std::string(outputPathC);
5272

Podfile.lock

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
11
PODS:
2-
- Firebase/Analytics (11.2.0):
2+
- Firebase/Analytics (11.7.0):
33
- Firebase/Core
4-
- Firebase/Core (11.2.0):
4+
- Firebase/Core (11.7.0):
55
- Firebase/CoreOnly
6-
- FirebaseAnalytics (~> 11.2.0)
7-
- Firebase/CoreOnly (11.2.0):
8-
- FirebaseCore (= 11.2.0)
9-
- Firebase/Crashlytics (11.2.0):
6+
- FirebaseAnalytics (~> 11.7.0)
7+
- Firebase/CoreOnly (11.7.0):
8+
- FirebaseCore (~> 11.7.0)
9+
- Firebase/Crashlytics (11.7.0):
1010
- Firebase/CoreOnly
11-
- FirebaseCrashlytics (~> 11.2.0)
12-
- Firebase/Storage (11.2.0):
11+
- FirebaseCrashlytics (~> 11.7.0)
12+
- Firebase/Storage (11.7.0):
1313
- Firebase/CoreOnly
14-
- FirebaseStorage (~> 11.2.0)
15-
- FirebaseAnalytics (11.2.0):
16-
- FirebaseAnalytics/AdIdSupport (= 11.2.0)
17-
- FirebaseCore (~> 11.0)
14+
- FirebaseStorage (~> 11.7.0)
15+
- FirebaseAnalytics (11.7.0):
16+
- FirebaseAnalytics/AdIdSupport (= 11.7.0)
17+
- FirebaseCore (~> 11.7.0)
1818
- FirebaseInstallations (~> 11.0)
1919
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
2020
- GoogleUtilities/MethodSwizzler (~> 8.0)
2121
- GoogleUtilities/Network (~> 8.0)
2222
- "GoogleUtilities/NSData+zlib (~> 8.0)"
2323
- nanopb (~> 3.30910.0)
24-
- FirebaseAnalytics/AdIdSupport (11.2.0):
25-
- FirebaseCore (~> 11.0)
24+
- FirebaseAnalytics/AdIdSupport (11.7.0):
25+
- FirebaseCore (~> 11.7.0)
2626
- FirebaseInstallations (~> 11.0)
27-
- GoogleAppMeasurement (= 11.2.0)
27+
- GoogleAppMeasurement (= 11.7.0)
2828
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
2929
- GoogleUtilities/MethodSwizzler (~> 8.0)
3030
- GoogleUtilities/Network (~> 8.0)
3131
- "GoogleUtilities/NSData+zlib (~> 8.0)"
3232
- nanopb (~> 3.30910.0)
33-
- FirebaseAppCheckInterop (11.2.0)
34-
- FirebaseAuthInterop (11.2.0)
35-
- FirebaseCore (11.2.0):
36-
- FirebaseCoreInternal (~> 11.0)
33+
- FirebaseAppCheckInterop (11.7.0)
34+
- FirebaseAuthInterop (11.7.0)
35+
- FirebaseCore (11.7.0):
36+
- FirebaseCoreInternal (~> 11.7.0)
3737
- GoogleUtilities/Environment (~> 8.0)
3838
- GoogleUtilities/Logger (~> 8.0)
39-
- FirebaseCoreExtension (11.2.0):
40-
- FirebaseCore (~> 11.0)
41-
- FirebaseCoreInternal (11.2.0):
39+
- FirebaseCoreExtension (11.7.0):
40+
- FirebaseCore (~> 11.7.0)
41+
- FirebaseCoreInternal (11.7.0):
4242
- "GoogleUtilities/NSData+zlib (~> 8.0)"
43-
- FirebaseCrashlytics (11.2.0):
44-
- FirebaseCore (~> 11.0)
43+
- FirebaseCrashlytics (11.7.0):
44+
- FirebaseCore (~> 11.7.0)
4545
- FirebaseInstallations (~> 11.0)
4646
- FirebaseRemoteConfigInterop (~> 11.0)
4747
- FirebaseSessions (~> 11.0)
4848
- GoogleDataTransport (~> 10.0)
4949
- GoogleUtilities/Environment (~> 8.0)
5050
- nanopb (~> 3.30910.0)
5151
- PromisesObjC (~> 2.4)
52-
- FirebaseInstallations (11.2.0):
53-
- FirebaseCore (~> 11.0)
52+
- FirebaseInstallations (11.7.0):
53+
- FirebaseCore (~> 11.7.0)
5454
- GoogleUtilities/Environment (~> 8.0)
5555
- GoogleUtilities/UserDefaults (~> 8.0)
5656
- PromisesObjC (~> 2.4)
57-
- FirebaseRemoteConfigInterop (11.2.0)
58-
- FirebaseSessions (11.2.0):
59-
- FirebaseCore (~> 11.0)
60-
- FirebaseCoreExtension (~> 11.0)
57+
- FirebaseRemoteConfigInterop (11.7.0)
58+
- FirebaseSessions (11.7.0):
59+
- FirebaseCore (~> 11.7.0)
60+
- FirebaseCoreExtension (~> 11.7.0)
6161
- FirebaseInstallations (~> 11.0)
6262
- GoogleDataTransport (~> 10.0)
6363
- GoogleUtilities/Environment (~> 8.0)
6464
- GoogleUtilities/UserDefaults (~> 8.0)
6565
- nanopb (~> 3.30910.0)
6666
- PromisesSwift (~> 2.1)
67-
- FirebaseStorage (11.2.0):
67+
- FirebaseStorage (11.7.0):
6868
- FirebaseAppCheckInterop (~> 11.0)
6969
- FirebaseAuthInterop (~> 11.0)
70-
- FirebaseCore (~> 11.0)
71-
- FirebaseCoreExtension (~> 11.0)
70+
- FirebaseCore (~> 11.7.0)
71+
- FirebaseCoreExtension (~> 11.7.0)
7272
- GoogleUtilities/Environment (~> 8.0)
73-
- GTMSessionFetcher/Core (~> 3.4)
74-
- Google-Mobile-Ads-SDK (11.9.0):
73+
- GTMSessionFetcher/Core (< 5.0, >= 3.4)
74+
- Google-Mobile-Ads-SDK (11.13.0):
7575
- GoogleUserMessagingPlatform (>= 1.1)
76-
- GoogleAppMeasurement (11.2.0):
77-
- GoogleAppMeasurement/AdIdSupport (= 11.2.0)
76+
- GoogleAppMeasurement (11.7.0):
77+
- GoogleAppMeasurement/AdIdSupport (= 11.7.0)
7878
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
7979
- GoogleUtilities/MethodSwizzler (~> 8.0)
8080
- GoogleUtilities/Network (~> 8.0)
8181
- "GoogleUtilities/NSData+zlib (~> 8.0)"
8282
- nanopb (~> 3.30910.0)
83-
- GoogleAppMeasurement/AdIdSupport (11.2.0):
84-
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.2.0)
83+
- GoogleAppMeasurement/AdIdSupport (11.7.0):
84+
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.7.0)
8585
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
8686
- GoogleUtilities/MethodSwizzler (~> 8.0)
8787
- GoogleUtilities/Network (~> 8.0)
8888
- "GoogleUtilities/NSData+zlib (~> 8.0)"
8989
- nanopb (~> 3.30910.0)
90-
- GoogleAppMeasurement/WithoutAdIdSupport (11.2.0):
90+
- GoogleAppMeasurement/WithoutAdIdSupport (11.7.0):
9191
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
9292
- GoogleUtilities/MethodSwizzler (~> 8.0)
9393
- GoogleUtilities/Network (~> 8.0)
@@ -96,7 +96,7 @@ PODS:
9696
- GoogleDataTransport (10.1.0):
9797
- nanopb (~> 3.30910.0)
9898
- PromisesObjC (~> 2.4)
99-
- GoogleUserMessagingPlatform (2.6.0)
99+
- GoogleUserMessagingPlatform (2.7.0)
100100
- GoogleUtilities/AppDelegateSwizzler (8.0.2):
101101
- GoogleUtilities/Environment
102102
- GoogleUtilities/Logger
@@ -124,7 +124,7 @@ PODS:
124124
- GoogleUtilities/UserDefaults (8.0.2):
125125
- GoogleUtilities/Logger
126126
- GoogleUtilities/Privacy
127-
- GTMSessionFetcher/Core (3.5.0)
127+
- GTMSessionFetcher/Core (4.3.0)
128128
- nanopb (3.30910.0):
129129
- nanopb/decode (= 3.30910.0)
130130
- nanopb/encode (= 3.30910.0)
@@ -169,29 +169,29 @@ SPEC REPOS:
169169
- ScrollableSegmentedControl
170170

171171
SPEC CHECKSUMS:
172-
Firebase: 98e6bf5278170668a7983e12971a66b2cd57fc8c
173-
FirebaseAnalytics: c36efd5710c60c17558650fa58c2066eca7e9265
174-
FirebaseAppCheckInterop: ea21450529cf0ebd132788dd8916a0269abc684f
175-
FirebaseAuthInterop: 47c09558af5d1b31f16fb352387c72d4804f4a24
176-
FirebaseCore: a282032ae9295c795714ded2ec9c522fc237f8da
177-
FirebaseCoreExtension: cda74ddfb001224bd8fd1d6e74698b4ed07803de
178-
FirebaseCoreInternal: 0c569513412da9f3b31bd0b340013bbee8f295c5
179-
FirebaseCrashlytics: cfc69af5b53565dc6a5e563788809b5778ac4eac
180-
FirebaseInstallations: 771177d89d6c451dc6e50085ec82e2fc77ed0a4a
181-
FirebaseRemoteConfigInterop: 477b26fdeb8fb5fbaf22fa9db5343b42289dc7db
182-
FirebaseSessions: adcec8b72d0066a385e3affcd1bcb1ebb3908ce6
183-
FirebaseStorage: 9353f926690b2329957860abfcbc8b4074fe45e8
184-
Google-Mobile-Ads-SDK: 6a3cdd892fd87c8b2a388c1cc74d2b7df2570f0b
185-
GoogleAppMeasurement: 76d4f8b36b03bd8381fa9a7fe2cc7f99c0a2e93a
172+
Firebase: a64bf6a8546e6eab54f1c715cd6151f39d2329f4
173+
FirebaseAnalytics: bc9e565af9044ba8d6c6e4157e4edca8e5fdf7ec
174+
FirebaseAppCheckInterop: 2376d3ec5cb4267facad4fe754ab4f301a5a519b
175+
FirebaseAuthInterop: a6973d72aa242ea88ffb6be9c9b06c65455071da
176+
FirebaseCore: 3227e35f4197a924206fbcdc0349325baf4f5de4
177+
FirebaseCoreExtension: 206c1b399f0d103055207c16f299b28e3dbd1949
178+
FirebaseCoreInternal: d6c17dafc8dc33614733a8b52df78fcb4394c881
179+
FirebaseCrashlytics: 785a73b624715bbc09a40bb56cdc3829a801cc98
180+
FirebaseInstallations: 9347e719c3d52d8d7b9074b2c32407dd027305e9
181+
FirebaseRemoteConfigInterop: ca12abf9da0003efd3a476b2dff4f7a04fd31b4f
182+
FirebaseSessions: 32ed7a9387ae71efe3a35a7f20f3a7292950957b
183+
FirebaseStorage: d35da127dd49edcbd07b8c07cf651a70161558b2
184+
Google-Mobile-Ads-SDK: 14f57f2dc33532a24db288897e26494640810407
185+
GoogleAppMeasurement: 0471a5b5bff51f3a91b1e76df22c952d04c63967
186186
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
187-
GoogleUserMessagingPlatform: 0c3a08353e53ce8c2feab7addd0b652cde522450
187+
GoogleUserMessagingPlatform: a8b56893477f67212fbc8411c139e61d463349f5
188188
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
189-
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
189+
GTMSessionFetcher: 257ead9ba8e15a2d389d79496e02b9cc5dd0c62c
190190
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
191191
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
192192
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
193193
ScrollableSegmentedControl: 2e64bbe8968a7fcd8aae5014434481464fcdfe60
194194

195195
PODFILE CHECKSUM: 35cd182dc790891ebc7626066c33a6e947e7167e
196196

197-
COCOAPODS: 1.15.2
197+
COCOAPODS: 1.16.2

0 commit comments

Comments
 (0)