PTConvert
@interface PTConvert : NSObject
Convert the input file to XPS format and save to the specified path
See
XPSOutputOptions
See
ToPdf()
Note
Requires the Convert::Printer class for all file formats that ToPdf also requires.
-
Undocumented
Declaration
Objective-C
+ (void)ToSvgWithPDFDoc: (PTPDFDoc*)in_pdfdoc in_filename: (NSString *)in_filename in_options: (PTSVGOutputOptions*)in_options;
Swift
class func toSvg(with in_pdfdoc: PTPDFDoc!, in_filename: String!, in_options: PTSVGOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToSvgWithPage: (PTPage*)in_page in_filename: (NSString *)in_filename in_options: (PTSVGOutputOptions*)in_options;
Swift
class func toSvg(with in_page: PTPage!, in_filename: String!, in_options: PTSVGOutputOptions!)
-
Convert the input file to XPS format and save to the specified path
See
ToPdf()
Note
Requires the Convert::Printer class for all file formats that ToPdf also requires.
Declaration
Objective-C
+ (void)ToXpsWithPDFDoc:(PTPDFDoc *)in_pdfdoc in_filename:(NSString *)in_filename options:(PTXPSOutputOptions *)options;
Swift
class func toXps(with in_pdfdoc: PTPDFDoc!, in_filename: String!, options: PTXPSOutputOptions!)
Parameters
in_inputFilename
the file to convert to XPS
in_outputFilename
the path to the XPS file to create
-
Undocumented
Declaration
Objective-C
+ (void)ToXpsWithFilename: (NSString *)in_inputFilename in_outputFilename: (NSString *)in_outputFilename options: (PTXPSOutputOptions*)options;
Swift
class func toXps(withFilename in_inputFilename: String!, in_outputFilename: String!, options: PTXPSOutputOptions!)
-
Convert the input file to XOD format and save to the specified path
See
XODOutputOptions
See
ToPdf()
Note
Requires the Convert::Printer class for all file formats that ToPdf also requires.
Declaration
Objective-C
+ (void)ToXodWithFilename:(NSString *)in_filename out_filename:(NSString *)out_filename options:(PTXODOutputOptions *)options;
Swift
class func toXod(withFilename in_filename: String!, out_filename: String!, options: PTXODOutputOptions!)
Parameters
in_filename
the file to convert to XOD
out_filename
the path to the XOD file to create
options
the conversion options
-
Convert the input file to XOD format and save to the specified path
See
ToPdf()
Note
Requires the Convert::Printer class for all file formats that ToPdf also requires.
Declaration
Objective-C
+ (void)ToXod:(NSString *)in_filename out_filename:(NSString *)out_filename;
Swift
class func toXod(_ in_filename: String!, out_filename: String!)
Parameters
in_filename
the file to convert to XOD
out_filename
the path to the XOD file to create
-
Convert the input file to XOD format and save to the specified path
See
XODOutputOptions
See
ToPdf()
Declaration
Objective-C
+ (void)ToXodWithPDFDoc:(PTPDFDoc *)in_pdfdoc out_filename:(NSString *)out_filename options:(PTXODOutputOptions *)options;
Swift
class func toXod(with in_pdfdoc: PTPDFDoc!, out_filename: String!, options: PTXODOutputOptions!)
Parameters
in_pdfdoc
the PDFDoc to convert to XOD
out_filename
the path to the XOD file to create
options
the conversion options
-
Undocumented
Declaration
Objective-C
+ (void)ToHtmlWithFilename: (NSString *)in_filename out_path: (NSString *)out_path options: (PTHTMLOutputOptions*)options;
Swift
class func toHtml(withFilename in_filename: String!, out_path: String!, options: PTHTMLOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToHtml: (NSString *)in_filename out_path: (NSString *)out_path;
Swift
class func toHtml(_ in_filename: String!, out_path: String!)
-
Undocumented
Declaration
Objective-C
+ (void)ToHtmlWithPDFDoc: (PTPDFDoc*)in_pdfdoc out_path: (NSString *)out_path options: (PTHTMLOutputOptions*)options;
Swift
class func toHtml(with in_pdfdoc: PTPDFDoc!, out_path: String!, options: PTHTMLOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToWordWithFilename: (NSString *)in_filename out_path: (NSString *)out_path options: (PTWordOutputOptions*)options;
Swift
class func toWord(withFilename in_filename: String!, out_path: String!, options: PTWordOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToWord: (NSString *)in_filename out_path: (NSString *)out_path;
Swift
class func toWord(_ in_filename: String!, out_path: String!)
-
Undocumented
Declaration
Objective-C
+ (void)ToWordWithPDFDoc: (PTPDFDoc*)in_pdfdoc out_path: (NSString *)out_path options: (PTWordOutputOptions*)options;
Swift
class func toWord(with in_pdfdoc: PTPDFDoc!, out_path: String!, options: PTWordOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToExcelWithFilename: (NSString *)in_filename out_path: (NSString *)out_path options: (PTExcelOutputOptions*)options;
Swift
class func toExcel(withFilename in_filename: String!, out_path: String!, options: PTExcelOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToExcel: (NSString *)in_filename out_path: (NSString *)out_path;
Swift
class func toExcel(_ in_filename: String!, out_path: String!)
-
Undocumented
Declaration
Objective-C
+ (void)ToExcelWithPDFDoc: (PTPDFDoc*)in_pdfdoc out_path: (NSString *)out_path options: (PTExcelOutputOptions*)options;
Swift
class func toExcel(with in_pdfdoc: PTPDFDoc!, out_path: String!, options: PTExcelOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToPowerPointWithFilename: (NSString *)in_filename out_path: (NSString *)out_path options: (PTPowerPointOutputOptions*)options;
Swift
class func toPowerPoint(withFilename in_filename: String!, out_path: String!, options: PTPowerPointOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToPowerPoint: (NSString *)in_filename out_path: (NSString *)out_path;
Swift
class func toPowerPoint(_ in_filename: String!, out_path: String!)
-
Undocumented
Declaration
Objective-C
+ (void)ToPowerPointWithPDFDoc: (PTPDFDoc*)in_pdfdoc out_path: (NSString *)out_path options: (PTPowerPointOutputOptions*)options;
Swift
class func toPowerPoint(with in_pdfdoc: PTPDFDoc!, out_path: String!, options: PTPowerPointOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToEpubWithFilename: (NSString *)in_filename out_path: (NSString *)out_path html_options: (PTHTMLOutputOptions*)html_options epub_options: (PTEPUBOutputOptions*)epub_options;
Swift
class func toEpub(withFilename in_filename: String!, out_path: String!, html_options: PTHTMLOutputOptions!, epub_options: PTEPUBOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToEpub: (NSString *)in_filename out_path: (NSString *)out_path html_options: (PTHTMLOutputOptions*)html_options;
Swift
class func toEpub(_ in_filename: String!, out_path: String!, html_options: PTHTMLOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToEpubWithPDFDoc: (PTPDFDoc*)in_pdfdoc out_path: (NSString *)out_path html_options: (PTHTMLOutputOptions*)html_options epub_options: (PTEPUBOutputOptions*)epub_options;
Swift
class func toEpub(with in_pdfdoc: PTPDFDoc!, out_path: String!, html_options: PTHTMLOutputOptions!, epub_options: PTEPUBOutputOptions!)
-
Undocumented
Declaration
Objective-C
+ (void)ToTiff: (NSString *)in_filename out_path: (NSString *)out_path options: (PTTiffOutputOptions*)options;
Swift
class func toTiff(_ in_filename: String!, out_path: String!, options: PTTiffOutputOptions!)
-
Convert the input file to XOD format and save to the specified path
See
ToPdf()
Declaration
Objective-C
+ (PTFilter *)ToXodWithFilenameToStream:(NSString *)in_filename options:(PTXODOutputOptions *)options;
Swift
class func toXodWithFilename(toStream in_filename: String!, options: PTXODOutputOptions!) -> PTFilter!
Parameters
in_pdfdoc
the PDFDoc to convert to XOD
out_filename
the path to the XOD file to create
-
Generate a stream that incrementally converts the input file to XOD format.
See
XODOutputOptions
See
ToPdf()
Note
Requires the Convert::Printer class for all file formats that ToPdf also requires.
Declaration
Objective-C
+ (PTFilter *)ToXodWithPDFDocToStream:(PTPDFDoc *)in_pdfdoc options:(PTXODOutputOptions *)options;
Swift
class func toXodWithPDFDoc(toStream in_pdfdoc: PTPDFDoc!, options: PTXODOutputOptions!) -> PTFilter!
Parameters
in_filename
the file to convert to XOD
options
the conversion options
Return Value
A filter from which the file can be read incrementally.
-
Generate a stream that incrementally converts the input file to XOD format.
See
ToPdf()
Note
Requires the Convert::Printer class for all file formats that ToPdf also requires.
Declaration
Objective-C
+ (PTConversionMonitor *)ToXodWithMonitorAndOptions:(PTPDFDoc *)in_pdfdoc options: (PTXODOutputOptions *)options;
Swift
class func toXod(withMonitorAndOptions in_pdfdoc: PTPDFDoc!, options: PTXODOutputOptions!) -> PTConversionMonitor!
Parameters
in_filename
the file to convert to XOD
Return Value
A filter from which the file can be read incrementally.
-
Generate a stream that incrementally converts the input file to XOD format.
See
XODOutputOptions
See
ToPdf()
Declaration
Objective-C
+ (PTConversionMonitor *)ToXodWithMonitor:(PTPDFDoc *)in_pdfdoc;
Swift
class func toXod(withMonitor in_pdfdoc: PTPDFDoc!) -> PTConversionMonitor!
Parameters
in_pdfdoc
the PDFDoc to convert to XOD
options
the conversion options
Return Value
A filter from which the file can be read incrementally.
-
Convert the a Word document (in .docx format) to pdf and append to the specified PDF document. This conversion is performed entirely within PDFNet, and does not rely on Word interop or any other external functionality.
Note
Font requirements: on some systems you may need to specify extra font resources to aid in conversion. Please see http://www.pdftron.com/kb_fonts_and_builtin_office_conversion
@throws PDFNetException
See
WordToPDFOptions
See
WordToPdfConversion() if you would like more control over the conversion process
Declaration
Objective-C
+ (void)WordToPDF:(PTPDFDoc *)in_pdfdoc in_filename:(NSString *)in_filename options:(PTWordToPDFOptions *)options;
Swift
class func word(toPDF in_pdfdoc: PTPDFDoc!, in_filename: String!, options: PTWordToPDFOptions!)
Parameters
in_pdfdoc
the conversion result will be appended to this pdf.
in_filename
the path to the source document. The source must be in .docx format.
options
the conversion options
-
Create a DocumentConversion object suitable for converting a Word document (in .docx format) to pdf and appending to the specified PDF document. This conversion will be performed entirely within PDFNet, and does not rely on Word interop or any other external functionality.
This method allows for more control over the conversion process than the single call WordToPDF() interface. This method does not perform any conversion logic and can be expected to return quickly. To do the actual conversion, use the returned DocumentConversion object.
See
DocumentConversion
Note
Font requirements: on some systems you may need to specify extra font resources to aid in conversion. Please see http://www.pdftron.com/kb_fonts_and_builtin_office_conversion
See
WordToPDFOptions
Declaration
Objective-C
+ (PTDocumentConversion *)WordToPDFConversion:(PTPDFDoc *)in_pdfdoc in_filename:(NSString *)in_filename options:(PTWordToPDFOptions *)options;
Swift
class func word(toPDFConversion in_pdfdoc: PTPDFDoc!, in_filename: String!, options: PTWordToPDFOptions!) -> PTDocumentConversion!
Parameters
in_pdfdoc
the conversion result will be appended to this pdf.
in_filename
the path to the source document. The source must be in .docx format.
options
the conversion options
Return Value
A DocumentConversion object which encapsulates this particular conversion.
-
Convert the an office document (in .docx, .xlsx, pptx, or .doc format) to pdf and append to the specified PDF document. This conversion is performed entirely within PDFNet, and does not rely on Word interop or any other external functionality.
Note
Font requirements: on some systems you may need to specify extra font resources to aid in conversion. Please see http://www.pdftron.com/kb_fonts_and_builtin_office_conversion
@throws PDFNetException
See
ConversionOptions
See
StreamingPDFConversion() if you would like more control over the conversion process
Declaration
Objective-C
+ (void)OfficeToPDF:(PTPDFDoc *)in_pdfdoc in_filename:(NSString *)in_filename options:(PTConversionOptions *)options;
Swift
class func office(toPDF in_pdfdoc: PTPDFDoc!, in_filename: String!, options: PTConversionOptions!)
Parameters
in_pdfdoc
the conversion result will be appended to this pdf.
in_filename
the path to the source document.
options
the conversion options
-
Create a DocumentConversion object suitable for converting a file to pdf and appending to the specified PDF document. Handles incoming files in .docx, .xlsx, .pptx, .doc, .ppt, .xls, .png, .jpg, .bmp, .gif, .jp2, .tif, .txt, .xml and .md format This conversion will be performed entirely within PDFNet, and does not rely on any external functionality.
This method allows for more control over the conversion process than the single call ToPDF() interface. It does not perform any conversion logic immediately, and can be expected to return quickly. To perform the actual conversion, use the returned DocumentConversion object.
See
DocumentConversion
Note
Font requirements: on some systems you may need to specify extra font resources to aid in conversion. Please see http://www.pdftron.com/kb_fonts_and_builtin_office_conversion
See
ConversionOptions
Declaration
Objective-C
+ (PTDocumentConversion *)StreamingPDFConversionWithDoc:(PTPDFDoc *)in_pdfdoc in_filename:(NSString *)in_filename options:(PTConversionOptions *) options;
Swift
class func streamingPDFConversion(with in_pdfdoc: PTPDFDoc!, in_filename: String!, options: PTConversionOptions!) -> PTDocumentConversion!
Parameters
in_pdfdoc
the conversion result will be appended to this pdf.
in_filename
the path to the source document.
options
the conversion options
Return Value
A DocumentConversion object which encapsulates this particular conversion.
-
Create a DocumentConversion object suitable for converting a file to pdf. Handles incoming files in .docx, .xlsx, .pptx, .doc, .ppt, .xls, .png, .jpg, .bmp, .gif, .jp2, .tif, .txt, .xml and .md format This conversion will be performed entirely within PDFNet, and does not rely on any external functionality.
This method allows for more control over the conversion process than the single call ToPDF() interface. It does not perform any conversion logic immediately, and can be expected to return quickly. To perform the actual conversion, use the returned DocumentConversion object.
See
DocumentConversion
Note
Font requirements: on some systems you may need to specify extra font resources to aid in conversion. Please see http://www.pdftron.com/kb_fonts_and_builtin_office_conversion
See
ConversionOptions
Declaration
Objective-C
+ (PTDocumentConversion *)StreamingPDFConversion:(NSString *)in_filename options:(PTConversionOptions *)options;
Swift
class func streamingPDFConversion(_ in_filename: String!, options: PTConversionOptions!) -> PTDocumentConversion!
Parameters
in_filename
the path to the source document.
options
the conversion options
Return Value
A DocumentConversion object which encapsulates this particular conversion.
-
Convert the an office document (in .docx, .xlsx, pptx, or .doc format) to pdf and append to the specified PDF document. This conversion is performed entirely within PDFNet, and does not rely on Word interop or any other external functionality.
Note
Font requirements: on some systems you may need to specify extra font resources to aid in conversion. Please see http://www.pdftron.com/kb_fonts_and_builtin_office_conversion
@throws PDFNetException
See
ConversionOptions
See
StreamingPDFConversion() if you would like more control over the conversion process
Declaration
Objective-C
+ (void)OfficeToPDFFromFilter:(PTPDFDoc *)in_pdfdoc in_stream:(PTFilter *)in_stream options:(PTConversionOptions *)options;
Swift
class func officeToPDF(fromFilter in_pdfdoc: PTPDFDoc!, in_stream: PTFilter!, options: PTConversionOptions!)
Parameters
in_pdfdoc
the conversion result will be appended to this pdf.
in_stream
the source document data.
options
the conversion options
-
Create a DocumentConversion object suitable for converting an office document (in .docx, .xlsx, pptx, or .doc format) to pdf and appending to the specified PDF document. This conversion will be performed entirely within PDFNet, and does not rely on Word interop or any other external functionality.
This method does not perform any conversion logic and can be expected to return quickly. To do the actual conversion, use the returned DocumentConversion object.
See
DocumentConversion
Note
Font requirements: on some systems you may need to specify extra font resources to aid in conversion. Please see http://www.pdftron.com/kb_fonts_and_builtin_office_conversion
See
ConversionOptions
Declaration
Objective-C
+ (PTDocumentConversion *) StreamingPDFConversionWithDocFromFilter:(PTPDFDoc *)in_pdfdoc in_stream:(PTFilter *)in_stream options:(PTConversionOptions *)options;
Swift
class func streamingPDFConversionWithDoc(fromFilter in_pdfdoc: PTPDFDoc!, in_stream: PTFilter!, options: PTConversionOptions!) -> PTDocumentConversion!
Parameters
in_pdfdoc
the conversion result will be appended to this pdf.
in_stream
the source document data.
options
the conversion options
Return Value
A DocumentConversion object which encapsulates this particular conversion.
-
Create a DocumentConversion object suitable for converting an office document (in .docx, .xlsx, pptx, or .doc format) to pdf and appending to the specified PDF document. This conversion will be performed entirely within PDFNet, and does not rely on Word interop or any other external functionality.
This method does not perform any conversion logic and can be expected to return quickly. To do the actual conversion, use the returned DocumentConversion object.
See
DocumentConversion
Note
Font requirements: on some systems you may need to specify extra font resources to aid in conversion. Please see http://www.pdftron.com/kb_fonts_and_builtin_office_conversion
See
ConversionOptions
Declaration
Objective-C
+ (PTDocumentConversion *) StreamingPDFConversionFromFilter:(PTFilter *)in_stream options:(PTConversionOptions *)options;
Swift
class func streamingPDFConversion(from in_stream: PTFilter!, options: PTConversionOptions!) -> PTDocumentConversion!
Parameters
in_stream
the source document data.
options
the conversion options
Return Value
A DocumentConversion object which encapsulates this particular conversion.
-
Convert the file or document to PDF and append to the specified PDF document
Note
Internally formats include BMP, EMF, JPEG, PNG, TIF, XPS.
Note
Formats that require external applications for conversion use the Convert::Printer class and the PDFNet printer to be installed. This is only supported on Windows platforms. Document formats in this category include RTF(MS Word or Wordpad), TXT (Notepad or Wordpad), DOC and DOCX (MS Word), PPT and PPTX (MS PowerPoint), XLS and XLSX (MS Excel), OpenOffice documents, HTML and MHT (Internet Explorer), PUB (MS Publisher), MSG (MS Outlook).
Declaration
Objective-C
+ (void)ToPdf:(PTPDFDoc *)in_pdfdoc in_filename:(NSString *)in_filename;
Swift
class func toPdf(_ in_pdfdoc: PTPDFDoc!, in_filename: String!)
Parameters
in_pdfdoc
the PDFDoc to append the converted document to. The PDFDoc can then be converted to XPS, EMF or SVG using the other functions in this class.
in_filename
the path to the document to be converted to pdf
-
Convert the specified CAD file to PDF and append converted pages to the specified PDF document. This conversion requires that the optional PDFTron CAD add-on module is available. See the
CADConvertOptions
class for the available options. See also: the ‘CADModule’ classDeclaration
Objective-C
+ (void)FromCAD:(PTPDFDoc *)in_pdfdoc in_filename:(NSString *)in_filename opts:(PTCADConvertOptions *)opts;
Swift
class func fromCAD(_ in_pdfdoc: PTPDFDoc!, in_filename: String!, opts: PTCADConvertOptions!)
Parameters
in_pdfdoc
the PDFDoc to append to
in_filename
the path to the CAD document to convert
opts
The options to use when converting.
-
Convert the specified AdvancedImaging file to PDF and append converted pages to the specified PDF document. This conversion requires that the optional PDFTron AdvancedImaging add-on module is available. See also: the ‘AdvancedImagingModule’ class
Declaration
Objective-C
+ (void)FromDICOM:(PTPDFDoc *)in_pdfdoc in_filename:(NSString *)in_filename opts:(PTAdvancedImagingConvertOptions *)opts;
Swift
class func fromDICOM(_ in_pdfdoc: PTPDFDoc!, in_filename: String!, opts: PTAdvancedImagingConvertOptions!)
Parameters
in_pdfdoc
the PDFDoc to append to
in_filename
the path to the CAD document to convert
opts
The options to use when converting.
-
Convert the specified SVG file to PDF and append converted pages to the specified PDF document.
Declaration
Objective-C
+ (void)FromSVG:(PTPDFDoc *)in_pdfdoc in_filename:(NSString *)in_filename opts:(PTSVGConvertOptions *)opts;
Swift
class func fromSVG(_ in_pdfdoc: PTPDFDoc!, in_filename: String!, opts: PTSVGConvertOptions!)
Parameters
in_pdfdoc
the PDFDoc to append to
in_filename
the path to the CAD document to convert
opts
The options to use when converting.
-
Convert the specified TIFF filter to PDF and append converted pages to the specified PDF document.
Declaration
Parameters
in_pdfdoc
the PDFDoc to append to
in_data
the source TIFF data.
-
Create a TemplateDocument object from an office file suitable for generating any number of PDFs from supplied template data.
Template filling will be performed entirely within PDFNet, and handles incoming files in .docx, .xlsx, .pptx, .doc, .ppt, and .xls format
This method does not perform any template filling and can be expected to return quickly. To do the actual work, use the returned TemplateDocument object
See
TemplateDocument
Note
Font requirements: on some systems you may need to specify extra font resources to aid in conversion. Please see http://www.pdftron.com/kb_fonts_and_builtin_office_conversion
See
ConversionOptions
Declaration
Objective-C
+ (PTTemplateDocument *)CreateOfficeTemplate:(NSString *)in_filename options:(PTConversionOptions *)options;
Swift
class func createOfficeTemplate(_ in_filename: String!, options: PTConversionOptions!) -> PTTemplateDocument!
Parameters
in_filename
the path to the source document.
options
the office to pdf conversion options
Return Value
A TemplateDocument object which encapsulates this particular office template.
-
Utility function to determine if ToPdf or ToXps will require the PDFNet printer to convert a specific external file to PDF.
Note
Current implementation looks only at the file extension not file contents. If the file extension is missing, false will be returned
Declaration
Objective-C
+ (BOOL)RequiresPrinter:(NSString *)in_filename;
Swift
class func requiresPrinter(_ in_filename: String!) -> Bool
Parameters
in_filename
the path to the document to be checked
Return Value
true if ToPdf requires the printer to convert the file, false otherwise.
-
Converts an HTML string to PDF using a WKWebView. This method must be called from the main thread.
Declaration
Objective-C
+ (void)convertHTMLStringToPDF:(NSString *)htmlString baseURL:(NSURL *)baseURL paperSize:(CGSize)paperSize completion:(void (^)(NSString *))completion;
Swift
class func convertHTMLString(toPDF htmlString: String!, baseURL: URL!, paperSize: CGSize) async -> String?
Parameters
htmlString
The string containing valid HTML.
baseURL
The base URL for the content.
paperSize
The size of the paper in units of PDF Points. Passing CGSizeZero will default to letter size, portrait orientation (612.0, 792.0)
completion
A block that is executed when the conversion is complete. The paramater pathToPDF will point to the newly converted PDF. The PDF will be deleted after the execution of the completion block, so it should be copied if required beyond the completion block.
-
Converts office format documents and any document supported by WKWebView to PDF. This method must be called from the main thread.
Declaration
Objective-C
+ (void)convertOfficeToPDF:(NSString *)filePath paperSize:(CGSize)paperSize completion:(void (^)(NSString *))completion;
Swift
class func convertOffice(toPDF filePath: String!, paperSize: CGSize) async -> String?
Parameters
filePath
The path of the source document
paperSize
The size of the paper in units of PDF Points. Passing CGSizeZero will default to letter size, portrait orientation (612.0, 792.0)
completion
A block that is executed when the conversion is complete. The paramater pathToPDF will point to the newly converted PDF. The PDF will be deleted after the execution of the completion block, so it should be copied if required beyond the completion block.
-
Converts office format documents and any document supported by WKWebView to PDF. This method must be called from the main thread.
Declaration
Objective-C
+ (void)convertOfficeToPDFWithURL:(NSURL *)url paperSize:(CGSize)paperSize completion:(void (^)(NSString *))completion;
Swift
class func convertOfficeToPDF(with url: URL!, paperSize: CGSize) async -> String?
Parameters
url
The URL of the source document
paperSize
The size of the paper in units of PDF Points. Passing CGSizeZero will default to letter size, portrait orientation (612.0, 792.0)
completion
A block that is executed when the conversion is complete. The paramater pathToPDF will point to the newly converted PDF. The PDF will be deleted after the execution of the completion block, so it should be copied if required beyond the completion block.