Pdftools SDK
|
Go to the source code of this file.
Macros | |
#define | PDFTOOLS_CALL |
#define PDFTOOLS_CALL |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_FontOptions_GetMerge | ( | TPdfToolsOptimization_FontOptions * | pFontOptions | ) |
Whether to merge fonts and font programs.
A PDF document can have the same font, or a subset of it, embedded multiple times. This commonly occurs, when multiple PDFs are merged into one large PDF. Such fonts can be merged into one font.
Merging fonts and font programs can greatly reduce the file size. However, it is computationally complex and can increase file processing time and memory usage substantially.
Default: TRUE.
[in,out] | pFontOptions | Acts as a handle to the native object of type TPdfToolsOptimization_FontOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_FontOptions_GetRemoveStandardFonts | ( | TPdfToolsOptimization_FontOptions * | pFontOptions | ) |
Whether to remove standard fonts.
Enable or disable un-embedding of the font programs of all embedded standard fonts, such as Arial, Courier, CourierNew, Helvetica, Symbol, Times, TimesNewRoman and ZapfDingbats. This decreases the file size.
The fonts are replaced with one of the 14 PDF Standard Fonts, all of which have no associated font program. A PDF viewer must be able to display these 14 PDF Standard Fonts correctly. Therefore, enabling this property usually does not visually alter the PDF when it is displayed.
Un-embedding the font works based on the font's Unicode information, i.e. the un-embedded font's characters are mapped to those of the original font with the same Unicode. Therefore, only fonts with Unicode information are un-embedded.
If a font's Unicode information is incorrect, un-embedding may lead to visual differences. The correctness of a Unicode information can be verified by extracting text that uses the font.
If the extracted text is meaningful, the font's Unicode information is correct, and un-embedding of the font does not cause visual differences.
Default: FALSE (disabled) except in the profile TPdfToolsOptimizationProfiles_MinimalFileSize.
[in,out] | pFontOptions | Acts as a handle to the native object of type TPdfToolsOptimization_FontOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_FontOptions_SetMerge | ( | TPdfToolsOptimization_FontOptions * | pFontOptions, |
BOOL | bMerge ) |
Whether to merge fonts and font programs.
A PDF document can have the same font, or a subset of it, embedded multiple times. This commonly occurs, when multiple PDFs are merged into one large PDF. Such fonts can be merged into one font.
Merging fonts and font programs can greatly reduce the file size. However, it is computationally complex and can increase file processing time and memory usage substantially.
Default: TRUE.
[in,out] | pFontOptions | Acts as a handle to the native object of type TPdfToolsOptimization_FontOptions. |
[in] | bMerge | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_FontOptions_SetRemoveStandardFonts | ( | TPdfToolsOptimization_FontOptions * | pFontOptions, |
BOOL | bRemoveStandardFonts ) |
Whether to remove standard fonts.
Enable or disable un-embedding of the font programs of all embedded standard fonts, such as Arial, Courier, CourierNew, Helvetica, Symbol, Times, TimesNewRoman and ZapfDingbats. This decreases the file size.
The fonts are replaced with one of the 14 PDF Standard Fonts, all of which have no associated font program. A PDF viewer must be able to display these 14 PDF Standard Fonts correctly. Therefore, enabling this property usually does not visually alter the PDF when it is displayed.
Un-embedding the font works based on the font's Unicode information, i.e. the un-embedded font's characters are mapped to those of the original font with the same Unicode. Therefore, only fonts with Unicode information are un-embedded.
If a font's Unicode information is incorrect, un-embedding may lead to visual differences. The correctness of a Unicode information can be verified by extracting text that uses the font.
If the extracted text is meaningful, the font's Unicode information is correct, and un-embedding of the font does not cause visual differences.
Default: FALSE (disabled) except in the profile TPdfToolsOptimizationProfiles_MinimalFileSize.
[in,out] | pFontOptions | Acts as a handle to the native object of type TPdfToolsOptimization_FontOptions. |
[in] | bRemoveStandardFonts | Set value. |
PDFTOOLS_EXPORT TPdfToolsOptimization_CompressionAlgorithmSelection PDFTOOLS_CALL PdfToolsOptimization_ImageRecompressionOptions_GetAlgorithmSelection | ( | TPdfToolsOptimization_ImageRecompressionOptions * | pImageRecompressionOptions | ) |
The strategy for image recompression.
For each image to be recompressed, a specific choice of compression algorithms are tried. The selection of algorithms depends on this strategy, the type of the optimizer profile (e.g. TPdfToolsOptimizationProfiles_Web), the color space of the image, and PdfToolsOptimization_ImageRecompressionOptions_GetCompressionQuality. The image is recompressed using the algorithm resulting in the smallest output file.
Refer to TPdfToolsOptimization_CompressionAlgorithmSelection for more information on strategies.
Default:
[in,out] | pImageRecompressionOptions | Acts as a handle to the native object of type TPdfToolsOptimization_ImageRecompressionOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT double PDFTOOLS_CALL PdfToolsOptimization_ImageRecompressionOptions_GetCompressionQuality | ( | TPdfToolsOptimization_ImageRecompressionOptions * | pImageRecompressionOptions | ) |
The compression quality for lossy image compression algorithms.
This property specifies the compression quality for the JPEG and JPEG2000 image compression algorithms. Valid values are between 0 (lowest quality) and 1 (highest quality).
Although the JBIG2 algorithm for bi-tonal images also allows lossy compression, it is not influenced by this property. The JBIG2 compression quality is fixed at 1 (lossless).
Default:
[in,out] | pImageRecompressionOptions | Acts as a handle to the native object of type TPdfToolsOptimization_ImageRecompressionOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
-1.0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_ImageRecompressionOptions_SetAlgorithmSelection | ( | TPdfToolsOptimization_ImageRecompressionOptions * | pImageRecompressionOptions, |
TPdfToolsOptimization_CompressionAlgorithmSelection | iAlgorithmSelection ) |
The strategy for image recompression.
For each image to be recompressed, a specific choice of compression algorithms are tried. The selection of algorithms depends on this strategy, the type of the optimizer profile (e.g. TPdfToolsOptimizationProfiles_Web), the color space of the image, and PdfToolsOptimization_ImageRecompressionOptions_GetCompressionQuality. The image is recompressed using the algorithm resulting in the smallest output file.
Refer to TPdfToolsOptimization_CompressionAlgorithmSelection for more information on strategies.
Default:
[in,out] | pImageRecompressionOptions | Acts as a handle to the native object of type TPdfToolsOptimization_ImageRecompressionOptions. |
[in] | iAlgorithmSelection | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_ImageRecompressionOptions_SetCompressionQuality | ( | TPdfToolsOptimization_ImageRecompressionOptions * | pImageRecompressionOptions, |
double | dCompressionQuality ) |
The compression quality for lossy image compression algorithms.
This property specifies the compression quality for the JPEG and JPEG2000 image compression algorithms. Valid values are between 0 (lowest quality) and 1 (highest quality).
Although the JBIG2 algorithm for bi-tonal images also allows lossy compression, it is not influenced by this property. The JBIG2 compression quality is fixed at 1 (lossless).
Default:
[in,out] | pImageRecompressionOptions | Acts as a handle to the native object of type TPdfToolsOptimization_ImageRecompressionOptions. |
[in] | dCompressionQuality | Set value. |
PDFTOOLS_EXPORT TPdfToolsOptimization_Optimizer *PDFTOOLS_CALL PdfToolsOptimization_Optimizer_New | ( | void | ) |
NULL
if there is an error.
NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT TPdfToolsPdf_Document *PDFTOOLS_CALL PdfToolsOptimization_Optimizer_OptimizeDocument | ( | TPdfToolsOptimization_Optimizer * | pOptimizer, |
TPdfToolsPdf_Document * | pInDoc, | ||
const TPdfToolsSys_StreamDescriptor * | pOutStreamDesc, | ||
TPdfToolsOptimizationProfiles_Profile * | pProfile, | ||
TPdfToolsPdf_OutputOptions * | pOutOptions ) |
Optimize the PDF document.
[in,out] | pOptimizer | Acts as a handle to the native object of type TPdfToolsOptimization_Optimizer. |
[in,out] | pInDoc | The input PDF document |
[in,out] | pOutStreamDesc | The stream to which the output PDF is written |
[in,out] | pProfile | The profile defining the optimization parameters. |
[in,out] | pOutOptions | The PDF output options, e.g. to encrypt the output document. |
Note that, this object must be disposed before the output stream object (method argument pOutStreamDesc).
NULL
if there is an error.
NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:PDFTOOLS_EXPORT TPdfToolsOptimization_ConversionStrategy PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetAnnotations | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
The conversion strategy for annotations.
The conversion strategy for annotations.
Annotations in PDF are interactive elements on the pages, such as:
Note that this does not include form fields (see PdfToolsOptimization_RemovalOptions_GetFormFields) and links (see PdfToolsOptimization_RemovalOptions_GetLinks).
Default: ePdfToolsOptimization_ConversionStrategy_Copy in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT TPdfToolsOptimization_ConversionStrategy PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetFormFields | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
The conversion strategy for interactive forms Default: ePdfToolsOptimization_ConversionStrategy_Copy in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT TPdfToolsOptimization_ConversionStrategy PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetLinks | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
The conversion strategy for links Default: ePdfToolsOptimization_ConversionStrategy_Copy in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveAlternateImages | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
Whether to remove additional or alternative versions of images Default: FALSE except in the profile TPdfToolsOptimizationProfiles_Print.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveArticleThreads | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
Whether to remove the sequential flows (threads) of articles Default: TRUE except in the profile TPdfToolsOptimizationProfiles_Archive.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveMetadata | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
Whether to remove document's XMP metadata Default:
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveOutputIntents | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
Whether to remove all output intents.
Output intents provide a means for matching the color characteristics of PDF page content with those of a target output device or production environment in which the document will be printed.
Default: FALSE except in the profile TPdfToolsOptimizationProfiles_MinimalFileSize.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemovePieceInfo | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
Whether to remove the piece-info dictionary (private PDF processor data)
The removal of this proprietary application data has no effect on the document's visual appearance.
Default: TRUE except in the profile TPdfToolsOptimizationProfiles_Archive.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT TPdfToolsOptimization_RemovalStrategy PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveSignatureAppearances | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
Whether to remove or flatten signature appearances.
A signature in a PDF consist of two parts:
Part (a) can be used by a viewing application, to verify that the PDF has not changed since it has been signed and report this to the user.
During optimizing, the PDF is altered and hence its digital signature (a) is broken and must be removed.
Default: ePdfToolsOptimization_RemovalStrategy_Flatten in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveStructureTree | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
Whether to remove the data describing the logical structure of a PDF.
The logical structure of the document is a description of the content of its pages. It consists of a fine granular hierarchical tagging that distinguishes between the actual content and artifacts (such as page numbers, layout artifacts, etc.). The tagging provides a meaningful description, for example "This is a header", "This color image shows a small sailing boat at sunset", etc. This information can be used e.g. to read the document to the visually impaired.
Default: TRUE except in the profile TPdfToolsOptimizationProfiles_Archive.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveThumbnails | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions | ) |
Whether to remove thumbnail images which represent the PDF pages in miniature form Default: TRUE in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetAnnotations | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
TPdfToolsOptimization_ConversionStrategy | iAnnotations ) |
The conversion strategy for annotations.
The conversion strategy for annotations.
Annotations in PDF are interactive elements on the pages, such as:
Note that this does not include form fields (see PdfToolsOptimization_RemovalOptions_GetFormFields) and links (see PdfToolsOptimization_RemovalOptions_GetLinks).
Default: ePdfToolsOptimization_ConversionStrategy_Copy in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | iAnnotations | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetFormFields | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
TPdfToolsOptimization_ConversionStrategy | iFormFields ) |
The conversion strategy for interactive forms Default: ePdfToolsOptimization_ConversionStrategy_Copy in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | iFormFields | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetLinks | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
TPdfToolsOptimization_ConversionStrategy | iLinks ) |
The conversion strategy for links Default: ePdfToolsOptimization_ConversionStrategy_Copy in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | iLinks | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveAlternateImages | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
BOOL | bRemoveAlternateImages ) |
Whether to remove additional or alternative versions of images Default: FALSE except in the profile TPdfToolsOptimizationProfiles_Print.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | bRemoveAlternateImages | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveArticleThreads | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
BOOL | bRemoveArticleThreads ) |
Whether to remove the sequential flows (threads) of articles Default: TRUE except in the profile TPdfToolsOptimizationProfiles_Archive.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | bRemoveArticleThreads | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveMetadata | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
BOOL | bRemoveMetadata ) |
Whether to remove document's XMP metadata Default:
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | bRemoveMetadata | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveOutputIntents | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
BOOL | bRemoveOutputIntents ) |
Whether to remove all output intents.
Output intents provide a means for matching the color characteristics of PDF page content with those of a target output device or production environment in which the document will be printed.
Default: FALSE except in the profile TPdfToolsOptimizationProfiles_MinimalFileSize.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | bRemoveOutputIntents | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemovePieceInfo | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
BOOL | bRemovePieceInfo ) |
Whether to remove the piece-info dictionary (private PDF processor data)
The removal of this proprietary application data has no effect on the document's visual appearance.
Default: TRUE except in the profile TPdfToolsOptimizationProfiles_Archive.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | bRemovePieceInfo | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveSignatureAppearances | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
TPdfToolsOptimization_RemovalStrategy | iRemoveSignatureAppearances ) |
Whether to remove or flatten signature appearances.
A signature in a PDF consist of two parts:
Part (a) can be used by a viewing application, to verify that the PDF has not changed since it has been signed and report this to the user.
During optimizing, the PDF is altered and hence its digital signature (a) is broken and must be removed.
Default: ePdfToolsOptimization_RemovalStrategy_Flatten in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | iRemoveSignatureAppearances | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveStructureTree | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
BOOL | bRemoveStructureTree ) |
Whether to remove the data describing the logical structure of a PDF.
The logical structure of the document is a description of the content of its pages. It consists of a fine granular hierarchical tagging that distinguishes between the actual content and artifacts (such as page numbers, layout artifacts, etc.). The tagging provides a meaningful description, for example "This is a header", "This color image shows a small sailing boat at sunset", etc. This information can be used e.g. to read the document to the visually impaired.
Default: TRUE except in the profile TPdfToolsOptimizationProfiles_Archive.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | bRemoveStructureTree | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveThumbnails | ( | TPdfToolsOptimization_RemovalOptions * | pRemovalOptions, |
BOOL | bRemoveThumbnails ) |
Whether to remove thumbnail images which represent the PDF pages in miniature form Default: TRUE in all profiles.
[in,out] | pRemovalOptions | Acts as a handle to the native object of type TPdfToolsOptimization_RemovalOptions. |
[in] | bRemoveThumbnails | Set value. |