@thegrizzlylabs/react-native-genius-scan 5.0.0-beta8 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/geniusscansdk/reactnative/RNGeniusScanModule.java +0 -7
- package/index.js +0 -7
- package/ios/GSSDK/GSSDK.xcframework/Info.plist +5 -5
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK_GSSDKObjC.bundle/backbone.tflite +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK_GSSDKObjC.bundle/head_classif.tflite +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKCore.h +2 -73
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKLicenseKeyChecker.h +24 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSSDK-Swift.h +82 -48
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSSDK.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Info.plist +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.abi.json +1646 -783
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +48 -17
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios.swiftinterface +48 -17
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/PhoneNumberKit_PhoneNumberKit.bundle/PhoneNumberMetadata.json +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/backbone.tflite +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/head_classif.tflite +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/GSSDK +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/GSSDK_GSSDKObjC.bundle/backbone.tflite +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/GSSDK_GSSDKObjC.bundle/head_classif.tflite +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKCore.h +2 -73
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKLicenseKeyChecker.h +24 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK-Swift.h +164 -96
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSSDK.h +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Info.plist +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1646 -783
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +48 -17
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +48 -17
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1646 -783
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +48 -17
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Modules/GSSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +48 -17
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/PhoneNumberKit_PhoneNumberKit.bundle/PhoneNumberMetadata.json +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/backbone.tflite +0 -0
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/head_classif.tflite +0 -0
- package/ios/RNGeniusScan.m +0 -11
- package/package.json +1 -1
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/Headers/GSKPDFGeneratorError.h +0 -25
- package/ios/GSSDK/GSSDK.xcframework/ios-arm64_x86_64-simulator/GSSDK.framework/Headers/GSKPDFGeneratorError.h +0 -25
package/android/build.gradle
CHANGED
|
@@ -78,11 +78,4 @@ public class RNGeniusScanModule extends ReactContextBaseJavaModule {
|
|
|
78
78
|
PluginBridge.setLicenseKey(this.reactContext, licenseKey, autoRefresh);
|
|
79
79
|
promise.resolve(null);
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
@SuppressWarnings("unused")
|
|
83
|
-
@ReactMethod
|
|
84
|
-
public void setLicenceKey(String licenseKey, Promise promise) {
|
|
85
|
-
PromiseResult promiseResult = PluginBridge.setLicenseKey(this.reactContext, licenseKey);
|
|
86
|
-
resolvePromiseWithPromiseResult(promise, promiseResult);
|
|
87
|
-
}
|
|
88
81
|
}
|
package/index.js
CHANGED
|
@@ -7,12 +7,5 @@ const { RNGeniusScan } = NativeModules;
|
|
|
7
7
|
export default {
|
|
8
8
|
scanWithConfiguration: (scanOptions = {}) => RNGeniusScan.scanWithConfiguration(scanOptions),
|
|
9
9
|
generateDocument: RNGeniusScan.generateDocument,
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated
|
|
12
|
-
*/
|
|
13
|
-
setLicenceKey: (key) => {
|
|
14
|
-
console.warn("setLicenceKey is deprecated. Please use setLicenseKey instead.")
|
|
15
|
-
RNGeniusScan.setLicenceKey(key)
|
|
16
|
-
},
|
|
17
10
|
setLicenseKey: RNGeniusScan.setLicenseKey
|
|
18
11
|
};
|
|
@@ -10,15 +10,18 @@
|
|
|
10
10
|
<key>DebugSymbolsPath</key>
|
|
11
11
|
<string>dSYMs</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<string>ios-
|
|
13
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
14
14
|
<key>LibraryPath</key>
|
|
15
15
|
<string>GSSDK.framework</string>
|
|
16
16
|
<key>SupportedArchitectures</key>
|
|
17
17
|
<array>
|
|
18
18
|
<string>arm64</string>
|
|
19
|
+
<string>x86_64</string>
|
|
19
20
|
</array>
|
|
20
21
|
<key>SupportedPlatform</key>
|
|
21
22
|
<string>ios</string>
|
|
23
|
+
<key>SupportedPlatformVariant</key>
|
|
24
|
+
<string>simulator</string>
|
|
22
25
|
</dict>
|
|
23
26
|
<dict>
|
|
24
27
|
<key>BinaryPath</key>
|
|
@@ -26,18 +29,15 @@
|
|
|
26
29
|
<key>DebugSymbolsPath</key>
|
|
27
30
|
<string>dSYMs</string>
|
|
28
31
|
<key>LibraryIdentifier</key>
|
|
29
|
-
<string>ios-
|
|
32
|
+
<string>ios-arm64</string>
|
|
30
33
|
<key>LibraryPath</key>
|
|
31
34
|
<string>GSSDK.framework</string>
|
|
32
35
|
<key>SupportedArchitectures</key>
|
|
33
36
|
<array>
|
|
34
37
|
<string>arm64</string>
|
|
35
|
-
<string>x86_64</string>
|
|
36
38
|
</array>
|
|
37
39
|
<key>SupportedPlatform</key>
|
|
38
40
|
<string>ios</string>
|
|
39
|
-
<key>SupportedPlatformVariant</key>
|
|
40
|
-
<string>simulator</string>
|
|
41
41
|
</dict>
|
|
42
42
|
</array>
|
|
43
43
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
package/ios/GSSDK/GSSDK.xcframework/ios-arm64/GSSDK.framework/GSSDK_GSSDKObjC.bundle/backbone.tflite
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
16
16
|
@class GSKPDFGeneratorConfiguration;
|
|
17
17
|
@class GSKTextLayout;
|
|
18
18
|
|
|
19
|
-
@protocol
|
|
19
|
+
@protocol GSKDocumentImageProcessor;
|
|
20
20
|
@protocol GSKLogger;
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -24,24 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
24
24
|
*/
|
|
25
25
|
@interface GSK : NSObject
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
Must be called first with a valid license key to enable the SDK.
|
|
29
|
-
|
|
30
|
-
This method returns an error if the SDK isn't initialized properly. In addition, all other SDK methods that return errors will report an error if there
|
|
31
|
-
is a problem with the license key, and you must handle them to ensure you provide a good "degraded" experience.
|
|
32
|
-
For instance, you can prompt the user to update the application to use the scanning feature in case they use a version of the application with an expired license key.
|
|
33
|
-
|
|
34
|
-
This method is deprecated in favor of `setLicenseKey:autoRefresh:`.
|
|
35
|
-
|
|
36
|
-
@warning *Important* This method must be called before any use of the SDK methods.
|
|
37
|
-
|
|
38
|
-
@param licenseKey The license key
|
|
39
|
-
@param error On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information.
|
|
40
|
-
You may specify nil for this parameter if you do not want the error information.
|
|
41
|
-
|
|
42
|
-
@return YES if the SDK was initialized successfully, NO if an error occured.
|
|
43
|
-
*/
|
|
44
|
-
+ (BOOL)initWithLicenseKey:(NSString *)licenseKey error:(NSError * _Nullable *)error __deprecated_msg("-setLicenseKey:autoRefresh: instead.");
|
|
27
|
+
@property (nonatomic, class, strong, readonly) NSString *version;
|
|
45
28
|
|
|
46
29
|
/// Sets the Genius Scan SDK license key with auto-refresh enabled.
|
|
47
30
|
///
|
|
@@ -66,58 +49,4 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
66
49
|
|
|
67
50
|
@end
|
|
68
51
|
|
|
69
|
-
/**
|
|
70
|
-
GSKPDF encapsulate the generation of a PDF document.
|
|
71
|
-
*/
|
|
72
|
-
@interface GSKPDF : NSObject
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
Write the given PDF document to the specified file path.
|
|
76
|
-
|
|
77
|
-
@param document The PDF document.
|
|
78
|
-
@param filePath The file path to write the PDF to.
|
|
79
|
-
@param processor An object to preprocess each image before creating the corresponding page. For instance, you can inject a preprocessor to downsample the images.
|
|
80
|
-
@param error On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
|
|
81
|
-
|
|
82
|
-
@return YES if the PDF was generated successfully, NO if an error occured.
|
|
83
|
-
|
|
84
|
-
This method will take some time, proportionally to the number of pages of the PDF document.
|
|
85
|
-
*/
|
|
86
|
-
+ (BOOL)generatePDFDocument:(GSKPDFDocument *)document
|
|
87
|
-
toPath:(NSString *)filePath
|
|
88
|
-
withConfiguration:(GSKPDFGeneratorConfiguration *)configuration
|
|
89
|
-
withImageProcessor:(_Nullable id<GSKPDFImageProcessor>)processor
|
|
90
|
-
error:(NSError * _Nullable *)error NS_SWIFT_NAME(generate(_:toPath:configuration:imageProcessor:)) __deprecated_msg("Use GSKDocumentGenerator instead.");
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
A convenience shorthand for the previous method with a processor that doesn't apply any change to the images.
|
|
94
|
-
*/
|
|
95
|
-
+ (BOOL)generatePDFDocument:(GSKPDFDocument *)document
|
|
96
|
-
toPath:(NSString *)filePath
|
|
97
|
-
error:(NSError * _Nullable *)error __deprecated_msg("Use GSKDocumentGenerator instead.");
|
|
98
|
-
|
|
99
|
-
@end
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
GSKTIFF encapsulate the generation of a TIFF document.
|
|
103
|
-
*/
|
|
104
|
-
@interface GSKTIFF : NSObject
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
Write the given TIFF document to the specified file path.
|
|
108
|
-
|
|
109
|
-
@param document The TIFF document.
|
|
110
|
-
@param filePath The file path to write the TIFF to.
|
|
111
|
-
@param error On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
|
|
112
|
-
|
|
113
|
-
@return YES if the TIFF was generated successfully, NO if an error occured.
|
|
114
|
-
|
|
115
|
-
This method will take some time, proportionally to the number of pages of the TIFF document.
|
|
116
|
-
*/
|
|
117
|
-
+ (BOOL)generateTIFFDocument:(GSKPDFDocument *)document
|
|
118
|
-
toPath:(NSString *)filePath
|
|
119
|
-
error:(NSError * _Nullable *)error;
|
|
120
|
-
|
|
121
|
-
@end
|
|
122
|
-
|
|
123
52
|
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GSKLicenseKeyChecker.h
|
|
3
|
+
// GSSDK
|
|
4
|
+
//
|
|
5
|
+
// Created by Bruno Virlet on 15/03/2024.
|
|
6
|
+
// Copyright © 2024 The Grizzly Labs. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
@interface GSKLicenseKeyChecker : NSObject
|
|
14
|
+
|
|
15
|
+
+ (BOOL)checkLicenseWithError:(NSError *__autoreleasing _Nullable * _Nullable)error;
|
|
16
|
+
|
|
17
|
+
#if DEBUG
|
|
18
|
+
/// Enables simulating an invalid license in the tests.
|
|
19
|
+
@property (nonatomic, class, assign) BOOL simulateInvalid;
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
@end
|
|
23
|
+
|
|
24
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -320,27 +320,47 @@ typedef SWIFT_ENUM(NSInteger, GSKDocumentFinderImageType, closed) {
|
|
|
320
320
|
};
|
|
321
321
|
|
|
322
322
|
@class GSKPDFDocument;
|
|
323
|
+
@protocol GSKDocumentImageProcessor;
|
|
323
324
|
@class GSKDocumentGeneratorConfiguration;
|
|
324
325
|
|
|
325
326
|
/// This class exposes the capacility to generate a PDF document file.
|
|
326
327
|
SWIFT_CLASS("_TtC5GSSDK20GSKDocumentGenerator")
|
|
327
328
|
@interface GSKDocumentGenerator : NSObject
|
|
328
329
|
/// Generates a document file based on a document model and a generator configuration.
|
|
329
|
-
|
|
330
|
+
/// \param document The source document to generate as PDF.
|
|
331
|
+
///
|
|
332
|
+
/// \param imageProcessor An object used to process each source document’s image before inserting it in the resulting document.
|
|
333
|
+
/// Only used when generating a PDF document
|
|
334
|
+
///
|
|
335
|
+
/// \param configuration The configuration for the document generation.
|
|
336
|
+
///
|
|
337
|
+
- (BOOL)generate:(GSKPDFDocument * _Nonnull)document imageProcessor:(id <GSKDocumentImageProcessor> _Nonnull)imageProcessor configuration:(GSKDocumentGeneratorConfiguration * _Nonnull)configuration error:(NSError * _Nullable * _Nullable)error;
|
|
330
338
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
331
339
|
@end
|
|
332
340
|
|
|
341
|
+
enum GSKDocumentGeneratorFileFormat : NSInteger;
|
|
333
342
|
@class NSString;
|
|
343
|
+
@class GSKDocumentGeneratorDebugConfiguration;
|
|
334
344
|
|
|
335
345
|
/// A configuration for the document generator.
|
|
336
346
|
SWIFT_CLASS("_TtC5GSSDK33GSKDocumentGeneratorConfiguration")
|
|
337
347
|
@interface GSKDocumentGeneratorConfiguration : NSObject
|
|
338
|
-
/// The
|
|
348
|
+
/// The output file format of the document generator. Must be .pdf or .tif.
|
|
349
|
+
@property (nonatomic, readonly) enum GSKDocumentGeneratorFileFormat outputFileFormat;
|
|
350
|
+
/// The path where the generated document will be written. The extension will not be validated.
|
|
339
351
|
@property (nonatomic, readonly, copy) NSString * _Nonnull outputFilePath;
|
|
340
352
|
/// Custom font file used during the PDF generation to embed an invisible text layer.
|
|
341
353
|
/// If nil, a default font is used, which only supports Latin languages.
|
|
354
|
+
/// Only used when <code>outputFileFormat</code> is <code>.pdf</code>.
|
|
342
355
|
@property (nonatomic, readonly, copy) NSString * _Nullable pdfFontFilePath;
|
|
343
|
-
|
|
356
|
+
/// Generate a PDF/A document
|
|
357
|
+
@property (nonatomic, readonly) BOOL shouldGeneratePDFA;
|
|
358
|
+
/// An optional debug configuration to help debug PDF generation problems.
|
|
359
|
+
/// Don’t use this in production. Default is nil.
|
|
360
|
+
@property (nonatomic, readonly, strong) GSKDocumentGeneratorDebugConfiguration * _Nullable debugConfiguration;
|
|
361
|
+
- (nonnull instancetype)initWithOutputFileFormat:(enum GSKDocumentGeneratorFileFormat)outputFileFormat outputFilePath:(NSString * _Nonnull)outputFilePath pdfFontFilePath:(NSString * _Nullable)pdfFontFilePath shouldGeneratePDFA:(BOOL)shouldGeneratePDFA debugConfiguration:(GSKDocumentGeneratorDebugConfiguration * _Nullable)debugConfiguration OBJC_DESIGNATED_INITIALIZER;
|
|
362
|
+
+ (GSKDocumentGeneratorConfiguration * _Nonnull)pdfConfigurationWithOutputFilePath:(NSString * _Nonnull)outputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
363
|
+
+ (GSKDocumentGeneratorConfiguration * _Nonnull)tiffConfigurationWithOutputFilePath:(NSString * _Nonnull)outputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
344
364
|
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
345
365
|
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
346
366
|
@end
|
|
@@ -351,6 +371,55 @@ SWIFT_CLASS("_TtC5GSSDK33GSKDocumentGeneratorConfiguration")
|
|
|
351
371
|
@end
|
|
352
372
|
|
|
353
373
|
|
|
374
|
+
SWIFT_CLASS("_TtC5GSSDK38GSKDocumentGeneratorDebugConfiguration")
|
|
375
|
+
@interface GSKDocumentGeneratorDebugConfiguration : NSObject
|
|
376
|
+
/// If true, OCR’ed text will visible on the PDF.
|
|
377
|
+
/// Defaults to false. Use this for debug only
|
|
378
|
+
@property (nonatomic, readonly) BOOL isOCRTextShownOnPDF;
|
|
379
|
+
- (nonnull instancetype)initWithIsOCRTextShownOnPDF:(BOOL)isOCRTextShownOnPDF OBJC_DESIGNATED_INITIALIZER;
|
|
380
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
381
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
382
|
+
@end
|
|
383
|
+
|
|
384
|
+
/// Error raised while generating a multi-page document
|
|
385
|
+
typedef SWIFT_ENUM(NSInteger, GSKDocumentGeneratorError, open) {
|
|
386
|
+
/// An internal error. Look at logs or contact us for more details.
|
|
387
|
+
GSKDocumentGeneratorErrorInternal SWIFT_COMPILE_NAME("internal") = 0,
|
|
388
|
+
/// A provided file wasn’t found.
|
|
389
|
+
GSKDocumentGeneratorErrorFileNotFound SWIFT_COMPILE_NAME("fileNotFound") = 1,
|
|
390
|
+
/// The provided password is invalid for use in a PDF file.
|
|
391
|
+
GSKDocumentGeneratorErrorInvalidPassword SWIFT_COMPILE_NAME("invalidPassword") = 2,
|
|
392
|
+
/// The provided page size is unsupported for a PDF file.
|
|
393
|
+
GSKDocumentGeneratorErrorInvalidPageSize SWIFT_COMPILE_NAME("invalidPageSize") = 3,
|
|
394
|
+
/// There was an error processing the image associated to a document page.
|
|
395
|
+
GSKDocumentGeneratorErrorProcessorError SWIFT_COMPILE_NAME("processorError") = 4,
|
|
396
|
+
/// An input to the document generator is invalid.
|
|
397
|
+
GSKDocumentGeneratorErrorInvalidInput SWIFT_COMPILE_NAME("invalidInput") = 5,
|
|
398
|
+
};
|
|
399
|
+
static NSString * _Nonnull const GSKDocumentGeneratorErrorDomain = @"GSSDK.GSKDocumentGeneratorError";
|
|
400
|
+
|
|
401
|
+
typedef SWIFT_ENUM(NSInteger, GSKDocumentGeneratorFileFormat, open) {
|
|
402
|
+
GSKDocumentGeneratorFileFormatPDF SWIFT_COMPILE_NAME("pdf") = 0,
|
|
403
|
+
GSKDocumentGeneratorFileFormatTIFF SWIFT_COMPILE_NAME("tiff") = 1,
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
/// Used to preprocess pages of the PDF generation.
|
|
408
|
+
/// When you generate a PDF document from images, you may want to apply some preprocessing to each image
|
|
409
|
+
/// before inserting them in the document (for instance resizing them, including a watermark, etc.) You can
|
|
410
|
+
/// implement your own PDF_image_processor and pass it when generating a PDF document.
|
|
411
|
+
/// to achieve this.
|
|
412
|
+
SWIFT_PROTOCOL("_TtP5GSSDK25GSKDocumentImageProcessor_")
|
|
413
|
+
@protocol GSKDocumentImageProcessor
|
|
414
|
+
/// Process the image and return a file path to the
|
|
415
|
+
/// updated image. The PDF processor will delete this temporary
|
|
416
|
+
/// image afterwards (only if it’s different from inputFilePath)
|
|
417
|
+
/// @return nil if there is an error
|
|
418
|
+
- (NSString * _Nullable)process:(NSString * _Nonnull)inputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
419
|
+
@end
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
354
423
|
/// Internal use.
|
|
355
424
|
SWIFT_CLASS("_TtC5GSSDK22GSKLicenseKeyRefresher")
|
|
356
425
|
@interface GSKLicenseKeyRefresher : NSObject
|
|
@@ -359,7 +428,7 @@ SWIFT_CLASS("_TtC5GSSDK22GSKLicenseKeyRefresher")
|
|
|
359
428
|
/// \param baseLicenseKey the license key provided to the customer. This license key must be a valid license key but
|
|
360
429
|
/// may be expired. It will be used to retrieve a fresh license key if needed.
|
|
361
430
|
///
|
|
362
|
-
- (nonnull instancetype)initWithBaseLicenseKey:(NSString * _Nonnull)baseLicenseKey;
|
|
431
|
+
- (nonnull instancetype)initWithBaseLicenseKey:(NSString * _Nonnull)baseLicenseKey sdkVersion:(NSString * _Nonnull)sdkVersion;
|
|
363
432
|
/// Refreshes the license key.
|
|
364
433
|
/// The updated license key is passed in the <code>onSuccess</code> closure. It may be the same key as the provided key.
|
|
365
434
|
/// In case of failure, the <code>onFailure</code> closure is called.
|
|
@@ -373,6 +442,14 @@ SWIFT_CLASS("_TtC5GSSDK22GSKLicenseKeyRefresher")
|
|
|
373
442
|
|
|
374
443
|
|
|
375
444
|
|
|
445
|
+
|
|
446
|
+
/// A document image processor that performs no operation and returns the input file as an output
|
|
447
|
+
SWIFT_CLASS("_TtC5GSSDK29GSKNoopDocumentImageProcessor")
|
|
448
|
+
@interface GSKNoopDocumentImageProcessor : NSObject <GSKDocumentImageProcessor>
|
|
449
|
+
- (NSString * _Nullable)process:(NSString * _Nonnull)inputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
450
|
+
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
451
|
+
@end
|
|
452
|
+
|
|
376
453
|
@protocol GSKLogger;
|
|
377
454
|
@class GSKOCRConfiguration;
|
|
378
455
|
@class GSKOCRResult;
|
|
@@ -456,48 +533,6 @@ SWIFT_CLASS("_TtC5GSSDK14GSKPDFDocument")
|
|
|
456
533
|
- (nullable instancetype)initWithDictionary:(NSDictionary<NSString *, id> * _Nonnull)dictionary error:(NSError * _Nullable * _Nullable)error;
|
|
457
534
|
@end
|
|
458
535
|
|
|
459
|
-
|
|
460
|
-
SWIFT_CLASS("_TtC5GSSDK28GSKPDFGeneratorConfiguration")
|
|
461
|
-
@interface GSKPDFGeneratorConfiguration : NSObject
|
|
462
|
-
@property (nonatomic, readonly, copy) NSString * _Nullable fontPath;
|
|
463
|
-
/// An ICC profile file that will be configured on the
|
|
464
|
-
/// PDF file. This is needed to have PDF/A compliance.
|
|
465
|
-
/// It’s a RGB profile so that it supports any RGB or Grayscale
|
|
466
|
-
/// image.
|
|
467
|
-
@property (nonatomic, readonly, copy) NSString * _Nullable iccProfilePath;
|
|
468
|
-
/// If true, OCR’ed text will visible on the PDF.
|
|
469
|
-
/// Defaults to false
|
|
470
|
-
@property (nonatomic, readonly) BOOL debug;
|
|
471
|
-
- (nonnull instancetype)initWithFontPath:(NSString * _Nullable)fontPath iccProfilePath:(NSString * _Nullable)iccProfilePath;
|
|
472
|
-
/// A configuration with the specified font path. This configuration will generate a PDF/A-1 with a default ICC profile.
|
|
473
|
-
/// If you don’t want a PDF/A-1, use <code>initWithFontPath:iccProfilePath:</code> and pass <code>nil</code> for the ICC profile path.
|
|
474
|
-
- (nonnull instancetype)initWithFontPath:(NSString * _Nullable)fontPath;
|
|
475
|
-
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
476
|
-
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
477
|
-
@end
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
/// Used to preprocess pages of the PDF generation.
|
|
481
|
-
/// When you generate a PDF document from images, you may want to apply some preprocessing to each image
|
|
482
|
-
/// before inserting them in the document (for instance resizing them, including a watermark, etc.) You can
|
|
483
|
-
/// implement your own PDF_image_processor and pass it when generating a PDF document.
|
|
484
|
-
/// to achieve this.
|
|
485
|
-
SWIFT_PROTOCOL("_TtP5GSSDK20GSKPDFImageProcessor_")
|
|
486
|
-
@protocol GSKPDFImageProcessor
|
|
487
|
-
/// Process the image and return a file path to the
|
|
488
|
-
/// updated image. The PDF processor will delete this temporary
|
|
489
|
-
/// image afterwards (only if it’s different from inputFilePath)
|
|
490
|
-
/// @return nil if there is an error
|
|
491
|
-
- (NSString * _Nullable)process:(NSString * _Nonnull)inputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
492
|
-
@end
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
SWIFT_CLASS("_TtC5GSSDK24GSKPDFNoopImageProcessor")
|
|
496
|
-
@interface GSKPDFNoopImageProcessor : NSObject <GSKPDFImageProcessor>
|
|
497
|
-
- (NSString * _Nullable)process:(NSString * _Nonnull)inputFilePath SWIFT_WARN_UNUSED_RESULT;
|
|
498
|
-
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
499
|
-
@end
|
|
500
|
-
|
|
501
536
|
@class GSKPDFSize;
|
|
502
537
|
|
|
503
538
|
/// Describes a page of a PDF document for the PDF generator.
|
|
@@ -642,7 +677,6 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
|
|
|
642
677
|
@end
|
|
643
678
|
|
|
644
679
|
|
|
645
|
-
|
|
646
680
|
@interface GSKScanFlowConfiguration (SWIFT_EXTENSION(GSSDK))
|
|
647
681
|
/// Create a configuration from a dictionary.
|
|
648
682
|
/// This is particularly useful for interfacing with React Native but shouldn’t
|
|
@@ -651,6 +685,7 @@ SWIFT_CLASS("_TtC5GSSDK24GSKScanFlowConfiguration")
|
|
|
651
685
|
@end
|
|
652
686
|
|
|
653
687
|
|
|
688
|
+
|
|
654
689
|
/// Enum that defines various errors that can occur during a scan flow.
|
|
655
690
|
typedef SWIFT_ENUM(NSInteger, GSKScanFlowError, open) {
|
|
656
691
|
/// User has canceled the scan flow
|
|
@@ -744,7 +779,6 @@ SWIFT_CLASS("_TtC5GSSDK17GSKScanFlowResult")
|
|
|
744
779
|
|
|
745
780
|
|
|
746
781
|
@interface GSKScanFlowResult (SWIFT_EXTENSION(GSSDK))
|
|
747
|
-
@property (nonatomic, readonly, copy) NSURL * _Nullable pdfURL SWIFT_DEPRECATED_MSG("Use multiPageDocumentURL instead");
|
|
748
782
|
/// A dictionary representation of the result.
|
|
749
783
|
/// Convenient for interfacing with React Native, probably no reason to
|
|
750
784
|
/// use it with native code.
|
|
@@ -19,6 +19,7 @@ FOUNDATION_EXPORT const unsigned char GSSDKVersionString[];
|
|
|
19
19
|
#import <GSSDK/GSKLog.h>
|
|
20
20
|
#import <GSSDK/GSKLoggerSeverity.h>
|
|
21
21
|
#import <GSSDK/GSKDefaultLogger.h>
|
|
22
|
+
#import <GSSDK/GSKLicenseKeyChecker.h>
|
|
22
23
|
|
|
23
24
|
// UI
|
|
24
25
|
#import <GSSDK/GSKCameraSession.h>
|
|
@@ -39,4 +40,3 @@ FOUNDATION_EXPORT const unsigned char GSSDKVersionString[];
|
|
|
39
40
|
#import <GSSDK/GSKScanFlowStructuredData.h>
|
|
40
41
|
#import <GSSDK/GSKScanFlowOCROutputFormats.h>
|
|
41
42
|
#import <GSSDK/GSKScanFlowErrorDomain.h>
|
|
42
|
-
#import <GSSDK/GSKPDFGeneratorError.h>
|
|
Binary file
|