new Convert()
Converter is a utility class used to convert documents and files to PDF.
Conversion of XPS, EMF and image files to PDF documents is performed internally.
Other document formats are converted via native application and printing.
Classes
Members
-
<static> AnnotationOutputFlag
-
Properties:
Name Type Description e_internal_xfdfnumber include the annotation file in the XOD output. This is the default option e_external_xfdfnumber output the annotation file externally to the same output path with extension .xfdf. This is not available when using streaming conversion e_flattennumber flatten all annotations that are not link annotations -
<static> FlattenFlag
-
Properties:
Name Type Description e_offnumber Disable flattening and convert all content as is. e_simplenumber Feature reduce PDF to a simple two layer representation consisting of a single background RGB image and a simple top text layer. e_fastnumber Feature reduce PDF while trying to preserve some complex PDF features (such as vector figures, transparency, shadings, blend modes, Type3 fonts etc.) for pages that are already fast to render. This option can also result in smaller & faster files compared to e_simple, but the pages may have more complex structure. e_high_qualitynumber Preserve vector content where possible. In particular only feature reduce PDF files containing overprint or very complex vector content. Currently this option can only be used with XODOutputOptions. -
<static> FlattenThresholdFlag
-
Properties:
Name Type Description e_very_strictnumber Render (flatten) any text that is clipped or occluded. e_strictnumber Render text that are marginally clipped or occluded. e_defaultnumber Render text that are somewhat clipped or occluded. e_keep_mostnumber Only render text that are seriously clipped or occluded. e_keep_allnumber Only render text that are completely occluded, or used as a clipping path. -
<static> OverprintPreviewMode
-
Properties:
Name Type Description e_op_offnumber e_op_onnumber e_op_pdfx_onnumber -
<static> PrinterMode
-
Properties:
Name Type Description e_autonumber e_interop_onlynumber e_printer_onlynumber e_prefer_builtin_converternumber
Methods
-
<static> createOfficeToPDFOptions()
-
Method to create an OfficeToPDFOptions object
Returns:
A promise that resolves to a PDFNet.Convert.OfficeToPDFOptions.- Type
- Promise.<PDFNet.Convert.OfficeToPDFOptions>
-
<static> createTiffOutputOptions()
-
Method to create an TiffOutputOptions object
Returns:
A promise that resolves to a PDFNet.Convert.TiffOutputOptions.- Type
- Promise.<PDFNet.Convert.TiffOutputOptions>
-
<static> createXODOutputOptions()
-
Method to create an XODOutputOptions object
Returns:
A promise that resolves to a PDFNet.Convert.XODOutputOptions.- Type
- Promise.<PDFNet.Convert.XODOutputOptions>
-
<static> createXPSOutputOptions()
-
Method to create an XPSOutputOptions object
Returns:
A promise that resolves to a PDFNet.Convert.XPSOutputOptions.- Type
- Promise.<PDFNet.Convert.XPSOutputOptions>
-
<static> fileToTiffWithBuffer(fileData, fileType [, options])
-
Convert a file in a buffer to multipage TIFF
Parameters:
Name Type Argument Description fileDataArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray buffer containing the file to convert to multipage TIFF fileTypestring the filename extension of the file. optionsPDFNet.Obj | PDFNet.Convert.TiffOutputOptions <optional>
the conversion options Returns:
A promise that resolves to the TIFF file in an buffer- Type
- Promise.<Uint8Array>
-
<static> fromTiff(in_pdfdoc, in_data)
-
Parameters:
Name Type Description in_pdfdocPDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc in_dataPDFNet.Filter Returns:
- Type
- Promise.<void>
-
<static> fromXpsMem(in_pdfdoc, buf)
-
Convert the specified XPS document contained in memory to PDF and append converted pages to the specified PDF document.
Parameters:
Name Type Description in_pdfdocPDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc the PDFDoc to append to bufArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray the buffer containing the xps document Returns:
- Type
- Promise.<void>
-
<static> office2PDF(input, options)
-
Convert the an office document (in .docx, .xlsx, pptx, or .doc format) to pdf.
Parameters:
Name Type Description inputstring | ArrayBuffer Either a url from which to download the file or an ArrayBuffer containing the file data. optionsObject An object containing conversion options Returns:
A promise that resolves to a "PDFDoc".- Type
- Promise.<PDFNet.PDFDoc>
-
<static> officeToPdfWithFilter(in_pdfdoc, in_stream [, options])
-
Parameters:
Name Type Argument Description in_pdfdocPDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc in_streamPDFNet.Filter optionsPDFNet.Obj | PDFNet.Convert.ConversionOptions <optional>
Returns:
- Type
- Promise.<void>
-
<static> pageToHtml(page)
-
Parameters:
Name Type Description pagePDFNet.Page Returns:
A promise that resolves to an object of type: "string"- Type
- Promise.<string>
-
<static> streamingPdfConversionWithFilter(in_stream [, 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.
Parameters:
Name Type Argument Description in_streamPDFNet.Filter the source document data. optionsPDFNet.Obj | PDFNet.Convert.ConversionOptions <optional>
the conversion options - See:
-
- DocumentConversion
- ConversionOptions
Returns:
A promise that resolves to a DocumentConversion object which encapsulates this particular conversion.- Type
- Promise.<PDFNet.DocumentConversion>
-
<static> streamingPdfConversionWithPath(in_filename [, options])
-
Create a DocumentConversion object suitable for converting a file to pdf. Handles incoming files in .docx, .xlsx, pptx, .doc, .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.
Parameters:
Name Type Argument Description in_filenamestring the path to the source document. optionsPDFNet.Obj | PDFNet.Convert.ConversionOptions <optional>
the conversion options - See:
-
- DocumentConversion
- ConversionOptions
Returns:
A promise that resolves to a DocumentConversion object which encapsulates this particular conversion.- Type
- Promise.<PDFNet.DocumentConversion>
-
<static> streamingPdfConversionWithPdfAndFilter(in_pdfdoc, in_stream [, 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.
Parameters:
Name Type Argument Description in_pdfdocPDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc the conversion result will be appended to this pdf. in_streamPDFNet.Filter the source document data. optionsPDFNet.Obj | PDFNet.Convert.ConversionOptions <optional>
the conversion options - See:
-
- DocumentConversion
- ConversionOptions
Returns:
A promise that resolves to a DocumentConversion object which encapsulates this particular conversion.- Type
- Promise.<PDFNet.DocumentConversion>
-
<static> streamingPdfConversionWithPdfAndPath(in_pdfdoc, in_filename [, 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, .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.
Parameters:
Name Type Argument Description in_pdfdocPDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc the conversion result will be appended to this pdf. in_filenamestring the path to the source document. optionsPDFNet.Obj | PDFNet.Convert.ConversionOptions <optional>
the conversion options - See:
-
- DocumentConversion
- ConversionOptions
Returns:
A promise that resolves to a DocumentConversion object which encapsulates this particular conversion.- Type
- Promise.<PDFNet.DocumentConversion>
-
<static> toTiffBuffer(in_pdfdoc [, options])
-
Convert the PDF to multipage TIFF
Parameters:
Name Type Argument Description in_pdfdocPDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc the PDF doc to convert to multipage optionsPDFNet.Obj | PDFNet.Convert.TiffOutputOptions <optional>
the conversion options Returns:
A promise that resolves to the TIFF file in an buffer- Type
- Promise.<Uint8Array>