Adds an image to the current page returning the ID of the newly
added object.
If the width or height of the current rectangle is zero the image
is auto-sized. It is positioned with the bottom left of the image
at the location indicated by the rectangle and the natural dimensions
of the supplied image used to determine the width and height of
the image object.
The table below details the ways in which images can be specified
and the conditions under which the optional Frame and SrcRect parameters
are used.
| Image Specifier |
Notes |
Uses Frame |
Uses SrcRect |
| Image Object |
If the image specifier is an Image
object then the Selection
of the current Frame
is added to the document.
Images from these are embedded using indirect
mode
Indirect mode is not as fast as pass-through
mode. However it allows greater flexibility and the use of
many different image formats.
|
See Notes |
See Notes |
| File Path |
If the image specifier is a string specifying a file path
it is assumed that it represents a JPEG, TIFF, EMF or WMF
file.
Images from these file types are embedded using pass-through
mode.
In general you should only embed JPEG or EMF images using
pass-through mode. Use the Image object to embed other types
of file such as TIFF or BMP.
Note that not all EMF or WMF files can be represented in
terms of PDF vectors. If this is the case you should look
at using the Image object to convert these objects prior to
embedding.
|
Yes |
No |
| URL |
If the image specifier is a string specifying a URL it is
assumed that it represents an HTML file.
For further details see the HTML
Support section of this document.
|
Yes |
No |
| HTML |
If the image specifier is a string and the first character
in the string is an open angle bracket it is assumed that
the string is HTML.
For further details see the
HTML Support section of this document.
|
Yes |
No |
| Raw Data |
If the image specifier is an Array of Bytes it is assumed
that it contains raw JPEG, TIFF, EMF or WMF data.
Images from these file types are embedded using pass-through
mode
In general you should only embed JPEG or EMF images using
pass-through mode. Use the Image object to embed other types
of file such as TIFF or BMP.
Note that not all EMF or WMF files can be represented in
terms of PDF vectors. If this is the case you should look
at using the Image object to convert these objects prior to
embedding.
|
Yes |
No |
| Doc Object |
If the image specifier is a Doc
object then one page of the source document is drawn onto
the current page.
The page to be drawn is indicated by the optional Frame Parameter
and the source rectangle by the optional SrcRect parameter.
|
Yes |
Yes |
| ImageID |
If the image specifier is a number it is assumed that it
is an object ID obtained from a previous call to AddImage.
You can use this facility to add commonly used graphics such
as watermarks. The raw image data is inserted only once which
means that PDF size is greatly reduced.
This facility is only possible with raster images - those
obtained by calling AddImage with an Image Object, a File
Path or Raw Data.
|
No |
No |