ImageEn, unit iepdf

TIEPDFBuilder.SaveToFile

TIEPDFBuilder.SaveToFile


Declaration

procedure SaveToFile(const FileName: WideString;
                     const PDF_Title: String = '';
                     const PDF_Author: String = '';
                     const PDF_Subject: String = '';
                     const PDF_Keywords: String = '';
                     const PDF_Creator: String = '';
                     const PDF_Producer: String = '';
                     CreationDateTime: TDateTime = 0);


Description

Save the current PDF document to a file.

Parameter Description
FileName Full path to save file to
PDF_Title The title of the document
PDF_Author The author of the document
PDF_Subject The subject of the document
PDF_Keywords Keywords for the document
PDF_Creator The creator of the document
PDF_Producer The producer of the document
CreationDateTime The date the file was created. Pass 0 to use the current date


Demos

Demo  Demos\PDF\PDFBuilder2\PDFBuilder2.dpr


Example

// Create our PDF object
pdf := TIEPDFBuilder.Create();

// Add a new page of 595 x 842 (each point is 1/72 of inch, so you are creating a page of 8.26 x 11.69 inches, which is an A4 page)
pdf.AddPage(595, 842);

// Add text to current page, at coordinates (0, 100), using Times-Roman at size 36
pdf.AddText( 0, 100, 'Rotated Text', 36, 'Times-Roman');

// Add filled and stroked text, using transparency
pdf.AddText( 0, 150, 'Filled and stroked text', 36, 'Helvetica-Bold', 0, clGreen, 0.2, clRed, 0.8, iepdfFillStroke);

// Add a shape (line path)
pdf.AddLinePath([DPoint(50, 400), DPoint(300, 600), DPoint(180, 780), DPoint(30, 420)], True, clYellow, 0.7, 4, iepdfRoundCaps, True, clGreen, 0.3);

// Add an ellipse
pdf.AddEllipse(100, 200, 500, 300, clWhite, 0.7, 2, true, clOlive, 0.6);

// Add a semi-opaque image at size 200, 200 (can also specify -1 for one size to maintain the aspect ratio)
pdf.AddImage(0, 0, 200, 200, ImageEnView1.iebitmap, 0, 0.8);

// Repeat above to add further pages...

// Save and free object
pdf.SaveToFile('D:\test.pdf');
pdf.Free();


See Also

SaveToStream