Adds an image to the current page returning the ID of the newly
added object.
Images embedded using this method are always inserted using pass-through mode.
Pass-through mode is faster than indirect mode. It allows
the preservation of compression settings, native color spaces and
ICC color profiles. It allows vector graphics to be maintained in
vector format. However it supports a limited range of image formats
- JPEG, JPEG 2000, TIFF, EMF, WMF, PS (PostScript) or EPS
(Encapsulated PostScript). JPEG images may be grayscale, RGB or CMYK. TIFF images may be black and white, grayscale, RGB, CMYK, TIFF or Lab in a range of bit depths and with out without alpha. Because PDF does not support 32 bit High Dynamic Range (HDR) encodings, TIFFs in this format will be downsampled to 16 bits per component.
Note that not all EMF or WMF files can be directly imported this
way. If this is the case you should look at using the XImage object. Using the XImage
object with the default ReadModule is fast but will result in the
image being rasterized. Using the XpsAny ReadModule will not be as
fast but will preserve the vector nature of practically all such
files.
The image is scaled to fill the current Rect. It is transformed using
the current Transform.
Transparency. Occasionally you may find that you
need to invert the transparency of your image. To do this you
can assign a decode array using the ID returned from this
function.
To invert the transparency:
theDoc.SetInfo(theDoc.GetInfoInt(theID, "XObject"),
"/SMask*/Decode", "[1 0]")
A similar technique can be used for inverting or altering
color levels on the image itself.
To invert an RGB image:
theDoc.SetInfo(theDoc.GetInfoInt(theID, "XObject"),
"/Decode", "[1 0 1 0 1 0]")
|
|
|
|