#include <Convert.h>
Public Types | |
enum | FlattenThresholdFlag { e_very_strict, e_strict, e_default, e_keep_most, e_keep_all } |
enum | FlattenFlag { e_off, e_simple, e_fast, e_high_quality } |
typedef pdftron::PDF::XPSOutputOptions | XPSOutputOptions |
typedef pdftron::PDF::XODOutputOptions | XODOutputOptions |
typedef pdftron::PDF::HTMLOutputOptions | HTMLOutputOptions |
typedef pdftron::PDF::WordOutputOptions | WordOutputOptions |
typedef pdftron::PDF::ExcelOutputOptions | ExcelOutputOptions |
typedef pdftron::PDF::PowerPointOutputOptions | PowerPointOutputOptions |
typedef pdftron::PDF::EPUBOutputOptions | EPUBOutputOptions |
typedef pdftron::PDF::SVGOutputOptions | SVGOutputOptions |
typedef pdftron::PDF::TiffOutputOptions | TiffOutputOptions |
typedef pdftron::PDF::Printer | Printer |
Static Public Member Functions | |
static void | FromXps (PDFDoc &in_pdfdoc, const UString &in_filename) |
static void | FromXps (PDFDoc &in_pdfdoc, const char *buf, size_t buf_sz) |
static void | FromEmf (PDFDoc &in_pdfdoc, const UString &in_filename) |
static void | FromText (PDFDoc &in_pdfdoc, const UString &in_filename, const SDF::Obj &in_options=SDF::Obj()) |
static void | ToEmf (PDFDoc &in_pdfdoc, const UString &in_filename) |
static void | ToEmf (Page &in_page, const UString &in_filename) |
static void | ToSvg (PDFDoc &in_pdfdoc, const UString &in_filename, const SVGOutputOptions &in_options) |
static void | ToSvg (PDFDoc &in_pdfdoc, const UString &in_filename) |
static void | ToSvg (Page &in_page, const UString &in_filename, const SVGOutputOptions &in_options) |
static void | ToSvg (Page &in_page, const UString &in_filename) |
static void | ToXps (PDFDoc &in_pdfdoc, const UString &in_filename, const XPSOutputOptions &options) |
static void | ToXps (PDFDoc &in_pdfdoc, const UString &in_filename) |
static void | ToXps (const UString &in_inputFilename, const UString &in_outputFilename, const XPSOutputOptions &options) |
static void | ToXps (const UString &in_inputFilename, const UString &in_outputFilename) |
static void | ToXod (const UString &in_filename, const UString &out_filename, const XODOutputOptions &options) |
static void | ToXod (const UString &in_filename, const UString &out_filename) |
static void | ToXod (PDFDoc &in_pdfdoc, const UString &out_filename, const XODOutputOptions &options) |
static void | ToXod (PDFDoc &in_pdfdoc, const UString &out_filename) |
static void | ToHtml (const UString &in_filename, const UString &out_path, const HTMLOutputOptions &options) |
static void | ToHtml (const UString &in_filename, const UString &out_path) |
static UString | PageToHtml (const Page &page) |
static UString | PageToHtmlZoned (const Page &page, const UString &json_zones) |
static void | ToHtml (PDFDoc &in_pdfdoc, const UString &out_path, const HTMLOutputOptions &options) |
static void | ToHtml (PDFDoc &in_pdfdoc, const UString &out_path) |
static void | ToWord (const UString &in_filename, const UString &out_path, const WordOutputOptions &options) |
static void | ToWord (const UString &in_filename, const UString &out_path) |
static void | ToWord (PDFDoc &in_pdfdoc, const UString &out_path, const WordOutputOptions &options) |
static void | ToWord (PDFDoc &in_pdfdoc, const UString &out_path) |
static void | ToExcel (const UString &in_filename, const UString &out_path, const ExcelOutputOptions &options) |
static void | ToExcel (const UString &in_filename, const UString &out_path) |
static void | ToExcel (PDFDoc &in_pdfdoc, const UString &out_path, const ExcelOutputOptions &options) |
static void | ToExcel (PDFDoc &in_pdfdoc, const UString &out_path) |
static void | ToPowerPoint (const UString &in_filename, const UString &out_path, const PowerPointOutputOptions &options) |
static void | ToPowerPoint (const UString &in_filename, const UString &out_path) |
static void | ToPowerPoint (PDFDoc &in_pdfdoc, const UString &out_path, const PowerPointOutputOptions &options) |
static void | ToPowerPoint (PDFDoc &in_pdfdoc, const UString &out_path) |
static void | ToEpub (const UString &in_filename, const UString &out_path, const HTMLOutputOptions &html_options, const EPUBOutputOptions &epub_options) |
static void | ToEpub (const UString &in_filename, const UString &out_path, const HTMLOutputOptions &html_options) |
static void | ToEpub (const UString &in_filename, const UString &out_path) |
static void | ToEpub (PDFDoc &in_pdfdoc, const UString &out_path, const HTMLOutputOptions &html_options, const EPUBOutputOptions &epub_options) |
static void | ToEpub (PDFDoc &in_pdfdoc, const UString &out_path, const HTMLOutputOptions &html_options) |
static void | ToEpub (PDFDoc &in_pdfdoc, const UString &out_path) |
static void | ToTiff (const UString &in_filename, const UString &out_path, const TiffOutputOptions &options) |
static void | ToTiff (const UString &in_filename, const UString &out_path) |
static void | ToTiff (PDFDoc &in_pdfdoc, const UString &out_path, const TiffOutputOptions &options) |
static void | ToTiff (PDFDoc &in_pdfdoc, const UString &out_path) |
static void | ToTiff (const UString &in_filename, Filters::Filter &out_filter, const TiffOutputOptions &options) |
static void | ToTiff (const UString &in_filename, Filters::Filter &out_filter) |
static void | ToTiff (PDFDoc &in_pdfdoc, Filters::Filter &out_filter, const TiffOutputOptions &options) |
static void | ToTiff (PDFDoc &in_pdfdoc, Filters::Filter &out_filter) |
static Filters::Filter | ToXod (const UString &in_filename, const XODOutputOptions &options) |
static Filters::Filter | ToXod (const UString &in_filename) |
static Filters::Filter | ToXod (PDFDoc &in_pdfdoc, const XODOutputOptions &options) |
static Filters::Filter | ToXod (PDFDoc &in_pdfdoc) |
static ConversionMonitor | ToXodWithMonitor (PDFDoc &in_pdfdoc, const XODOutputOptions &options) |
static ConversionMonitor | ToXodWithMonitor (PDFDoc &in_pdfdoc) |
static void | WordToPDF (PDFDoc &in_pdfdoc, const UString &in_filename, WordToPDFOptions *options) |
static DocumentConversion | WordToPDFConversion (PDFDoc &in_pdfdoc, const UString &in_filename, WordToPDFOptions *options) |
static void | WordToPDF (PDFDoc &in_pdfdoc, Filters::Filter in_stream, WordToPDFOptions *options) |
static DocumentConversion | WordToPDFConversion (PDFDoc &in_pdfdoc, Filters::Filter in_stream, WordToPDFOptions *options) |
static void | OfficeToPDF (PDFDoc &in_pdfdoc, const UString &in_filename, ConversionOptions *options) |
static DocumentConversion | StreamingPDFConversion (PDFDoc &in_pdfdoc, const UString &in_filename, ConversionOptions *options) |
static DocumentConversion | StreamingPDFConversion (const UString &in_filename, ConversionOptions *options) |
static Reflow | CreateReflow (Page &in_page, const UString &json_zones) |
static void | OfficeToPDF (PDFDoc &in_pdfdoc, Filters::Filter in_stream, ConversionOptions *options) |
static DocumentConversion | StreamingPDFConversion (PDFDoc &in_pdfdoc, Filters::Filter in_stream, ConversionOptions *options) |
static DocumentConversion | StreamingPDFConversion (Filters::Filter in_stream, ConversionOptions *options) |
static void | ToPdf (PDFDoc &in_pdfdoc, const UString &in_filename) |
static void | FromCAD (PDFDoc &in_pdfdoc, const UString &in_filename, CADConvertOptions *opts=0) |
static void | FromDICOM (PDFDoc &in_pdfdoc, const UString &in_filename, AdvancedImagingConvertOptions *opts=0) |
static void | FromSVG (PDFDoc &in_pdfdoc, const UString &in_filename, SVGConvertOptions *opts=0) |
static void | FromTiff (PDFDoc &in_pdfdoc, Filters::Filter in_data) |
static TemplateDocument | CreateOfficeTemplate (const UString &in_filename, ConversionOptions *options) |
static TemplateDocument | CreateOfficeTemplate (Filters::Filter in_stream, ConversionOptions *options) |
static bool | RequiresPrinter (const UString &in_filename) |
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.
The PDFTron PDFNet printer needs to be installed to convert document formats. On Windows installation of printer drivers requires administrator UAC, manifests have been added to the Convert samples (C++, C# and Visual Basic).
To install the printer the process must be running as administrator. Execute:
Installation can take a few seconds, so it is recommended that you install the printer once as part of your deployment process. Duplicated installations will be quick since the presence of the printer is checked before installation is attempted. The printer is a virtual XPS printer supported on Vista and Windows 7, and on Windows XP with the XPS Essentials Pack.
There is no need to uninstall the printer after conversions, it can be left installed for later access. To uninstall the printer the process must be running as administrator. Execute:
Enumerator | |
---|---|
e_off |
Disable flattening and convert all content as is. |
e_simple |
Feature reduce PDF to a simple two layer representation consisting of a single background RGB image and a simple top text layer. |
e_fast |
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_quality |
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 |
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
in_filename | the path to the source document. |
options | the office to pdf conversion options |
|
static |
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
in_stream | the source document data. |
options | the office to pdf conversion options |
|
static |
|
static |
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' class
in_pdfdoc | the PDFDoc to append to |
in_filename | the path to the CAD document to convert |
opts | The options to use when converting. |
|
static |
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
in_pdfdoc | the PDFDoc to append to |
in_filename | the path to the CAD document to convert |
opts | The options to use when converting. |
|
static |
|
static |
Convert the specified plain text file to PDF and append converted pages to the specified PDF document.
in_pdfdoc | the PDFDoc to append to |
in_filename | the path to the plain text document to convert |
in_options | the conversion options. The available options are: |
Option Name | Type | Note |
---|---|---|
BytesPerBite | Integer | In bytes. Use for streaming conversion only. |
FontFace | String | Set the font face used for the conversion. |
FontSize | Integer | Set the font size used for the conversion. |
LineHeightMultiplier | Double | Set the line height multiplier used for the conversion. |
MarginBottom | Double | In inches. Set the bottom margin of the page. |
MarginLeft | Double | In inches. Set the left margin of the page. |
MarginRight | Double | In inches. Set the right margin of the page. |
MarginTop | Double | In inches. Set the top margin of the page. |
PageHeight | Double | In inches. Set the page height. |
PageWidth | Double | In inches. Set the page width. |
UseSourceCodeFormatting | Boolean | Set whether to use mono font for the conversion. |
|
static |
|
static |
|
static |
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.
in_pdfdoc | the conversion result will be appended to this pdf. |
in_filename | the path to the source document. |
options | the conversion options |
PDFNetException |
|
static |
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.
in_pdfdoc | the conversion result will be appended to this pdf. |
in_stream | the source document data. |
options | the conversion options |
PDFNetException |
Convert a page to HTML and return a string of the html
page | the page to convert to HTML |
|
static |
|
static |
Utility function to determine if ToPdf or ToXps will require the PDFNet printer to convert a specific external file to PDF.
in_filename | the path to the document to be checked |
|
static |
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.
in_pdfdoc | the conversion result will be appended to this pdf. |
in_filename | the path to the source document. |
options | the conversion options |
|
static |
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.
in_filename | the path to the source document. |
options | the conversion options |
|
static |
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.
in_pdfdoc | the conversion result will be appended to this pdf. |
in_stream | the source document data. |
options | the conversion options |
|
static |
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.
in_stream | the source document data. |
options | the conversion options |
|
static |
Convert a file to EPUB format and save to the specified path
in_filename | the file to convert to EPUB |
out_path | the path to the EPUB file to create |
html_options | the conversion options |
epub_options | the conversion options |
|
static |
Convert a file to EPUB format and save to the specified path
in_filename | the file to convert to EPUB |
out_path | the path to the EPUB file to create |
html_options | the conversion options |
|
static |
Convert a file to EPUB format and save to the specified path
in_filename | the file to convert to EPUB |
out_path | the path to the EPUB file to create |
|
static |
|
static |
Convert the PDFDoc to EPUB format and save to the specified path
in_pdfdoc | the PDFDoc to convert to EPUB |
out_path | the path to the EPUB file to create |
html_options | the conversion options |
|
static |
Convert a PDF file to Excel and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_filename | the file to convert to Excel |
out_path | the path to where generated content will be stored |
options | the conversion options |
|
static |
Convert a PDF file to Excel and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_filename | the file to convert to Excel |
out_path | the path to where generated content will be stored |
|
static |
Convert PDF to Excel and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_pdfdoc | the PDF doc to convert to Excel |
out_path | the path to where generated content will be stored |
options | the conversion options |
Convert PDF to Excel and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_pdfdoc | the PDF doc to convert to Excel |
out_path | the path to where generated content will be stored |
|
static |
Convert a file to HTML and save to the specified path. In e_reflow_paragraphs mode, this conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_filename | the file to convert to HTML |
out_path | the path to where generated content will be stored |
options | the conversion options |
|
static |
Convert a file to HTML and save to the specified path
in_filename | the file to convert to HTML |
out_path | the path to where generated content will be stored |
|
static |
Convert the PDF to HTML and save to the specified path. In e_reflow_paragraphs mode, this conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_pdfdoc | the PDF doc to convert to HTML |
out_path | the path to where generated content will be stored |
options | the conversion options |
Convert the file or document to PDF and append to the specified PDF document
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 |
|
static |
Convert a PDF file to PowerPoint and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_filename | the file to convert to PowerPoint |
out_path | the path to where generated content will be stored |
options | the conversion options |
|
static |
Convert a PDF file to PowerPoint and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_filename | the file to convert to PowerPoint |
out_path | the path to where generated content will be stored |
|
static |
Convert PDF to PowerPoint and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_pdfdoc | the PDF doc to convert to PowerPoint |
out_path | the path to where generated content will be stored |
options | the conversion options |
|
static |
Convert PDF to PowerPoint and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_pdfdoc | the PDF doc to convert to PowerPoint |
out_path | the path to where generated content will be stored |
|
static |
|
static |
|
static |
Convert a file to multipage TIFF and save to the specified path
in_filename | the file to convert to multipage TIFF |
out_path | the path to the TIFF file to create |
options | the conversion options |
|
static |
Convert a file to multipage TIFF and save to the specified path
in_filename | the file to convert to multipage TIFF |
out_path | the path to the TIFF file to create |
|
static |
Convert the PDF to multipage TIFF and save to the specified path
in_pdfdoc | the PDF doc to convert to multipage TIFF |
out_path | the path to the TIFF file to create |
options | the conversion options |
|
static |
Convert a file to multipage TIFF and write to the provided filter
in_filename | the file to convert to multipage TIFF |
out_filter | the output filter where the TIFF data will be written |
options | the conversion options |
|
static |
Convert a file to multipage TIFF and write to the provided filter
in_filename | the file to convert to multipage TIFF |
out_filter | the output filter where the TIFF data will be written |
|
static |
Convert the PDF to multipage TIFF and write to the provided filter
in_pdfdoc | the PDF doc to convert to multipage TIFF |
out_filter | the output filter where the TIFF data will be written |
options | the conversion options |
|
static |
|
static |
Convert a PDF file to Word and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_filename | the file to convert to Word |
out_path | the path to where generated content will be stored |
options | the conversion options |
|
static |
Convert a PDF file to Word and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_filename | the file to convert to Word |
out_path | the path to where generated content will be stored |
|
static |
Convert PDF to Word and save the output to the specified path. This conversion requires that the optional PDFTron StructuredOutput add-on module is available.
in_pdfdoc | the PDF doc to convert to Word |
out_path | the path to where generated content will be stored |
|
static |
Convert the input file to XOD format and save to the specified path
in_filename | the file to convert to XOD |
out_filename | the path to the XOD file to create |
options | the conversion options |
|
static |
Convert the input file to XOD format and save to the specified path
in_filename | the file to convert to XOD |
out_filename | the path to the XOD file to create |
|
static |
Convert the input file to XOD format and save to the specified path
in_pdfdoc | the PDFDoc to convert to XOD |
out_filename | the path to the XOD file to create |
options | the conversion options |
|
static |
Generate a stream that incrementally converts the input file to XOD format.
in_filename | the file to convert to XOD |
options | the conversion options |
|
static |
Generate a stream that incrementally converts the input file to XOD format.
in_filename | the file to convert to XOD |
|
static |
Generate a stream that incrementally converts the input file to XOD format.
in_pdfdoc | the PDFDoc to convert to XOD |
options | the conversion options |
|
static |
|
static |
|
static |
|
static |
Convert the PDFDoc to XPS and save to the specified path
in_pdfdoc | the PDFDoc to convert to XPS |
in_filename | the path to the document to create |
options | the conversion options |
|
static |
Convert the input file to XPS format and save to the specified path
in_inputFilename | the file to convert to XPS |
in_outputFilename | the path to the XPS file to create |
options | the conversion options |
|
static |
Convert the input file to XPS format and save to the specified path
in_inputFilename | the file to convert to XPS |
in_outputFilename | the path to the XPS file to create |
|
static |
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.
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 |
PDFNetException |
|
static |
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.
in_pdfdoc | the conversion result will be appended to this pdf. |
in_stream | the source document data. The source must be in .docx format. |
options | the conversion options |
PDFNetException |
|
static |
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.
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 |
|
static |
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.
in_pdfdoc | the conversion result will be appended to this pdf. |
in_stream | the source document data. The source must be in .docx format. |
options | the conversion options |