Adds an image to the current page returning the ID of the newly
This method supports JPEG, JPEG 2000, TIFF, EMF, WMF, PS
(PostScript) or EPS (Encapsulated PostScript).
Images embedded using this method are inserted using a
restricted range of ReadModules.
For this reason you may wish to prefer the use of the AddImageObject method. AddImageFile is the
equivalent of AddImageObject with
the transparent parameter set to true.
The only difference between AddImageFile and AddImageObject relates to the treatment of
EMF and WMF files. AddImageFile defaults to the EmfVector ReadModule
which means that the vector nature of such files will be preserved.
AddImageObject defaults to the
BasicImage ReadModule which means that such files will be
rasterized. For more details see the ReadModule
The image is scaled to fill the current Rect. It is transformed using the
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]")