SBSDKUIPDFRenderer
@interface SBSDKUIPDFRenderer : NSObject
A class to render a SBSDKUIDocument
into a PDF.
-
Renders the document into a PDF at the specified file url.
Declaration
Objective-C
+ (nullable NSError *)renderDocument:(nonnull SBSDKUIDocument *)document withPageSize:(SBSDKPDFRendererPageSize)pageSize output:(nonnull NSURL *)pdfOutputURL;
Swift
class func renderDocument(_ document: SBSDKUIDocument, with pageSize: SBSDKPDFRendererPageSize, output pdfOutputURL: URL) -> Error?
Parameters
document
The document to be rendered as a PDF document.
pageSize
The size of the pages in the PDF document.
pdfOutputURL
The file URL where the PDF document is saved at.
Return Value
An NSError if the operation failed, nil otherwise.
-
Performs optical text recognition and renders the document into a searchable PDF at the specified file url.
Declaration
Objective-C
+ (nullable NSError *)renderDocument:(nonnull SBSDKUIDocument *)document withOCRLanguages:(nullable NSArray<NSString *> *)languages output:(nonnull NSURL *)pdfOutputURL;
Swift
class func renderDocument(_ document: SBSDKUIDocument, withOCRLanguages languages: [String]?, output pdfOutputURL: URL) -> Error?
Parameters
document
The document to be rendered as a PDF document.
languages
Array of language strings to be used by optical text recognition. If empty or nil, english language is used. Specify languages using ISO two-letter-language-codes, e.g. “en”, “de”.
pdfOutputURL
The file URL where the PDF document is saved at.
Return Value
An NSError if the operation failed, nil otherwise.