kDocEmbedSubset = 0x01 | Fonts will be subset when embedded. Otherwise the entire font will be embedded. Full fonts should only be embedded if the information in the fonts indicates it can be used for editible embedding. Fonts that have more than 2048 characters will be subset embedded regardless of the setting of this flag. This flag implies a scan of the document text to ensure that all required characters are in the subset.
|
kDocEmbedSubsetOfEmbeddedFont = 0x02 | If set, fonts that have already been embedded but are not subset fonts, will be reembedded as a subset font. If clear, already embedded fonts will not be re-scanned for embedding at all, subset or no.
|
PDFOptimizerCompressQualityUnset = 0 | |
PDFOptimizerCompressMinimum | |
PDFOptimizerCompressLowQuality | |
PDFOptimizerCompressMediumQuality | |
PDFOptimizerCompressHighQuality | |
PDFOptimizerCompressMaximumQuality | |
PDFOptimizerCompressLossless |
PDFOptimizerColor = 1 | Compress colored images
|
PDFOptimizerGray | Compress Gray scale Images
|
PDFOptimizerMonochrome | Compress B/W images
|
PDFOptimizerRecompressNone = 0 | Used only when original image is not compressed
|
PDFOptimizerRecompressSame | Compress using the same compression
|
PDFOptimizerRecompressFlate | Compress image using Flate
|
PDFOptimizerRecompressJpeg | Compress image using Jpeg
|
PDFOptimizerRecompressJP2k | Compress image using JPEG2000
|
PDFOptimizerRecompressJBig | Compress image using JBig2
|
PDFOptimizerRecompressCCITTG4 | Compress image using CCITTG4
|
PDFOptimizerRecompressCCITTG3 | Compress image using CCITTG3
|
PDFOptimizerRecompressFlateJpeg | Compress using Flate and Jpeg
|
PDFOptimizerObjectCompressionAll = 0 | Compress all objects.
|
PDFOptimizerObjectCompressionNone | No object compression is used.
|
PDFOptimizerObjectCompressionStructure | Compress objects related to Logical Structure of a document.
|
PDFOptimizerObjectCompressionLeaveUnchanged | Leave object compression unchanged.
|
PDFOptimizerDownsampleColor = 1 | Defaults to ON
|
PDFOptimizerRecompressColor | Defaults to ON
|
PDFOptimizerDownsampleGray | Defaults to ON
|
PDFOptimizerRecompressGray | Defaults to ON
|
PDFOptimizerDownsampleBW | Defaults to ON
|
PDFOptimizerRecompressBW | Defaults to ON
|
PDFOptimizerDownsampleRecompressOnlyIfSmaller | Defaults to ON
|
PDFOptimizerDiscardAlternateImages | Defaults to ON
|
PDFOptimizerSubsetAllEmbeddedFonts | Defaults to ON
|
PDFOptimizerRemoveAllEmbeddedFonts | Defaults to OFF
|
PDFOptimizerRemoveAllBase14Fonts | Defaults to ON
|
PDFOptimizerMergeDuplicateFonts | Defaults to ON
|
PDFOptimizerDiscardBookmarks | Defaults to OFF
|
PDFOptimizerDiscardAcroforms | Defaults to OFF
|
PDFOptimizerDiscardOutputIntent | Defaults to ON
|
PDFOptimizerDiscardThumbnails | Defaults to ON
|
PDFOptimizerDiscardPageLabels | Defaults to ON
|
PDFOptimizerDiscardNameTrees | Defaults to ON
|
PDFOptimizerDiscardStructureTrees | Defaults to ON
|
PDFOptimizerDiscardFileAttachments | Defaults to ON
|
PDFOptimizerDiscardXMPPadding | Defaults to ON Remove padding from XMP Metadata
|
PDFOptimizerDiscardUnusedForms | Defaults to ON
|
PDFOptimizerDiscardPieceData | Defaults to ON
|
PDFOptimizerCompressStreams | Defaults to ON, indicates if Uncompressed Streams will be compressed when possible.
|
PDFOptimizerReplaceLZW | Defaults to ON
|
PDFOptimizerDiscardMetadata | Defaults to ON
|
PDFOptimizerDiscardDocumentInfo | Defaults to ON
|
PDFOptimizerOptimizeContentStreams | Defaults to ON
|
PDFOptimizerLinearize | Defaults to OFF
|
PDFOptimizerDiscardDuplicateForms | Defaults to OFF
|
PDFOptimizerDiscardDuplicateObjects | Defaults to ON
|
PDFOptimizerDiscardASCIIFilters | Defaults to ON
|
PDFOptimizerDiscardComments | Defaults to OFF
|
PDFOptimizerDiscardAnnotations | Defaults to OFF
|
PDFOptimizerDiscardJavaScriptActions | Defaults to OFF
|
PDFOptimizerFlattenOptionalContent | Defaults to OFF
|
PDFOptimizerResubsetSubsetFonts | Defaults to ON. The related option PDFOptimizerSubsetAllEmbeddedFonts must be Enabled for this option to have an effect. Fonts which are already Embedded Subset will be Re-subset. If the document being optimized represents an extraction of pages from a larger document, or if the document has been edited to remove Content, this can result in savings. NOTE: This can ONLY remove glyphs from an already subset font. It doesn't add missing glyphs.
|
PDFOptimizerDownConvert16To8BpcImages | Defaults to ON
|
PDFOptimizerDiscardUnusedImages | Defaults to ON
|
PDFOptimizerDiscardUnusedFonts | Defaults to ON
|
PDFOptimizerIncludeIndexedImages | |
PDFOptimizerDoNotPersistFileAttributes | Defaults to OFF
|
PDFOptimizerLastOption |
typedef
struct
_t_PDFOptimizationParamsRec
*
PDFOptimizationParams
;
| |
The name of the Font.
| |
The size of the Embedded Font file in bytes prior to Optimization.
| |
The size of the Embedded Font file in bytes after Optimization.
| |
The Font object.
| |
This font was re-subset during Optimization.
| |
|
| |
The DPI of the Image prior to Optimization.
| |
The DPI of the Image after Optimization, this may be unchanged from the value prior to Optimization if downsampling was not used.
| |
The compression of the Image prior to Optimization.
| |
The compression of the Image prior to Optimization.
| |
The size of the Image in bytes prior to Optimization.
| |
The size of the Image in bytes after Optimization.
| |
|
| |
This is always
sizeof(PDDocTextFinderConfigRec) . | |
If true, inserts \n chars instead of spaces wherever ends of lines are detected within extracted text.
| |
|
| |
Size of the structure.
| |
The Color Images Optimized in the document.
| |
The number of Color Images Optimized in the document.
| |
The Gray Images Optimized in the document.
| |
The number of Gray Images Optimized in the document.
| |
The Monochrome Images Optimized in the document.
| |
The number of Monochrome Images Optimized in the document.
| |
The Fonts Optimized in the document.
| |
The number of Fonts Optimized in the document.
| |
Bookmarks (outlines) were removed from the document.
| |
AcroForms were removed from the document.
| |
Output Intents were removed from the document.
| |
Page Labels were removed from the document.
| |
Name Trees were removed from the document.
| |
The Structure Tree items were removed from the document.
| |
Optional Content in the document was Flattened.
| |
Linearization was applied to the document.
| |
The number of Pages with PieceData removed from the document.
| |
The number of Pages with Attachments removed from the document.
| |
The number of Pages with Comments removed from the document.
| |
The number of Pages with Annotations removed from the document.
| |
The number of Pages with Thumbnails removed from the document.
| |
The number of Unused Form XObjects removed from the document.
| |
The number of Unused Image XObjects removed from the document.
| |
The number of Unused Fonts removed from the document.
| |
The number of items with Metadata streams removed from the document.
| |
The number of items of Document Info removed from the document.
| |
The number of JavaScript Actions removed from the document.
| |
The number of Alternate Images removed from the document.
| |
The number of 16 BPC images converted to 8 BPC in the document.
| |
Resubsetting of already subset Fonts was attemped.
| |
The number of fully Embedded Fonts subset in the document.
| |
The number of subset Fonts re-subset in the document.
| |
The number of fully Embedded Fonts removed from the document.
| |
The number of Base 14 Fully Embedded fonts removed from the document.
| |
|
void
PDDocDeletePagesEx(
IN
PDDoc
doc
,
ASInt32
firstPage
,
ASInt32
lastPage
,
ProgressMonitor
progMon
,
void
*
progMonClientData
,
PDPageDeleteFlags
flags
);
doc | The document from which pages are deleted.
|
firstPage | The page number of the first page to delete. The first page is
0 . |
lastPage | The page number of the last page to delete.
|
progMon | A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default progress monitor.
NULL may be passed, in which case no progress monitor is used. |
progMonClientData | |
flags | Page Deletion flags that can be used to modify the how the deletion process works.
|
Note: If the font has information indicating that it cannot be embedded for print and preview, the font will not be embedded in the document.
void
PDDocEmbedFonts(
PDDoc
doc
,
ASUns32
flags
,
ASStatusMonitorProcs
statusMon
);
doc | PDDoc to operate on. The fonts will be embedded in this document. To keep the changes the document must be saved. Fonts on the user's system that match the original font definition will be embedded. For the Times Roman and Helvetica and corresponding styles, if displayed with a font alias, then the font alias will be embedded in the file. If the font has information that indicates the font cannot be embedded for print and preview, the font will not be embedded in the document.
| ||||
flags | One of the following:
| ||||
statusMon | Pointer to a record containing a Progress Monitor, Cancel procedure, and report procedure. The procedures in the progress monitor are called to indicate the progress of the routine. The cancel procedure is called periodically to allow the client to cancel the routine. If the cancel procedure returns false then the routine is canceled. The report procedure will be called to report errors or warnings while embedding the fonts. For each font that cannot be embedded, the report procedure will be called.
|
Note: If the font has information indicating that it cannot be embedded for print and preview, then the font will not be embedded in the document.
void
PDDocEmbedFontsFromFontArray(
PDDoc
doc
,
const
PDFont
*
fonts
,
ASUns32
nFonts
,
ASUns32
flags
,
ASStatusMonitorProcs
statusMon
);
doc | PDDoc to operate on. The fonts will be embedded in this document. To keep the changes the document must be saved. Fonts on the user's system that match the original font definition will be embedded. For the Times Roman and Helvetica and corresponding styles, if displayed with a font alias, then the font alias will be embedded in the file. If the font has information that indicates the font cannot be embedded for print and preview, then the font will not be embedded in the document.
| ||||
fonts | An array of PDFont containing fonts to be embedded.
| ||||
nFonts | The number of fonts in the fonts array.
| ||||
flags | One of the following:
| ||||
statusMon | Pointer to a record containing a Progress Monitor, Cancel procedure, and report procedure. The procedures in the progress monitor are called to indicate the progress of the routine. The cancel procedure is called periodically to allow the client to cancel the routine. If the cancel procedure returns false then the routine is canceled. The report procedure will be called to report errors or warnings while embedding the fonts. For each font that cannot be embedded, the report procedure will be called.
|
void
PDDocFlattenAcroFormFieldsAsIfPrinted(
PDDoc
doc
);
doc | IN/OUT The PDF document object.
|
ASBool
PDDocHasSignature(
PDDoc
pdDoc
);
pdDoc | The document.
|
This will create a set of optimization parameters, set to the default values. These can be examined using "get" methods, and changed with the "set" methods
When these parameters are no longer needed (after the call to PDDocumentOptimize, although they be re-used any number of times), they should be freed by the method PDDocOptimizeReleaseParams.
PDFOptimizationParams
PDDocOptimizeDefaultParams(
void
);
void
PDDocOptimizeGetImageRecompress(
PDFOptimizationParams
Params
,
PDFOptimizerCompressImageType
imageType
,
ASInt16
*
recompressIfAbove
,
ASInt16
*
recompressTo
,
PDFOptimizerCompressionType
*
compressType
,
PDFOptimizationCompressQuality
*
compressQuality
);
Params | IN a PDFOptimizationParams object to be checked
|
imageType | OUT The class of Images these parameters are to refer to.
|
recompressIfAbove | OUT The lower limit of resolution (In DPI) of an Image to be Resampled.
|
recompressTo | OUT The target DPI for Resampling. Images which are Resampled will be changed to this resolution.
|
compressType | OUT a member of the enumeration PDFOptimizerCompressionType.
|
compressQuality | OUT a member of the enumeration PDFOptimizationCompressQuality
|
PDFOptimizerObjectCompressionType
PDDocOptimizeGetObjectCompression(
PDFOptimizationParams
params
);
params | the PDFOptimizationParams object from which the compression type will be read from.
|
ASBool
PDDocOptimizeGetOption(
PDFOptimizationParams
Params
,
PDFOptimizerOption
option
);
Params | IN. A PDFOptimizationParams object to be checked
|
option | IN. A member of the enumeration PDFOptimizerOption, selecting which option to effect.
|
void
PDDocOptimizeGetPDFOutputLevel(
PDFOptimizationParams
params
,
ASInt16
*
majorP
,
ASInt16
*
minorP
);
Params | a PDFOptimizationParams object
|
majorP | (Filled by method) The major version number.
|
minorP | (Filled by method) The minor version number.
|
void
PDDocOptimizeReleaseParams(
PDFOptimizationParams
params
);
params | the PDFOptimizationParams to free.
|
void
PDDocOptimizeSetImageRecompress(
PDFOptimizationParams
Params
,
PDFOptimizerCompressImageType
imageType
,
ASInt16
recompressIfAbove
,
ASInt16
recompressTo
,
PDFOptimizerCompressionType
compressType
,
PDFOptimizationCompressQuality
compressQuality
);
Params | IN a PDFOptimizationParams object to be modified
|
imageType | IN The class of Images these parameters are to refer to. This is a member of the Enumeration PDFOptimizerCompressImageType and is one of the set of values "Color", "Gray", or "Monochrome" (B/W).
|
recompressIfAbove | IN The lower limit of resolution (In DPI) of an Image to be Resampled. Only Images above this limitation will be considered for Resampling.
|
recompressTo | IN The target DPI for Resampling. Images which are Resampled will be changed to this resolution.
|
compressType | IN a member of the enumeration PDFOptimizerCompressionType. Images which are either Resampled or Recompressed will be written in this compression type. If the value of this enumeration is either the specifier for "Same", or for "None", then we will not Recompress images which do not require Downsampling.
|
compressQuality | IN a member of the enumeration PDFOptimizationCompressQuality. NOTE that this enumeration is only meaningful for lossy compression techniques. Note also that it is an error to specify "Lossless" for techniques that cannot support lossless compression.
|
void
PDDocOptimizeSetObjectCompression(
PDFOptimizationParams
params
,
PDFOptimizerObjectCompressionType
compressionType
);
params | a PDFOptimizationParams object to be modified.
|
compressionType | The type of compression to apply to the document.
|
void
PDDocOptimizeSetOption(
PDFOptimizationParams
Params
,
PDFOptimizerOption
option
,
ASBool
OnOff
);
Params | IN. A PDFOptimizationParams object to be modified
|
option | IN. A member of the enumeration PDFOptimizerOption, selecting which option to effect.
|
OnOff |
void
PDDocOptimizeSetPDFOutputLevel(
PDFOptimizationParams
params
,
ASInt16
majorP
,
ASInt16
minorP
);
Params | IN a PDFOptimizationParams object to be modified.
|
majorP | The major version number.
|
minorP | The minor version number.
|
void
PDDocRemoveAttachment(
PDDoc
doc
,
char
*
attachmentNameToRemove
);
doc | IN The PDF document object.
|
attachmentNameToRemove | IN The attachment name to remove, this should be a null terminated string.
|
void
PDDocReplaceUnembeddedSimpleFonts(
PDDoc
doc
,
ASAtom
*
currentFontNames
,
ASAtom
*
newFontNames
,
ASUns32
fontNamesLength
);
doc | |
currentFontNames | IN The names of the fonts to be replaced (Required)
|
newFontNames | IN The names of the new fonts (Required)
|
fontNamesLength | IN The number of current font names and the number of new font names (they have to be the same) (Required)
|
ASBool
PDDocWillNeedIncrementalSave(
PDDoc
pdDoc
);
pdDoc | The document.
|
ASBool
PDDocumentOptimize(
PDDoc
InputDoc
,
ASPathName
OutputPath
,
ASFileSys
fileSys
,
PDFOptimizationParams
params
,
ProgressMonitor
progMon
,
void
*
progMonClientData
,
ASCancelProc
cancelProc
,
void
*
cancelProcClientData
);
InputDoc | |
OutputPath | IN an ASFilePath where the optimized document is to be written (Required)
|
OutputFileSys | |
OptimizationParams | IN a reference to a OptimizationParamsRec structure, used to control optimization. (Required)
|
ProgMon | IN an optional progress monitor
|
progMonClientData | IN An optional pointer to client data used by the progress monitor.
|
cancelProc | IN an optional pointer to a cancel procedure
|
cancelProcClientData | IN an optional pointer to cancel proc client data
|
ASBool
PDDocumentOptimizeWithReport(
PDDoc
InputDoc
,
ASPathName
OutputPath
,
ASFileSys
fileSys
,
PDFOptimizationParams
params
,
ProgressMonitor
progMon
,
void
*
progMonClientData
,
ASCancelProc
cancelProc
,
void
*
cancelProcClientData
,
PDFOptimizerReport
report
);
InputDoc | |
OutputPath | IN an ASFilePath where the optimized document is to be written (Required)
|
OutputFileSys | |
OptimizationParams | IN a reference to a OptimizationParamsRec structure, used to control optimization. (Required)
|
ProgMon | IN an optional progress monitor
|
progMonClientData | IN An optional pointer to client data used by the progress monitor
|
cancelProc | IN an optional pointer to a cancel procedure
|
cancelProcClientData | IN an optiona pointer to cancel proc client data
|
report | OUT an PDFOptimizerReport that will be filled by the method
|