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
imagePdfImageThe image; each image is embedded once per document however often it is drawn.
xdoubleLeft edge, in points.
ydoubleBottom edge, in points.
widthdoubleWidth on the page, in points.
Returns
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
imagePdfImageThe image; each image is embedded once per document however often it is drawn.
xdoubleLeft edge of the box, in points.
ydoubleBottom edge of the box, in points.
widthdoubleBox width, in points.
heightdoubleBox height, in points.
Returns
Exceptions
- InvalidOperationException
Called inside a text object, or a CMYK JPEG is drawn in a PDF/A document.