Class: Convert

PDFNet. Convert


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

TiffOutputOptions

Members


<static> PrinterMode :number

Type:
  • number

Methods


<static> createTiffOutputOptions()

Method to create an TiffOutputOptions object
Returns:
A promise that resolves to a PDFNet.Convert.TiffOutputOptions.
Type
Promise.<PDFNet.Convert.TiffOutputOptions>

<static> fromCAD(in_pdfdoc, in_filename, options)

Parameters:
Name Type Description
in_pdfdoc PDFNet.PDFDoc
in_filename string
options PDFNet.Obj

<static> fromTiff(in_pdfdoc, in_data)

Parameters:
Name Type Description
in_pdfdoc PDFNet.PDFDoc
in_data PDFNet.Filter

<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_pdfdoc PDFNet.PDFDoc the PDFDoc to append to
buf Array the buffer containing the xps document

<static> office2PDF(input, options)

Convert the an office document (in .docx, .xlsx, pptx, or .doc format) to pdf.
Parameters:
Name Type Description
input string | ArrayBuffer Either a url from which to download the file or an ArrayBuffer containing the file data.
options Object An object containing conversion options
Returns:
A promise that resolves to a "PDFDoc".
Type
Promise.<PDFNet.PDFDoc>

<static> officeToPdfWithFilter(in_pdfdoc, in_stream, options)

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.
Parameters:
Name Type Description
in_pdfdoc PDFNet.PDFDoc the conversion result will be appended to this pdf.
in_stream PDFNet.Filter the source document data.
options PDFNet.Obj the conversion options
See:
  • ConversionOptions
  • StreamingPDFConversion() if you would like more control over the conversion process
Throws:
PDFNetException

<static> officeToPdfWithPath(in_pdfdoc, in_filename, options)

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.
Parameters:
Name Type Description
in_pdfdoc PDFNet.PDFDoc the conversion result will be appended to this pdf.
in_filename string the path to the source document.
options PDFNet.Obj the conversion options
See:
  • ConversionOptions
  • StreamingPDFConversion() if you would like more control over the conversion process
Throws:
PDFNetException

<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 Description
in_stream PDFNet.Filter the source document data.
options PDFNet.Obj 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 Description
in_filename string the path to the source document.
options PDFNet.Obj 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 Description
in_pdfdoc PDFNet.PDFDoc the conversion result will be appended to this pdf.
in_stream PDFNet.Filter the source document data.
options PDFNet.Obj 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 Description
in_pdfdoc PDFNet.PDFDoc the conversion result will be appended to this pdf.
in_filename string the path to the source document.
options PDFNet.Obj the conversion options
See:
  • DocumentConversion
  • ConversionOptions
Returns:
A promise that resolves to a DocumentConversion object which encapsulates this particular conversion.
Type
Promise.<PDFNet.DocumentConversion>