Method EmbedData

Top  Previous  Next

The method: EmbedData can be used to embed binary data into a PDF file.

 

When the user clicks an open dialog will be displayed by Acrobat Reader.

 

embed

 

 

Parameters:

 

const aName : string; 

This is the name which will be displayed as hint for this object. In the example above "Document.RTF". The name may be 99 chars long.

 

r: TRect;

This is the rectangle where to place the icon for the data. It is measured in canvas coordinates, this means you can use Canvas.StretchDraw( R, SomeImage ) and EmbedData with the same values for "R".

 

In case there is no open page R will be interpreted in 72dpi PDF coordinates and the data will be linked to the last page.

 

Icon : TWPEmElementIcon; 

The Icon to be displayed by AcrobatReader.

 

Possible values are: 

   wpemNone, 

   wpemPushPin,  

   wpemGraph, 

   wpemPaperClip, 

   wpemTag 

 

If you use wpemNone you can draw any image and place the hot spot at the same location.

 

data: TStream;

 

The data to be embedded.

 

compressmode: TWPEmCompressMode; 

 

The compression mode. If you embed already compressed data you should use wpemDontCompress, otherwise use wpemDefault.

 

const FileExtension: string

 

The file extension, for example RTF, ZIP or PNG.