Image

Represents an image.

public class Image : RotatingPageElement, IArea, ICoordinate, ISerializable
Public Class Image
    Inherits RotatingPageElement
    Implements IArea, ICoordinate, ISerializable

Inheritance: ObjectPageElementTaggablePageElementRotatingPageElementImage

Implements: IArea, ICoordinate, ISerializable

Licensing Info

Basic usage of this class is a DynamicPDF Core Suite Essentials feature. However, some properties or methods require full licensing and are noted accordingly. One of the following is required for non-evaluation usage:

Examples

The following example will place an image on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
     
Module MyModule
     		
    Sub Main()
     		
        ' Create a PDF Document
        Dim MyDocument As Document = New Document 
     		
        ' Create a Page and add it to the document
        Dim MyPage As Page = New Page
        MyDocument.Pages.Add(MyPage)
     
        ' Create an image
        Dim MyImage As Image = New Image("C:\MyImage.jpg", 0, 0)
     
        ' Add the image to the page
        MyPage.Elements.Add(MyImage)
     
        ' Save the PDF
        MyDocument.Draw("C:\MyDocument.pdf")
     		
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

public class Example
{
    public static void CreatePDF(string outputPath, string imagePath)
    {
        // Create a PDF Document
        Document document = new Document();

        // Create a Page and add it to the document
        Page page = new Page();
        document.Pages.Add(page);

        // Create an image
        Image image = new Image(imagePath, 0, 0);

        // Add the image to the page
        page.Elements.Add(image);

        // Save the PDF
        document.Draw(outputPath);
    }
}

Remarks

This class can be used to place images on a page. If an image will be used more than once, please see the Image Reuse topic.

Constructors

Image(Byte[], Single, Single, Single?)Initializes a new instance of the Image class.
Image(ImageData, Single, Single)Initializes a new instance of the Image class.
Image(ImageData, Single, Single, Single)Initializes a new instance of the Image class.
Image(Stream, Single, Single, Single)Initializes a new instance of the Image class.
Image(String, Single, Single)Initializes a new instance of the Image class.
Image(String, Single, Single, Single)Initializes a new instance of the Image class.

Properties

AlignGets or sets the Align enumeration that specifies horizontal alignment of the image on the X coordinate.
AlternateTextGets or sets the alternate text of the image.
AngleGets or sets the heights of the angle element.
(Inherited from RotatingPageElement)
HeightGets or sets the height of the image.
HorizontalDpiGets or sets the horizontal dpi (also known as pixels per inch) of the image.
IDGets or sets the ID of the page element.
(Inherited from PageElement)
IgnoreMarginsGets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property.
(Inherited from PageElement)
ImageDataGet the image's ImageData object.
RelativeToGets and sets placement of the page element on the page.
(Inherited from PageElement)
ScaleXGets or sets the horizontal scale of the image.
ScaleYGets or sets the vertical scale of the image.
TagGets or sets the tag of the taggable element.
(Inherited from TaggablePageElement)
TagOrderGets or sets the tag order of the taggable element.
(Inherited from TaggablePageElement)
VAlignGets or sets the VAlign enumeration that specifies vertical alignment of the image on the Y coordinate.
VerticalDpiGets or sets the vertical dpi (also known as pixels per inch) of the image.
WidthGets or sets the width of the image.
XGets or sets the X coordinate of the page element.
(Inherited from RotatingPageElement)
YGets or sets the Y coordinate of the page element.
(Inherited from RotatingPageElement)

Methods

Draw(PageWriter)Draws the page element to the given PageWriter object.
(Inherited from RotatingPageElement)
Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
SetBounds(Single, Single)Scales the image to fit in the given box keeping the X and Y scale equal.
SetDpi(Single)Scales the image to have the specified dpi (also known as pixels per inch).
SetDpi(Single, Single)Scales the image to have the specified dpi (also known as pixels per inch).
SetSize(Single, Single)Scales the image to fit the exact width and height given.
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.PageElements

In this topic