PdfRenderOptions Class

The options of PdfRenderer.

public sealed class PdfRenderOptions

Constructors

NameDescription
PdfRenderOptions()

PdfRenderOptions()

PdfRenderOptions.cs
public PdfRenderOptions()

No documentation is available.

Properties

NameDescription
BackgroundGets or initializes the color the page is painted on before its content; null for a transparent background.
ConfigurationGets or initializes the configuration of the image the page is rendered to: its limits and allocation scope.
DefaultGets the default options: 72 dots per inch, a white background, the annotations, the system fonts.
DpiGets or initializes the resolution, in dots per inch: 72 renders one pixel per point.
FontResolverGets or initializes the font that replaces a font the document does not embed. When it is null or returns null, a standard font is replaced by a bundled font of the same widths, another font by a font of the system, else by a bundled font of its kind.
HeightGets or initializes the height of the image, in pixels: the resolution is the one that gives the region (the crop box by default, turned by the rotation of the page) this height, instead of PdfRenderOptions.Dpi. With PdfRenderOptions.Width, the region is fitted inside both, keeping its proportions.
IntentGets or initializes the purpose of the rendering: it selects the annotations drawn (the Print, NoView and Hidden flags) and the optional content that the usage of its groups turns on or off.
MaxOperationsGets or initializes the work a page may do: the operators of its content and of the forms, patterns and glyphs it paints, a content stream being able to paint the others many times.
OptionalContentConfigurationGets or initializes the name (/Name) of the optional content configuration of the document that sets which layers are visible (ISO 32000-2, 8.11.4.3); null, or a name the document does not have, for the default configuration.
OptionalContentGroupStatesGets or initializes the visibility of optional content groups (layers) that replaces the one of the configuration: the keys are the names of the groups (/Name), and every group of a name is turned on or off.
PathAntialiasingGets or initializes whether the edges of the paths, the images and the shadings are antialiased; false draws them with hard edges.
RegionGets or initializes the region of the page rendered, in the default user space of the page (the coordinates of its boxes); null for the crop box. The region is intersected with the media box, and the image is turned by the /Rotate of the page as the whole page would be.
RenderAnnotationsGets or initializes whether the appearances of the annotations are drawn (ISO 32000-2, 12.5.5).
TextAntialiasingGets or initializes whether the edges of the glyphs of the text are antialiased; false draws them with hard edges.
UseHalftonesGets or initializes whether the halftones of the document (/HT and /HTO of the graphics states, ISO 32000-2, 10.6) are applied, as a printer that turns each color component fully on or off would apply them: the red, green and blue components of the colors an opaque object paints are compared with the thresholds of the screen of the halftone, in the pixels of the image. The default halftone leaves the colors as they are. When false (the default), the halftones are ignored, as viewers do for a screen.
UseSystemFontsGets or initializes whether the fonts of the system replace the fonts the document does not embed and that are not standard fonts. When it is false, they are replaced by the bundled fonts.
WidthGets or initializes the width of the image, in pixels: the resolution is the one that gives the region (the crop box by default, turned by the rotation of the page) this width, instead of PdfRenderOptions.Dpi. With PdfRenderOptions.Height, the region is fitted inside both, keeping its proportions.

Gets or initializes the color the page is painted on before its content; null for a transparent background.

public Rgba32? Background { get; init; }

Property value

Rgba32?

Configuration

PdfRenderOptions.cs

Gets or initializes the configuration of the image the page is rendered to: its limits and allocation scope.

public ImageConfiguration? Configuration { get; init; }

Property value

ImageConfiguration?

Gets the default options: 72 dots per inch, a white background, the annotations, the system fonts.

public static PdfRenderOptions Default { get; }

Property value

PdfRenderOptions

Gets or initializes the resolution, in dots per inch: 72 renders one pixel per point.

public double Dpi { get; init; }

Property value

double

Gets or initializes the font that replaces a font the document does not embed. When it is null or returns null, a standard font is replaced by a bundled font of the same widths, another font by a font of the system, else by a bundled font of its kind.

public Func<PdfFontRequest, FontFace?>? FontResolver { get; init; }

Gets or initializes the height of the image, in pixels: the resolution is the one that gives the region (the crop box by default, turned by the rotation of the page) this height, instead of PdfRenderOptions.Dpi. With PdfRenderOptions.Width, the region is fitted inside both, keeping its proportions.

public int? Height { get; init; }

Property value

int?

Gets or initializes the purpose of the rendering: it selects the annotations drawn (the Print, NoView and Hidden flags) and the optional content that the usage of its groups turns on or off.

public PdfRenderIntent Intent { get; init; }

Property value

PdfRenderIntent

MaxOperations

PdfRenderOptions.cs

Gets or initializes the work a page may do: the operators of its content and of the forms, patterns and glyphs it paints, a content stream being able to paint the others many times.

public long MaxOperations { get; init; }

Property value

long

OptionalContentConfiguration

PdfRenderOptions.cs

Gets or initializes the name (/Name) of the optional content configuration of the document that sets which layers are visible (ISO 32000-2, 8.11.4.3); null, or a name the document does not have, for the default configuration.

public string? OptionalContentConfiguration { get; init; }

Property value

string?

OptionalContentGroupStates

PdfRenderOptions.cs

Gets or initializes the visibility of optional content groups (layers) that replaces the one of the configuration: the keys are the names of the groups (/Name), and every group of a name is turned on or off.

public IReadOnlyDictionary<string, bool>? OptionalContentGroupStates { get; init; }

PathAntialiasing

PdfRenderOptions.cs

Gets or initializes whether the edges of the paths, the images and the shadings are antialiased; false draws them with hard edges.

public bool PathAntialiasing { get; init; }

Property value

bool

Gets or initializes the region of the page rendered, in the default user space of the page (the coordinates of its boxes); null for the crop box. The region is intersected with the media box, and the image is turned by the /Rotate of the page as the whole page would be.

public PdfRectangle? Region { get; init; }

Property value

PdfRectangle?

RenderAnnotations

PdfRenderOptions.cs

Gets or initializes whether the appearances of the annotations are drawn (ISO 32000-2, 12.5.5).

public bool RenderAnnotations { get; init; }

Property value

bool

TextAntialiasing

PdfRenderOptions.cs

Gets or initializes whether the edges of the glyphs of the text are antialiased; false draws them with hard edges.

public bool TextAntialiasing { get; init; }

Property value

bool

Gets or initializes whether the halftones of the document (/HT and /HTO of the graphics states, ISO 32000-2, 10.6) are applied, as a printer that turns each color component fully on or off would apply them: the red, green and blue components of the colors an opaque object paints are compared with the thresholds of the screen of the halftone, in the pixels of the image. The default halftone leaves the colors as they are. When false (the default), the halftones are ignored, as viewers do for a screen.

public bool UseHalftones { get; init; }

Property value

bool

Remarks

The screens are in the pixels of the image, so the result depends on the resolution. Turn PdfRenderOptions.PathAntialiasing and PdfRenderOptions.TextAntialiasing off to get only fully on or off components.

UseSystemFonts

PdfRenderOptions.cs

Gets or initializes whether the fonts of the system replace the fonts the document does not embed and that are not standard fonts. When it is false, they are replaced by the bundled fonts.

public bool UseSystemFonts { get; init; }

Property value

bool

Gets or initializes the width of the image, in pixels: the resolution is the one that gives the region (the crop box by default, turned by the rotation of the page) this width, instead of PdfRenderOptions.Dpi. With PdfRenderOptions.Height, the region is fitted inside both, keeping its proportions.

public int? Width { get; init; }

Property value

int?