Class FeatureAndSnippetBase
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
BoxWidth
The width of the drawing box in presentation units.
public const double BoxWidth = 224
Field Value
HeightInMillimeter
The height of the PDF page in millimeter.
public const double HeightInMillimeter = 169.33333333333334
Field Value
HeightInPU
The width of the PDF page in presentation units.
public const double HeightInPU = 640
Field Value
HeightInPoint
The height of the PDF page in point.
public const double HeightInPoint = 480
Field Value
WidthInMillimeter
The width of the PDF page in millimeter.
public const double WidthInMillimeter = 127
Field Value
WidthInPU
The width of the PDF page in presentation units.
public const double WidthInPU = 480
Field Value
WidthInPoint
The width of the PDF page in point.
public const double WidthInPoint = 360
Field Value
Properties
BoxCenter
The center of the box.
public XPoint BoxCenter { get; }
Property Value
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
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
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
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
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
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
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
XUnitheight
XUnitgraphicsUnit
XGraphicsUnitpageDirection
XPageDirection
Returns
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
Returns
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
stringThe filepath.
startViewer
boolif set to
true
[start viewer].
Returns
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
Returns
SaveAndShowPngImage(string, bool)
Saves and optionally shows a PNG image.
[Obsolete("Use a XxxUtility class.")]
public string SaveAndShowPngImage(string filepath, bool startViewer = false)
Parameters
Returns
SaveStreamToFile(Stream, string)
Saves a stream to a file.
[Obsolete("Use a XxxUtility class.")]
public void SaveStreamToFile(Stream stream, string path)