Method DrawImage

Namespace
SoftZenPdf
Assembly
SoftZenPdf.dll

DrawImage(PdfImage, double, double, double)

Draws an image at a given width, with the height following its aspect ratio.

public ContentStreamWriter DrawImage(PdfImage image, double x, double y, double width)

Parameters

image PdfImage

The image; each image is embedded once per document however often it is drawn.

x double

Left edge, in points.

y double

Bottom edge, in points.

width double

Width on the page, in points.

Returns

ContentStreamWriter

Exceptions

InvalidOperationException

Called inside a text object, or a CMYK JPEG is drawn in a PDF/A document.

DrawImage(PdfImage, double, double, double, double)

Draws an image stretched to fill a box. EXIF (JPEG) and TIFF orientation is applied, so photos and scans appear upright.

public ContentStreamWriter DrawImage(PdfImage image, double x, double y, double width, double height)

Parameters

image PdfImage

The image; each image is embedded once per document however often it is drawn.

x double

Left edge of the box, in points.

y double

Bottom edge of the box, in points.

width double

Box width, in points.

height double

Box height, in points.

Returns

ContentStreamWriter

Exceptions

InvalidOperationException

Called inside a text object, or a CMYK JPEG is drawn in a PDF/A document.