Click or drag to resize
Pdftools logo

Image Methods

The Image type exposes the following members.

Methods
 NameDescription
Public methodStatic memberCreate

Create an image object from image data.

Supported formats are:
  • BMP
  • DIB
  • JPEG
  • JPEG2000
  • JBIG2
  • PNG
  • GIF
The returned image object is not yet painted on any page, but it is associated with the given target document.
Public methodEquals
(Inherited from NativeObject)
Public methodExtract

Extract embedded image from PDF

Facilitate the extraction of images from a specified page within a PDF, outputting them in the imageType format.

By default, the method determines the format of the extracted image based on the embedded image data present within the PDF. Users can ascertain the default image format through DefaultImageType. It's important to note that not all image types or conversion processes are universally supported, hence adhering to the default ImageType is advisable for optimal compatibility.

Key considerations include:

  • The extraction process isolates the image from the page's resources, neglecting any contextual attributes from the PDF page. Consequently, the original resolution and modifications—such as scaling, rotation, or cropping—that influence the image's appearance on the page are not preserved in the extracted image.
  • In instances where a GenericException error arises, the output file may be compromised and rendered unusable.

This method is designed to efficiently retrieve images without their page-specific modifications, ensuring a straightforward extraction process.

Public methodGetHashCode
(Inherited from NativeObject)
Public methodRedact

Redact rectangular part of the image

Redacts a part of the image specified by a rectangle, by changing the content of the image. This is not an annotation, the image data is changed and there will be no way to get the original data from the image itself. The content is changed by setting all pixels to the same color. This color, in general, is black, but that depends on the color space of the image.
Top
See Also