AddImageFromBLOB
IPDFDocument4 :: Images

See Also Example
Collapse All

This method adds an image from a BLOB (binary large object) into a PDF document's collection and returns the index of the added image. Supported image formats: BMP, GIF, JPEG, PNG, TIFF.

Syntax

LONG AddImageFromBLOB (
VARIANT* image
)
Parameters
image
Image object (binary data)

Return value
Index of the new image. If there is more than one image in a BLOB, then the method returns the index of the most recently added image.

Remarks

The return value is an image identifier in the document's images collection and can be used in GetImageHeight, GetImageResolution, GetImageWidth, TransformImage, ShowImage, DrawImage.

Example

Adding an Image from a BLOB

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
{ VARIANT imgData is containing an image data }
{ from Database or else... }
ind := PDF.AddImageFromBLOB(imgData);
PDF.ShowImage(ind, 0, 0);
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
// VARIANT imgData is containing an image data
// from Database or else...
long ind = PDF->AddImageFromBLOB(imgData);
PDF->ShowImage(ind, 0, 0);
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
// object imgData is containing an image data
// from Database or else...
long ind = PDF.AddImageFromBLOB(imgData);
PDF.ShowImage(ind, 0, 0);
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
' VARIANT imgData is containing an image data
' from Database or else...
ind = PDF.AddImageFromBLOB(imgData)
PDF.ShowImage ind, 0, 0
PDF.SaveToFile "test.pdf", true

See Also

Reference