menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfBitmap - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfBitmap

    Represents the bitmap images.

    Inheritance
    System.Object
    PdfGraphicsElement
    PdfLayoutElement
    PdfShapeElement
    PdfImage
    PdfBitmap
    Implements
    System.IDisposable
    Inherited Members
    PdfGraphicsElement.Draw(PdfGraphics)
    PdfGraphicsElement.Draw(PdfGraphics, PointF)
    PdfGraphicsElement.Draw(PdfGraphics, Single, Single)
    PdfImage.FromStream(Stream)
    PdfImage.GetPixelSize(Single, Single)
    PdfImage.GetPointSize(Single, Single)
    PdfImage.GetPointSize(Single, Single, Single, Single)
    PdfImage.Height
    PdfImage.HorizontalResolution
    PdfImage.Metadata
    PdfImage.PhysicalDimension
    PdfImage.SetResolution(Single, Single)
    PdfImage.VerticalResolution
    PdfImage.Width
    PdfLayoutElement.add_BeginPageLayout(BeginPageLayoutEventHandler)
    PdfLayoutElement.add_EndPageLayout(EndPageLayoutEventHandler)
    PdfLayoutElement.BeginPageLayout
    PdfLayoutElement.Draw(PdfPage, PointF)
    PdfLayoutElement.Draw(PdfPage, PointF, PdfLayoutFormat)
    PdfLayoutElement.Draw(PdfPage, RectangleF)
    PdfLayoutElement.Draw(PdfPage, RectangleF, PdfLayoutFormat)
    PdfLayoutElement.Draw(PdfPage, Single, Single)
    PdfLayoutElement.Draw(PdfPage, Single, Single, PdfLayoutFormat)
    PdfLayoutElement.EndPageLayout
    PdfLayoutElement.Layout(HtmlToPdfLayoutParams)
    PdfLayoutElement.PdfTag
    PdfLayoutElement.remove_BeginPageLayout(BeginPageLayoutEventHandler)
    PdfLayoutElement.remove_EndPageLayout(EndPageLayoutEventHandler)
    PdfShapeElement.GetBounds()
    PdfShapeElement.Layout(PdfLayoutParams)
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public class PdfBitmap : PdfImage, IPdfWrapper, IDisposable

    Constructors

    PdfBitmap(Stream)

    Creates new PdfBitmap instance.

    Declaration
    public PdfBitmap(Stream stream)
    Parameters
    Type Name Description
    System.IO.Stream stream

    The stream.

    PdfBitmap(Stream, Boolean)

    Initializes a new instance of the PdfBitmap class from the specified file.

    Declaration
    public PdfBitmap(Stream stream, bool enableMetadata)
    Parameters
    Type Name Description
    System.IO.Stream stream

    The data stream used to load the image.

    System.Boolean enableMetadata

    Enable metadata extraction from image

    Remarks

    The file name and path can be relative to the application or an absolute path.

    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.
    MemoryStream ms = new MemoryStream();
    doc.Save(ms);
    //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.
    Dim ms As New MemoryStream()
    doc.Save(ms)
    'Close the document.
    doc.Close(True)

    Methods

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()

    Finalize()

    Releases unmanaged resources and performs other cleanup operations before the PdfBitmap is reclaimed by garbage collection.

    Declaration
    protected override void Finalize()

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved