ImageEn, unit iexHelperFunctions |
|
IECreatePDFFromFileList
Declaration
function IECreatePDFFromFileList(const sDestFilename : string;
ssFileList : TStrings;
const aPaperSize : TIOPDFPaperSize;
const aCompression : TIOPDFCompression;
const sTitle : string;
const sAuthor : string;
Margins: Integer = 0;
Centered: Boolean = False;
ShrinkOnly: Boolean = False;
FailOnUnsupportedImage: Boolean = True
) : Boolean;
Description
Generates a PDF file from all images specified in a TStrings list, by combining the functions of
CreatePDFFile,
SaveToPDF and
ClosePDFFile.
Result is true unless an error is encountered.
Parameter | Description |
sDestFilename | The .PDF filename to save the file to |
ssFileList | A list of all images to add to the PDF file |
aPaperSize | The size at which to create the PDF file |
aCompression | The level of compression to use |
sTitle | The title for the PDF document (appears in "Properties") |
sAuthor | The author for the PDF document (appears in "Properties") |
Margins | Specifies the size of margins (blank area) on all sides of the page when saving to PDF. Value is in Adobe PDF points (1 point = 1/72 of inch), e.g. 72 would be 1 inch margins |
Centered | Specifies that the image will be centered within the page (instead of positioned at the top-left) |
ShrinkOnly | If not enabled, all images will be made to fill the entire page. If enabled, only large images are shrunk. Small images are not enlarged |
FailOnUnsupportedImage | When true this procedure will fail if unsupported images (or other file types) are found in ssFileList. If false, unsupported file types are skipped |
Note:
◼You must add the iexHelperFunctions unit to your uses clause
◼If the
PDFEngine is ieenDLL, then
PDFium will be used to create the PDF, otherwise native PDF code will be used
ssMyImages := TStringList.Create();
ssMyImages.Add( 'D:\image1.jpg' );
ssMyImages.Add( 'D:\image2.jpg' );
ssMyImages.Add( 'D:\image3.jpg' );
// 1 inch margins and centered images (shrink only)
if IECreatePDFFromFileList( 'D:\MyNewPDF.pdf',
ssMyImages,
iepA4,
ioPDF_JPEG,
'My Cool PDF',
'Mr Developer',
72, True, True ) = False then
raise Exception.create( 'Cannot create PDF' );
ssMyImages.Free();
See Also
◼TImageEnMIO.SaveToFilePDF
◼TImageEnIO.SaveToFilePDF