| ImageMaskExtract Method |
Extract image mask from PDF
Facilitate the extraction of image masks from a specified page within a PDF, outputting them in the imageType format.
By default imageType takes the value Tiff.
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 mask.
-
In instances where a GenericException error arises, the output file may be compromised and rendered unusable.
This method is designed to efficiently retrieve image masks without their page-specific modifications, ensuring a straightforward extraction process.
Namespace: PdfTools.FourHeights.PdfToolbox.Pdf.ContentAssembly: PdfTools.FourHeights.PdfToolbox (in PdfTools.FourHeights.PdfToolbox.dll) Version: 4.4.6+c8104d9b5f50644b2c93d424e62edbf40828fde7
Syntax public void Extract(
Stream stream,
ImageType? imageType = null
)
Parameters
- stream Stream
-
The image mask data stream.
- imageType NullableImageType (Optional)
Exceptions Exception | Condition |
---|
ArgumentException | if the stream argument is null |
InvalidOperationException | if the image has already been closed |
GenericException | if image extraction fails |
ArgumentNullException | if stream is . |
See Also