TransformFile

Document manipulation, Miscellaneous functions

Description

Applies a transformation to a file allowing objects to be renumbered and reordered.

In certain cases this can result in a more compact cross reference table reducing the size of the PDF.

Syntax

Delphi

function TPDFlib.TransformFile(Const InputFileName, Password, OutputFileName: WideString; TransformType, Options: Integer): Integer;

ActiveX

Function PDFlib::TransformFile(InputFileName As String, Password As String, OutputFileName As String, TransformType As Long, Options As Long) As Long

DLL

int DLTransformFile(int InstanceID, wchar_t * InputFileName, wchar_t * Password, wchar_t * OutputFileName, int TransformType, int Options);

Parameters

InputFileNameThe path and file name of the input PDF to transform.
PasswordThe optional password to open the input PDF if it is encrypted
OutputFileNameThe path and file name of the signed PDF that should be created. This should be different to InputFileName.
TransformType1 = Renumber all objects writing them out in order 2 = Same as 1 but uses an xref stream
OptionsReserved for future use, should be set to zero.

Return values

1Success 2 Input PDF not found 3 Input PDF cannot be read 4 Input PDF password incorrect 5 Could not write output file int TransformType, int Options);