Skip to content

PDFRendererSettings

Namespace: O2S.Components.PDF4NET.Rendering

Settings class for PDF rendering process.

public class PDFRendererSettings

Inheritance ObjectPDFRendererSettings

Constructors

PDFRendererSettings()

Initializes a new PDFRendererSettings object.

public PDFRendererSettings()

PDFRendererSettings(Double, Double)

Initializes a new PDFRendererSettings object.

public PDFRendererSettings(double dpiX, double dpiY)

Parameters

dpiX Double
Horizontal resolution used for converting the PDF page to image.

dpiY Double
Vertical resolution used for converting the PDF page to image.


PDFRendererSettings(Double, Double, PDFRenderingSurface)

Initializes a new PDFRendererSettings object.

public PDFRendererSettings(double dpiX, double dpiY, PDFRenderingSurface renderingSurface)

Parameters

dpiX Double
Horizontal resolution used for converting the PDF page to image.

dpiY Double
Vertical resolution used for converting the PDF page to image.

renderingSurface PDFRenderingSurface
Surface used for rendering the page content.


Properties

BackgroundColor

Gets or sets the background color of the rendered page.

public int BackgroundColor { get; set; }

Property Value

Int32
The background color of the rendered page.

Remarks

The byte layout of the color components in this color must match the byte layout in the rendering surface. For example if the rendering surface is RGBA then this color must also be specified as RGBA.


DpiX

Gets or sets the horizontal resolution.

public double DpiX { get; set; }

Property Value

Double
Horizontal resolution for rendering a PDF page to image.


DpiY

Gets or sets the vertical resolution.

public double DpiY { get; set; }

Property Value

Double
Vertical resolution for rendering a PDF page to image.


EnableRenderingCache

Gets or sets a value indicating whether the rendering cache should be enabled.

public bool EnableRenderingCache { get; set; }

Property Value

Boolean
True if graphic objects should be cached.

Remarks

Increased memory consumption can appear when caching is enabled.


ErrorHandling

Gets of sets a value specifying how the rendering errors are handled.

public PDFRenderingErrorHandling ErrorHandling { get; set; }

Property Value

PDFRenderingErrorHandling
A PDFRenderingErrorHandling value.


FontSubstitution

Gets or sets the font substitution rules.

public PDFFontSubstitution FontSubstitution { get; set; }

Property Value

PDFFontSubstitution
A PDFFontSubstitution object specifying how fonts are substituted when rendering the PDF file.


ImageOptions

Gets the options for rendering images.

public PDFRendererImageOptions ImageOptions { get; }

Property Value

PDFRendererImageOptions
A PDFRendererImageOptions object specifying how the images embedded in PDF pages should be rendered in the output image.


InfoDpiX

Gets or sets the horizontal resolution of the output TIFF image.

public double InfoDpiX { get; set; }

Property Value

Double
Horizontal resolution that will be written in the output TIFF image.

Remarks

This property is used only when converting PDF pages to TIFF images. The resolution used for conversion is the one specified in PDFRendererSettings.DpiX and PDFRendererSettings.DpiY values.
This PDFRendererSettings.InfoDpiX value will be written in the TIFF file if you need that value to be different from the one used for conversion.


InfoDpiY

Gets or sets the vertical resolution of the output TIFF image.

public double InfoDpiY { get; set; }

Property Value

Double
Vertical resolution that will be written in the output TIFF image.

Remarks

This property is used only when converting PDF pages to TIFF images. The resolution used for conversion is the one specified in PDFRendererSettings.DpiX and PDFRendererSettings.DpiY values.
This PDFRendererSettings.InfoDpiY value will be written in the TIFF file if you need that value to be different from the one used for conversion.


LayerRenderTarget

Gets or sets the rendering target for content included in PDF layers (optional content).

public PDFLayerRenderTarget LayerRenderTarget { get; set; }

Property Value

PDFLayerRenderTarget
A PDFLayerRenderTarget enum member specifying how the layer content is handled during PDF to image conversion.


OutputImageSize

Gets or sets the size of the output image.

public PDFSize OutputImageSize { get; set; }

Property Value

PDFSize
A object specifying the size of the output image.

Remarks

By default the size of the output image is determined by the PDFRendererSettings.DpiX and PDFRendererSettings.DpiY properties. When this property is set, the PDFRendererSettings.DpiX and PDFRendererSettings.DpiY properties are ignored.


RenderAnnotations

Gets or sets the value indicating whether the page annotations should be rendered.

public bool RenderAnnotations { get; set; }

Property Value

Boolean
True if the page annotations should be rendered, false otherwise.

Remarks

When converting a PDF page to image, the page annotations on the page can be removed from rendering if this property is set to true. Widget annotations (form fields) are not affected by this property, they are removed from rendering when PDFRendererSettings.RenderFormFields property is set to false.


RenderArea

Gets or sets the rendering area.

public PDFDisplayRectangle RenderArea { get; set; }

Property Value

PDFDisplayRectangle
A object specifying the area on the page to be rendered as image.

Remarks

If this property is null then the page's CropBox is used as render area.
The rectangle specified in this property can have arbitrary values allowing to render any parts of the page, including parts outside the visible area.


RenderFormFields

Gets or sets the value indicating whether the form fields should be rendered.

public bool RenderFormFields { get; set; }

Property Value

Boolean
True if the form fields should be rendered, false otherwise.

Remarks

When converting a PDF page to image, the form fields on the page can be removed from rendering if this property is set to true.


RenderGraphics

Gets or sets the value indicating whether the vector graphics should be rendered.

public bool RenderGraphics { get; set; }

Property Value

Boolean
True if the vector graphics should be rendered, false otherwise.

Remarks

When converting a PDF page to image, the vector graphics on the page can be removed from rendering if this property is set to true.


RenderImages

Gets or sets the value indicating whether the images should be rendered.

public bool RenderImages { get; set; }

Property Value

Boolean
True if the images should be rendered, false otherwise.

Remarks

When converting a PDF page to image, the images on the page can be removed from rendering if this property is set to true. This property removes from rendering both regular images and image masks.


RenderingSurface

Gets or sets the rendering surface.

public PDFRenderingSurface RenderingSurface { get; set; }

Property Value

PDFRenderingSurface
The surface on which the PDF page is rendered.

Remarks

If no rendering surface is provided a default RGBA surface is created.


RenderText

Gets or sets the value indicating whether the text should be rendered.

public bool RenderText { get; set; }

Property Value

Boolean
True if the text should be rendered, false otherwise.

Remarks

When converting a PDF page to image, the text on the page can be removed from rendering if this property is set to true.


RenderThreadCount

Gets or sets the number of threads used for rendering. The number of threads to be used for rendering the page.This property lets you speed up the page rendering processed by using multiple threads. Accepted values are 1 (single threaded, default rendering mode), 2 and 4.

public int RenderThreadCount { get; set; }

Property Value

Int32


SnapRectanglesToGrid

Gets or sets a value indicating whether the rendered rectangles should be aligned to pixel grid.

public bool SnapRectanglesToGrid { get; set; }

Property Value

Boolean
True if the rectangles should be aligned to pixel grid.