BCL easyPDF SDK
easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

Optimize Method

Optimizes (reduce file size) a PDF file.

void Optimize(string InputFileName, string OutputFileName, string Password)



Sub Optimize(InputFileName As String, _
             OutputFileName As String, _
             Password As String)

def Optimize(self, InputFileName, OutputFileName, Password)



void Optimize(String InputFileName,
              String OutputFileName,
              String Password) throws PDFProcessorException

function Optimize($InputFileName, $OutputFileName, $Password) 



BclPrcResult Optimize(const BclPDFProcessorSettings* pSettings,
                      const wchar_t* InputFileName,
                      const wchar_t* OutputFileName,
                      const wchar_t* Password);
Sub Optimize(InputFileName As String, _
             OutputFileName As String, _
             [Password])

bepproc +Optimize



Parameters

Return Values

N/A.

Remarks

The file size increases whenever you modify a PDF file (even when you delete pages). When you are done modifying the PDF file, you can use this method to reduce the file size.

Example Usage

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
 
' Delete page 1 and 2
oProcessor.DeletePages "input.pdf", "modified.pdf", 0, 1
 
' Rotate page 5
oProcessor.RotatePages "modified.pdf", "modified.pdf", 4, 4
 
' Optimize PDF file
oProcessor.Optimize "C:\test\modified.pdf", C:\test\optimized.pdf"