Pdftools SDK
Loading...
Searching...
No Matches
Macros | Functions
PdfTools_PdfToolsOptimization.h File Reference
#include "PdfTools_Types.h"
#include "PdfTools_PdfToolsSys.h"

Go to the source code of this file.

Macros

#define PDFTOOLS_CALL
 

Functions

PDFTOOLS_EXPORT TPdfToolsOptimization_CompressionAlgorithmSelection PDFTOOLS_CALL PdfToolsOptimization_ImageRecompressionOptions_GetAlgorithmSelection (TPdfToolsOptimization_ImageRecompressionOptions *pImageRecompressionOptions)
 The strategy for image recompression.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_ImageRecompressionOptions_SetAlgorithmSelection (TPdfToolsOptimization_ImageRecompressionOptions *pImageRecompressionOptions, TPdfToolsOptimization_CompressionAlgorithmSelection iAlgorithmSelection)
 The strategy for image recompression.
 
PDFTOOLS_EXPORT double PDFTOOLS_CALL PdfToolsOptimization_ImageRecompressionOptions_GetCompressionQuality (TPdfToolsOptimization_ImageRecompressionOptions *pImageRecompressionOptions)
 The compression quality for lossy image compression algorithms.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_ImageRecompressionOptions_SetCompressionQuality (TPdfToolsOptimization_ImageRecompressionOptions *pImageRecompressionOptions, double dCompressionQuality)
 The compression quality for lossy image compression algorithms.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_FontOptions_GetMerge (TPdfToolsOptimization_FontOptions *pFontOptions)
 Whether to merge fonts and font programs.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_FontOptions_SetMerge (TPdfToolsOptimization_FontOptions *pFontOptions, BOOL bMerge)
 Whether to merge fonts and font programs.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_FontOptions_GetRemoveStandardFonts (TPdfToolsOptimization_FontOptions *pFontOptions)
 Whether to remove standard fonts.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_FontOptions_SetRemoveStandardFonts (TPdfToolsOptimization_FontOptions *pFontOptions, BOOL bRemoveStandardFonts)
 Whether to remove standard fonts.
 
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.
 
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.
 
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.
 
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.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveMetadata (TPdfToolsOptimization_RemovalOptions *pRemovalOptions)
 Whether to remove document's XMP metadata Default:
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveMetadata (TPdfToolsOptimization_RemovalOptions *pRemovalOptions, BOOL bRemoveMetadata)
 Whether to remove document's XMP metadata Default:
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveOutputIntents (TPdfToolsOptimization_RemovalOptions *pRemovalOptions)
 Whether to remove all output intents.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveOutputIntents (TPdfToolsOptimization_RemovalOptions *pRemovalOptions, BOOL bRemoveOutputIntents)
 Whether to remove all output intents.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemovePieceInfo (TPdfToolsOptimization_RemovalOptions *pRemovalOptions)
 Whether to remove the piece-info dictionary (private PDF processor data)
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemovePieceInfo (TPdfToolsOptimization_RemovalOptions *pRemovalOptions, BOOL bRemovePieceInfo)
 Whether to remove the piece-info dictionary (private PDF processor data)
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveStructureTree (TPdfToolsOptimization_RemovalOptions *pRemovalOptions)
 Whether to remove the data describing the logical structure of a PDF.
 
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.
 
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.
 
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.
 
PDFTOOLS_EXPORT TPdfToolsOptimization_RemovalStrategy PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveSignatureAppearances (TPdfToolsOptimization_RemovalOptions *pRemovalOptions)
 Whether to remove or flatten signature appearances.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveSignatureAppearances (TPdfToolsOptimization_RemovalOptions *pRemovalOptions, TPdfToolsOptimization_RemovalStrategy iRemoveSignatureAppearances)
 Whether to remove or flatten signature appearances.
 
PDFTOOLS_EXPORT TPdfToolsOptimization_ConversionStrategy PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetAnnotations (TPdfToolsOptimization_RemovalOptions *pRemovalOptions)
 The conversion strategy for annotations.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetAnnotations (TPdfToolsOptimization_RemovalOptions *pRemovalOptions, TPdfToolsOptimization_ConversionStrategy iAnnotations)
 The conversion strategy for annotations.
 
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.
 
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.
 
PDFTOOLS_EXPORT TPdfToolsOptimization_ConversionStrategy PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetLinks (TPdfToolsOptimization_RemovalOptions *pRemovalOptions)
 The conversion strategy for links Default: ePdfToolsOptimization_ConversionStrategy_Copy in all profiles.
 
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.
 
PDFTOOLS_EXPORT TPdfToolsOptimization_Optimizer *PDFTOOLS_CALL PdfToolsOptimization_Optimizer_New (void)
 
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.
 

Macro Definition Documentation

◆ PDFTOOLS_CALL

#define PDFTOOLS_CALL

Function Documentation

◆ PdfToolsOptimization_FontOptions_GetMerge()

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.

Parameters
[in,out]pFontOptionsActs as a handle to the native object of type TPdfToolsOptimization_FontOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE is returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_FontOptions_GetRemoveStandardFonts()

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.

Parameters
[in,out]pFontOptionsActs as a handle to the native object of type TPdfToolsOptimization_FontOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE is returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_FontOptions_SetMerge()

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.

Parameters
[in,out]pFontOptionsActs as a handle to the native object of type TPdfToolsOptimization_FontOptions.
[in]bMergeSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_FontOptions_SetRemoveStandardFonts()

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.

Parameters
[in,out]pFontOptionsActs as a handle to the native object of type TPdfToolsOptimization_FontOptions.
[in]bRemoveStandardFontsSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_ImageRecompressionOptions_GetAlgorithmSelection()

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:

Parameters
[in,out]pImageRecompressionOptionsActs as a handle to the native object of type TPdfToolsOptimization_ImageRecompressionOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_ImageRecompressionOptions_GetCompressionQuality()

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:

Parameters
[in,out]pImageRecompressionOptionsActs as a handle to the native object of type TPdfToolsOptimization_ImageRecompressionOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when -1.0 is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOptimization_ImageRecompressionOptions_SetAlgorithmSelection()

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:

Parameters
[in,out]pImageRecompressionOptionsActs as a handle to the native object of type TPdfToolsOptimization_ImageRecompressionOptions.
[in]iAlgorithmSelectionSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_ImageRecompressionOptions_SetCompressionQuality()

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:

Parameters
[in,out]pImageRecompressionOptionsActs as a handle to the native object of type TPdfToolsOptimization_ImageRecompressionOptions.
[in]dCompressionQualitySet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOptimization_Optimizer_New()

PDFTOOLS_EXPORT TPdfToolsOptimization_Optimizer *PDFTOOLS_CALL PdfToolsOptimization_Optimizer_New ( void )
Returns
Handle to the newly created native object.

NULL if there is an error.

Note
An error occurred when NULL is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_Optimizer_OptimizeDocument()

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.

Parameters
[in,out]pOptimizerActs as a handle to the native object of type TPdfToolsOptimization_Optimizer.
[in,out]pInDocThe input PDF document
[in,out]pOutStreamDescThe stream to which the output PDF is written
[in,out]pProfileThe profile defining the optimization parameters.
[in,out]pOutOptionsThe PDF output options, e.g. to encrypt the output document.
Returns
The optimized result PDF, which can be used as a new input for further processing.

Note that, this object must be disposed before the output stream object (method argument pOutStreamDesc).

NULL if there is an error.

Note
An error occurred when NULL is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage. Possible error codes:

◆ PdfToolsOptimization_RemovalOptions_GetAnnotations()

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:

  • Sticky notes
  • Free text annotations
  • Line, square, circle, and polygon annotations
  • Highlight, underline and strikeout annotations
  • Stamp annotations
  • Ink annotations
  • File attachment annotation
  • Sound and movie annotations
  • 3D annotations

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetFormFields()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetLinks()

PDFTOOLS_EXPORT TPdfToolsOptimization_ConversionStrategy PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetLinks ( TPdfToolsOptimization_RemovalOptions * pRemovalOptions)

The conversion strategy for links Default: ePdfToolsOptimization_ConversionStrategy_Copy in all profiles.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetRemoveAlternateImages()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE is returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetRemoveArticleThreads()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE is returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetRemoveMetadata()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_GetRemoveMetadata ( TPdfToolsOptimization_RemovalOptions * pRemovalOptions)

Whether to remove document's XMP metadata Default:

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE is returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetRemoveOutputIntents()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE is returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetRemovePieceInfo()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE is returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetRemoveSignatureAppearances()

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:

  • (a) The invisible digital signature in the PDF.
  • (b) The visual appearance that was attributed to the signature.

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when 0 is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetRemoveStructureTree()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE is returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_GetRemoveThumbnails()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
Returns
Retrieved value.

May indicate an error in certain scenarios. For further information see the note section below.

Note
An error occurred when FALSE is returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetAnnotations()

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:

  • Sticky notes
  • Free text annotations
  • Line, square, circle, and polygon annotations
  • Highlight, underline and strikeout annotations
  • Stamp annotations
  • Ink annotations
  • File attachment annotation
  • Sound and movie annotations
  • 3D annotations

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]iAnnotationsSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetFormFields()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]iFormFieldsSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetLinks()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]iLinksSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetRemoveAlternateImages()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]bRemoveAlternateImagesSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetRemoveArticleThreads()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]bRemoveArticleThreadsSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetRemoveMetadata()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsOptimization_RemovalOptions_SetRemoveMetadata ( TPdfToolsOptimization_RemovalOptions * pRemovalOptions,
BOOL bRemoveMetadata )

Whether to remove document's XMP metadata Default:

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]bRemoveMetadataSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetRemoveOutputIntents()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]bRemoveOutputIntentsSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetRemovePieceInfo()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]bRemovePieceInfoSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetRemoveSignatureAppearances()

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:

  • (a) The invisible digital signature in the PDF.
  • (b) The visual appearance that was attributed to the signature.

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]iRemoveSignatureAppearancesSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetRemoveStructureTree()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]bRemoveStructureTreeSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.

◆ PdfToolsOptimization_RemovalOptions_SetRemoveThumbnails()

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.

Parameters
[in,out]pRemovalOptionsActs as a handle to the native object of type TPdfToolsOptimization_RemovalOptions.
[in]bRemoveThumbnailsSet value.
Returns
TRUE if the operation is successful; FALSE if there is an error.
Note
An error occurred when FALSE is returned. The specific error code can be retrieved by calling PdfTools_GetLastError. The error message can be obtained by calling PdfTools_GetLastErrorMessage.