PDFPAGE_ShowImage
IPDFDocument3 :: PDF page methods

See Also Example
Collapse All

This method draws an image in a PDF document.

Syntax

HRESULT PDFPAGE_ShowImage (
LONG imageIndex,
DOUBLE left,
DOUBLE top,
DOUBLE width,
DOUBLE height,
DOUBLE angle
)
Parameters
imageIndex
Index of an existing image

left
X coordinate of the image location

top
Y coordinate of the image location

width
Width of the image

height
Height of the image

angle
Angle to rotate the image

Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Remarks

The method places the image data at the specified size (width, height) with one corner at (left, top), and an angle, specified in degrees (positive values for counterclockwise rotation), into the current content stream for the page. imageIndex is returned by any image loading method, like AddImageFromFilename.

Equivalent in new interface: IPDFDocument4::ShowImage, IPDFDocument4::DrawImage.

Example

How to Show an Image

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
j := PDF.AddImageFromFile('picture.jpg');
PDF.PDFPAGE_ShowImage(j, 200, 0, 122, 89, 0);
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
LONG j = PDF->AddImageFromFile("picture.jpg");
PDF->PDFPAGE_ShowImage(j, 200, 0, 122, 89, 0);
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
long j = PDF.AddImageFromFile("picture.jpg");
PDF.PDFPAGE_ShowImage(j, 200, 0, 122, 89, 0);
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc
j = PDF.AddImageFromFile("picture.jpg")
PDF.PDFPAGE_ShowImage j, 200, 0, 122, 89, 0
PDF.EndDoc

See Also

Reference