Overview
The operation allows to optimize the PDF document.
Parameters
Name
|
Type
|
Description
|
Input
|
Array
|
Array of IUnknown -based objects that should contain the IPXC_Document that will be optimized. Note that only the first element from the array will be evaluated.
|
Output
|
Array
|
Array of IUnknown -based objects. Not used.
|
Options
|
Dictionary
|
Dictionary with options of the operation.
|
Sample
02 | private void OptimizeDocument(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) |
04 | int nID = Inst.Str2ID( "op.document.optimize" , false ); |
05 | PDFXEdit.IOperation Op = Inst.CreateOp(nID); |
06 | var input = Op.Params.Root[ "Input" ]; |
08 | PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension( "AFS" ); |
09 | PDFXEdit.IAFS_Name impPath = fsInst.DefaultFileSys.StringToName( "D:\\TestFile_res.pdf" ); |
11 | Doc.CoreDoc.WriteTo(impPath); |
12 | PDFXEdit.IPXC_Inst pxcInst = (PDFXEdit.IPXC_Inst)Inst.GetExtension( "PXC" ); |
13 | PDFXEdit.IPXC_Document resDoc = pxcInst.OpenDocumentFrom(impPath, null ); |
15 | input.Add().v = resDoc; |
16 | PDFXEdit.ICabNode options = Op.Params.Root[ "Options" ]; |
17 | PDFXEdit.ICabNode images = options[ "Images" ]; |
18 | images[ "Enabled" ].v = true ; |
19 | images[ "ReducedOnly" ].v = true ; |
20 | PDFXEdit.ICabNode comp = images[ "Comp" ]; |
21 | comp[ "Color.JPEGQuality" ].v = 0; |
22 | comp[ "Grayscale.JPEGQuality" ].v = 0; |
25 | resDoc.WriteTo(impPath); |