PdfHtmlImageElement Class

Represents HTML content rendered as an image in a PDF document. The HTML is converted to an image by the HTML to Image converter of the element, at the resolution given by the Resolution property, and the image is drawn at the size the HTML content has on screen, one CSS pixel being 0.75 points, scaled down when it is wider than the available width. The image keeps that size at any resolution, so a higher resolution gives a sharper image in the PDF document. An image taller than the space left on the page continues on the next pages by default. The element is rendered with AddHtmlImage(PdfHtmlImageElement) in a document being created or with AddHtmlImage(Int32, PdfHtmlImageElement) in an edited document

Definition

Namespace: EvoPdf.Next
Assembly: EvoPdf.Next (in EvoPdf.Next.dll) Version: 15.0.0
C#
public class PdfHtmlImageElement
Inheritance
Object    PdfHtmlImageElement

Constructors

PdfHtmlImageElement(String) Creates an element that renders the HTML document from a URL as an image
PdfHtmlImageElement(String, String) Creates an element that renders an HTML string as an image

Properties

Accessibility Accessibility metadata used when the host document is tagged. The default structure type of the image is Figure and PDF/UA requires a non-empty AlternateText or ActualText. Set StructureType to Artifact to mark a purely decorative image
BaseUrl The base URL of the HTML code, or null
ContinuationBottomMargin In a PdfEditor, the distance in points from the bottom of the pages to the lowest point the image can reach on each page, starting with the page where it starts. Has no effect in a PdfDocument, where the bottom margin of the document applies. The default value is 0
ContinuationTopMargin In a PdfEditor, the distance in points from the top of the pages where the image continues to the top of the continued image. Has no effect in a PdfDocument, where the top margin of the document applies. The default value is 0
ContinueOnNextPage When true, the default, an image taller than the space left on the page continues on the next pages: the part that does not fit above the bottom margin is drawn on the following page from the top margin, with the same horizontal position and width, and so on until the whole image is drawn. When false the image is drawn on one page and the part outside the page is cut
Converter The converter that renders the HTML content as an image: its viewer width, JavaScript, navigation, authentication and resolution settings apply to the rendering. The converter is set to capture the entire page and the image is cut at the height of the HTML content
Height The maximum height of the image in points, or 0 for no limit. An image taller than this value is scaled down to this height, keeping its aspect ratio
HorizontalAlign The horizontal alignment of the image in the content area of the page. When it is not None it takes precedence over X
Html The HTML code to render, or null when the element renders the HTML document from a URL
InsertContinuationPages In a PdfEditor, when true, the pages where the image continues are inserted after the page where it starts, so the following pages of the document keep their content. When false, the default, the image continues on the following pages of the document and new pages are added only at its end. Has no effect in a PdfDocument, where the image continues on new pages
Opacity The opacity of the image, from 0 to 1. The default value is 1, fully opaque
Resolution The resolution of the image in DPI, from 1 to 1200. The default value is 96, one image pixel for each CSS pixel. The image has the same size in the PDF document at any resolution, so a higher resolution gives a sharper image, with more pixels for the same content, at the cost of a larger PDF file. The property is the Resolution property of the Converter
Url The URL of the HTML document, or null when the element renders an HTML string
Width The width of the image in points. When it is 0, the default, the image has the width of the HTML content on screen, one CSS pixel being 0.75 points, and it is scaled down to the width available from X to the right margin when it is wider than that
X The X position of the image, in points and relative to the top left corner of the content area of the page, inside the margins of a document being created, or to the top left corner of the page of an edited document. The image keeps this left offset on the next pages
Y The Y position of the image, in points and relative to the top left corner of the content area of the page, inside the margins of a document being created, or to the top left corner of the page of an edited document. On the next pages the image continues from the top margin of the document, or from ContinuationTopMargin in an edited document

Methods

Equals
(Inherited from Object)
Finalize
(Inherited from Object)
GetHashCode
(Inherited from Object)
GetType
(Inherited from Object)
MemberwiseClone
(Inherited from Object)
ToString
(Inherited from Object)

See Also