ImageEn, unit imageenio

TImageEnIO.SaveToFilePDF

TImageEnIO.SaveToFilePDF


Declaration


procedure SaveToFilePDF(const FileName: WideString);


Description


Saves the current image or layers to a file in Adobe PDF format.
FileName is the file name including extension.

The following TIELayer features are not supported when exporting to PDF:
- Gradient fills
- Mask layers

Notes:
- The created file will have only one page. See CreatePDFFile to create multi-page PDF files.
- If an internal save error is encountered Aborting will return true. Saving issues due to insufficient write permissions and disk write failures will raise an exception.


Example 1


// Convert a BMP image to PDF
ImageEnView1.IO.LoadFromFile('C:\input.bmp');
ImageEnView1.IO.SaveToFilePDF('D:\output.pdf');


Example 2


// Create a scalable PDF document containing text and a shape

ImageEnView1.Blank;

// Add a yellow explosion shape layer at size 220 x 120
ImageEnView1.LayersAdd( iesExplosion, 50, 50, 220, 120 );
ImageEnView1.CurrentLayer.FillColor := clYellow;
ImageEnView1.CurrentLayer.BorderWidth := 0;

// Add a text layer
ImageEnView1.LayersAdd( ielkText );
ImageEnView1.LayersAdd( 'This is an Explosion', 42, clRed, 'Arial Black', [fsBold] );
ImageEnView1.CurrentLayer.PosX := IELayer_Pos_HCenter;
ImageEnView1.CurrentLayer.PosY := IELayer_Pos_VCenter;
ImageEnView1.Update();

// Save it
ImageEnView1.IO.SaveToFilePDF('D:\Explosion.pdf');