menu

Document Processing

PdfImageInfo Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfImageInfo Class

    Represents the utility class to store information about Images and its location.

    Inheritance
    System.Object
    PdfImageInfo
    Namespace: Syncfusion.Pdf.Exporting
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfImageInfo : Object
    Examples
    //Load PDF document.
    PdfLoadedDocument document = new PdfLoadedDocument("Input.pdf");
    //Gets ImageInfo from the first page.
    PdfImageInfo[] imageInfo = document.Pages[0].ImagesInfo;
    //Gets the Image Boundary location.
    RectangleF imageBounds = imageInfo[0].Bounds;
    //Gets the Image.
    Image image = imageInfo[0].Image;
    //Gets the Image index.
    int imageIndex = imageInfo[0].Index;
    //Closing the PDF document.
    document.Close(true);
    'Load PDF document.
    Dim document As New PdfLoadedDocument("Input.pdf")
    'Gets ImageInfo from the first page.
    Dim imageInfo As PdfImageInfo() = document.Pages(0).ImagesInfo
    'Gets the Image Boundary location.
    Dim imageBounds As RectangleF = imageInfo(0).Bounds
    'Gets the Image.
    Dim image As Image = imageInfo(0).Image
    'Gets the Image index.
    Dim imageIndex As Integer = imageInfo(0).Index
    'Closing the PDF document.
    document.Close(True)

    Properties

    Bounds

    Gets the image boundary location.

    Declaration
    public RectangleF Bounds { get; }
    Property Value
    Type
    System.Drawing.RectangleF

    Image

    Gets the Image.

    Declaration
    public Image Image { get; }
    Property Value
    Type
    System.Drawing.Image

    Index

    Gets the Image index.

    Declaration
    public int Index { get; }
    Property Value
    Type
    System.Int32

    IsImageInterpolated

    Returns true, when the image property in the PDF document is set to undergo interpolation.

    Declaration
    public bool IsImageInterpolated { get; }
    Property Value
    Type
    System.Boolean

    IsImageMasked

    Returns true, if image masking is applied. Set to true when the image is undergone image masking.

    Declaration
    public bool IsImageMasked { get; }
    Property Value
    Type
    System.Boolean

    IsSoftMasked

    Returns true, if soft masking is applied. Set to true when the image is undergone soft masking.

    Declaration
    public bool IsSoftMasked { get; }
    Property Value
    Type
    System.Boolean

    Metadata

    Gets XMP metadata of the image.

    Declaration
    public XmpMetadata Metadata { get; }
    Property Value
    Type
    XmpMetadata
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Load the image from the disk with enable metadata extraction.
    PdfBitmap image = new PdfBitmap(File.OpenRead("Autumn Leaves.jpg"), true);
    //Get image metadata
    XmpMetadata metadata = image.Metadata;
    //Draw the image
    graphics.DrawImage(image, 0, 0);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Load the image from the disk with enable metadata extraction.
    Dim image As New PdfBitmap(File.OpenRead("Autumn Leaves.jpg"), true)
    'Get image metadata
     Dim metadata As XmpMetadata = image.Metadata
    'Draw the image
    graphics.DrawImage(image, 0, 0)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved