Table of Contents

Class FeatureAndSnippetBase

Namespace
PdfSharp.Quality
Assembly
PdfSharp.Quality-gdi.dll

Base class with common code for both features and snippets.

public abstract class FeatureAndSnippetBase
Inheritance
FeatureAndSnippetBase
Derived
Inherited Members

Constructors

FeatureAndSnippetBase()

Initializes a new instance of the FeatureAndSnippetBase class.

protected FeatureAndSnippetBase()

Fields

BoxHeight

The height of the drawing box in presentation units.

public const double BoxHeight = 144

Field Value

double

BoxWidth

The width of the drawing box in presentation units.

public const double BoxWidth = 224

Field Value

double

HeightInMillimeter

The height of the PDF page in millimeter.

public const double HeightInMillimeter = 169.33333333333334

Field Value

double

HeightInPU

The width of the PDF page in presentation units.

public const double HeightInPU = 640

Field Value

double

HeightInPoint

The height of the PDF page in point.

public const double HeightInPoint = 480

Field Value

double

WidthInMillimeter

The width of the PDF page in millimeter.

public const double WidthInMillimeter = 127

Field Value

double

WidthInPU

The width of the PDF page in presentation units.

public const double WidthInPU = 480

Field Value

double

WidthInPoint

The width of the PDF page in point.

public const double WidthInPoint = 360

Field Value

double

Properties

BoxCenter

The center of the box.

public XPoint BoxCenter { get; }

Property Value

XPoint

ComparisonBytes

Gets the bytes of a comparision document.

public byte[] ComparisonBytes { get; }

Property Value

byte[]

Document

Gets the current PDF document.

public PdfDocument Document { get; }

Property Value

PdfDocument

Graphics

Gets the current GDI+ graphics object.

public Graphics Graphics { get; }

Property Value

Graphics

Gray

Gets the gray background brush for boxes.

protected XSolidBrush Gray { get; }

Property Value

XSolidBrush

Image

Gets the current GDI+ image object.

public Image Image { get; }

Property Value

Image

Page

Gets the current PDF page.

public PdfPage Page { get; }

Property Value

PdfPage

PdfBytes

Gets the bytes of a PDF document.

public byte[]? PdfBytes { get; }

Property Value

byte[]

PdfSharpTechnology

Gets a tag that specifies the PDFsharp build technology. It is either 'core', 'gdi', or 'wpf'.

public static string PdfSharpTechnology { get; }

Property Value

string

PngBytes

Gets the bytes of a PNG image.

public byte[] PngBytes { get; }

Property Value

byte[]

XGraphics

Gets the current PDFsharp graphics object.

public XGraphics XGraphics { get; }

Property Value

XGraphics

Methods

BeginImage()

Prepares new bitmap image for drawing.

public void BeginImage()

BeginPdfDocument()

Creates a new PDF document.

public void BeginPdfDocument()

BeginPdfPage()

Creates a new page in the current PDF document.

public XGraphics BeginPdfPage()

Returns

XGraphics

BeginPdfPage(XUnit, XUnit, XGraphicsUnit, XPageDirection)

Creates a new page in the current PDF document.

public XGraphics BeginPdfPage(XUnit width, XUnit height, XGraphicsUnit graphicsUnit, XPageDirection pageDirection = XPageDirection.Downwards)

Parameters

width XUnit
height XUnit
graphicsUnit XGraphicsUnit
pageDirection XPageDirection

Returns

XGraphics

EndPdfDocument()

Ends access to the current PDF document and renders it to a memory stream.

public void EndPdfDocument()

EndPdfPage()

Ends the current PDF page.

public void EndPdfPage()

EndPngImage()

Ends the current GDI+ image.

public void EndPngImage()

GenerateParallelComparisonDocument()

Generates a PDF document for parallel comparison of two render results.

public void GenerateParallelComparisonDocument()

GenerateSerialComparisonDocument()

Generates the serial comparison document. DOCTODO

public void GenerateSerialComparisonDocument()

SaveAndShowComparisonDocument(string, bool)

Saves and shows a parallel comparison PDF document.

[Obsolete("Use a XxxUtility class.")]
public string SaveAndShowComparisonDocument(string filepath, bool startViewer = false)

Parameters

filepath string

The filepath.

startViewer bool

if set to true [start viewer].

Returns

string

SaveAndShowFile(byte[]?, string, bool)

Saves the bytes to PDF file and show file.

public string SaveAndShowFile(byte[]? sourceBytes, string filepath = "", bool startViewer = false)

Parameters

sourceBytes byte[]

The source bytes.

filepath string

The filepath.

startViewer bool

if set to true [start viewer].

Returns

string

Exceptions

ArgumentNullException

sourceBytes

SaveAndShowPdfDocument(string, bool)

Saves and optionally shows a PDF document.

[Obsolete("Use a XxxUtility class.")]
public string SaveAndShowPdfDocument(string filepath, bool startViewer = false)

Parameters

filepath string

The filepath.

startViewer bool

if set to true [start viewer].

Returns

string

SaveAndShowPngImage(string, bool)

Saves and optionally shows a PNG image.

[Obsolete("Use a XxxUtility class.")]
public string SaveAndShowPngImage(string filepath, bool startViewer = false)

Parameters

filepath string

The filepath.

startViewer bool

if set to true [start viewer].

Returns

string

SaveStreamToFile(Stream, string)

Saves a stream to a file.

[Obsolete("Use a XxxUtility class.")]
public void SaveStreamToFile(Stream stream, string path)

Parameters

stream Stream

The stream.

path string

The path.