C# Class PdfSharp.Xps.Rendering.PdfContentWriter

ファイルを表示 Open project: homoluden/WPF2PDF Class Usage Examples

Private Properties

Property Type Description
BeginGraphic void
BeginText void
CreateDefaultTransparencyGroup void
GetContent string
GetFontName string
GetFontName string
GetFontName string
TryGetFontName string
WriteCanvas void
WriteGeometry void
WriteGlyphs void
WriteGlyphs_ClusterMapping void
WriteGlyphs_DistanceOnly void
WriteGlyphs_GlyphIndicesAndDistanceOnly void
WriteGlyphs_Indices1 void
WriteGlyphs_None void
WriteMoveStart void
WritePath void
WritePathFillStroke void
WriteSegment void
WriteSegment void
WriteSegment void
WriteSingleLineStrokeWithSpecialCaps bool
WriteStrokeGeometry void
WriteVisual void

Public Methods

Method Description
AddCapToPath ( PdfSharp.Xps.XpsModel.Path path, PdfSharp.Xps.XpsModel.PathFigure figure, double length, double lineWidthHalf, LineCap lineCap, PdfSharp.Drawing.XMatrix matrix ) : void
AdjustTextMatrix ( PdfSharp.Drawing.XPoint &pos ) : void
BeginContent ( bool hacks4softmask ) : void

Initializes the default view transformation, i.e. the transformation from the user page space to the PDF page space.

BeginContentRaw ( ) : void

Just save current state.

Close ( ) : void

Closes the underlying content stream.

EndContent ( ) : void
MultiplyOpacity ( double opacity ) : double

Muliplies the spcified opacity with the current opacity and returns the new value;

MultiplyTransform ( PdfSharp.Drawing.XMatrix matrix ) : PdfSharp.Drawing.XMatrix

Muliplies the spcified transformation with the current transformation and returns the new value;

PdfContentWriter ( PdfSharp.Xps.Rendering.DocumentRenderingContext context, PdfSharp.Pdf.PdfDictionary contentDictionary ) : System

PdfContentWriter ( PdfSharp.Xps.Rendering.DocumentRenderingContext context, PdfPage page ) : System

Initializes a new instance of the PdfContentWriter class for creating a content stream of the specified page.

PdfContentWriter ( PdfSharp.Xps.Rendering.DocumentRenderingContext context, PdfSharp.Drawing.XForm form, RenderMode renderMode ) : System

Initializes a new instance of the PdfContentWriter class for creating a content stream of the specified form.

RealizeExtGState ( PdfSharp.Pdf.Advanced.PdfExtGState xgState ) : void

Realizes the specified graphic state.

RealizeFill ( PdfSharp.Xps.XpsModel.Brush brush, PdfSharp.Drawing.XForm &xform, PdfSharp.Drawing.XImage &ximage ) : void

Makes the specified brush to the current graphics object.

RealizeFillOpacity ( double opacity ) : void

Realizes the opacity for non-stroke operations.

RealizeFont ( PdfSharp.Xps.XpsModel.Glyphs glyphs ) : void

Makes the specified font and brush to the current graphics objects.

RealizeStroke ( PdfSharp.Xps.XpsModel.Path path ) : void

Makes the specified pen to the current graphics object.

RealizeStrokeOpacity ( double opacity ) : void

Realizes the opacity for stroke operations.

WriteClip ( PdfSharp.Xps.XpsModel.PathGeometry geo ) : void

Writes the specified PathGeometry as intersection with the current clip path to the content stream.

WriteClip ( PdfSharp.Drawing.XRect rect ) : void

Writes the specified rectangle as intersection with the current clip path to the content stream.

WriteElement ( XpsElement element ) : void

Writes the specified element to the content stream.

WriteElements ( XpsElementCollection elements ) : void

Writes all elements of the collection to the content stream.

WriteOpacityMask ( PdfSharp.Xps.XpsModel.Brush brush ) : void
WriteRenderTransform ( PdfSharp.Drawing.XMatrix matrix ) : void

Writes the specified transformation matrix to the content stream.

WriteRestoreState ( string traceMessage, string elementName ) : void

Restores the previous graphical state and writes a pop state operator to the content stream.

WriteSaveState ( string traceMessage, string elementName ) : void

Saves the current graphical state and writes a push state operator to the content stream.

WriteSegment ( PdfSharp.Xps.XpsModel.PolyLineSegment seg ) : void

Writes the specified PolyLineSegment to the content stream.

WriteTextTransform ( PdfSharp.Drawing.XMatrix matrix ) : void

Writes the specified text transformation matrix to the content stream.

Private Methods

Method Description
BeginGraphic ( ) : void

Begins the graphic mode (i.e. ends the text mode).

BeginText ( ) : void

Begins the text mode.

CreateDefaultTransparencyGroup ( ) : void
GetContent ( ) : string

Gets the content created by this renderer.

GetFontName ( PdfSharp.Xps.XpsModel.Font font ) : string

Gets the resource name of the specified font within this page or form.

GetFontName ( PdfSharp.Drawing.XFont font, PdfSharp.Pdf.Advanced.PdfFont &pdfFont ) : string

Gets the resource name of the specified font within this page or form.

GetFontName ( string idName, byte fontData, PdfSharp.Pdf.Advanced.PdfFont &pdfFont ) : string

Gets the resource name of the specified font within this page or form.

TryGetFontName ( string idName, PdfSharp.Pdf.Advanced.PdfFont &pdfFont ) : string

Tries to get the resource name of the specified font within this page or form. Returns null if no such font exists.

WriteCanvas ( PdfSharp.Xps.XpsModel.Canvas canvas ) : void

Writes a Canvas to the content stream.

WriteGeometry ( PdfSharp.Xps.XpsModel.PathGeometry geo ) : void

Writes the specified PathGeometry to the content stream.

WriteGlyphs ( PdfSharp.Xps.XpsModel.Glyphs glyphs ) : void

Writes a Glyphs to the content stream.

WriteGlyphs_ClusterMapping ( PdfSharp.Xps.XpsModel.Glyphs glyphs, string text ) : void
WriteGlyphs_DistanceOnly ( PdfSharp.Xps.XpsModel.Glyphs glyphs, string text ) : void
WriteGlyphs_GlyphIndicesAndDistanceOnly ( PdfSharp.Xps.XpsModel.Glyphs glyphs, string text ) : void
WriteGlyphs_Indices1 ( PdfSharp.Xps.XpsModel.Glyphs glyphs, string text ) : void
WriteGlyphs_None ( PdfSharp.Xps.XpsModel.Glyphs glyphs, string text ) : void
WriteMoveStart ( Point point ) : void
WritePath ( PdfSharp.Xps.XpsModel.Path path ) : void

Writes a Path to the content stream.

WritePathFillStroke ( PdfSharp.Xps.XpsModel.Path path ) : void

Writes the path fill and/or stroke operators to the content stream.

WriteSegment ( PdfSharp.Xps.XpsModel.ArcSegment seg ) : void

Writes the specified ArcSegment to the content stream.

WriteSegment ( PdfSharp.Xps.XpsModel.PolyBezierSegment seg ) : void

Writes the specified PolyBezierSegment to the content stream.

WriteSegment ( PdfSharp.Xps.XpsModel.PolyQuadraticBezierSegment seg ) : void

Writes the specified PolyQuadraticBezierSegment to the content stream.

WriteSingleLineStrokeWithSpecialCaps ( PdfSharp.Xps.XpsModel.Path path ) : bool

If the path is a single line with different start and end caps, convert the line into an area.

WriteStrokeGeometry ( PdfSharp.Xps.XpsModel.Path path ) : void

Strokes the path geometry with the Stroke brush.

WriteVisual ( PdfSharp.Xps.XpsModel.Visual visual ) : void

Writes a Visual to the content stream.

Method Details

AddCapToPath() public method

public AddCapToPath ( PdfSharp.Xps.XpsModel.Path path, PdfSharp.Xps.XpsModel.PathFigure figure, double length, double lineWidthHalf, LineCap lineCap, PdfSharp.Drawing.XMatrix matrix ) : void
path PdfSharp.Xps.XpsModel.Path
figure PdfSharp.Xps.XpsModel.PathFigure
length double
lineWidthHalf double
lineCap LineCap
matrix PdfSharp.Drawing.XMatrix
return void

AdjustTextMatrix() public method

public AdjustTextMatrix ( PdfSharp.Drawing.XPoint &pos ) : void
pos PdfSharp.Drawing.XPoint
return void

BeginContent() public method

Initializes the default view transformation, i.e. the transformation from the user page space to the PDF page space.
public BeginContent ( bool hacks4softmask ) : void
hacks4softmask bool
return void

BeginContentRaw() public method

Just save current state.
public BeginContentRaw ( ) : void
return void

Close() public method

Closes the underlying content stream.
public Close ( ) : void
return void

EndContent() public method

public EndContent ( ) : void
return void

MultiplyOpacity() public method

Muliplies the spcified opacity with the current opacity and returns the new value;
public MultiplyOpacity ( double opacity ) : double
opacity double
return double

MultiplyTransform() public method

Muliplies the spcified transformation with the current transformation and returns the new value;
public MultiplyTransform ( PdfSharp.Drawing.XMatrix matrix ) : PdfSharp.Drawing.XMatrix
matrix PdfSharp.Drawing.XMatrix
return PdfSharp.Drawing.XMatrix

PdfContentWriter() public method

public PdfContentWriter ( PdfSharp.Xps.Rendering.DocumentRenderingContext context, PdfSharp.Pdf.PdfDictionary contentDictionary ) : System
context PdfSharp.Xps.Rendering.DocumentRenderingContext
contentDictionary PdfSharp.Pdf.PdfDictionary
return System

PdfContentWriter() public method

Initializes a new instance of the PdfContentWriter class for creating a content stream of the specified page.
public PdfContentWriter ( PdfSharp.Xps.Rendering.DocumentRenderingContext context, PdfPage page ) : System
context PdfSharp.Xps.Rendering.DocumentRenderingContext
page PdfSharp.Pdf.PdfPage
return System

PdfContentWriter() public method

Initializes a new instance of the PdfContentWriter class for creating a content stream of the specified form.
public PdfContentWriter ( PdfSharp.Xps.Rendering.DocumentRenderingContext context, PdfSharp.Drawing.XForm form, RenderMode renderMode ) : System
context PdfSharp.Xps.Rendering.DocumentRenderingContext
form PdfSharp.Drawing.XForm
renderMode RenderMode
return System

RealizeExtGState() public method

Realizes the specified graphic state.
public RealizeExtGState ( PdfSharp.Pdf.Advanced.PdfExtGState xgState ) : void
xgState PdfSharp.Pdf.Advanced.PdfExtGState
return void

RealizeFill() public method

Makes the specified brush to the current graphics object.
public RealizeFill ( PdfSharp.Xps.XpsModel.Brush brush, PdfSharp.Drawing.XForm &xform, PdfSharp.Drawing.XImage &ximage ) : void
brush PdfSharp.Xps.XpsModel.Brush
xform PdfSharp.Drawing.XForm
ximage PdfSharp.Drawing.XImage
return void

RealizeFillOpacity() public method

Realizes the opacity for non-stroke operations.
public RealizeFillOpacity ( double opacity ) : void
opacity double
return void

RealizeFont() public method

Makes the specified font and brush to the current graphics objects.
public RealizeFont ( PdfSharp.Xps.XpsModel.Glyphs glyphs ) : void
glyphs PdfSharp.Xps.XpsModel.Glyphs
return void

RealizeStroke() public method

Makes the specified pen to the current graphics object.
public RealizeStroke ( PdfSharp.Xps.XpsModel.Path path ) : void
path PdfSharp.Xps.XpsModel.Path
return void

RealizeStrokeOpacity() public method

Realizes the opacity for stroke operations.
public RealizeStrokeOpacity ( double opacity ) : void
opacity double
return void

WriteClip() public method

Writes the specified PathGeometry as intersection with the current clip path to the content stream.
public WriteClip ( PdfSharp.Xps.XpsModel.PathGeometry geo ) : void
geo PdfSharp.Xps.XpsModel.PathGeometry
return void

WriteClip() public method

Writes the specified rectangle as intersection with the current clip path to the content stream.
public WriteClip ( PdfSharp.Drawing.XRect rect ) : void
rect PdfSharp.Drawing.XRect
return void

WriteElement() public method

Writes the specified element to the content stream.
public WriteElement ( XpsElement element ) : void
element XpsElement
return void

WriteElements() public method

Writes all elements of the collection to the content stream.
public WriteElements ( XpsElementCollection elements ) : void
elements XpsElementCollection
return void

WriteOpacityMask() public method

public WriteOpacityMask ( PdfSharp.Xps.XpsModel.Brush brush ) : void
brush PdfSharp.Xps.XpsModel.Brush
return void

WriteRenderTransform() public method

Writes the specified transformation matrix to the content stream.
public WriteRenderTransform ( PdfSharp.Drawing.XMatrix matrix ) : void
matrix PdfSharp.Drawing.XMatrix
return void

WriteRestoreState() public method

Restores the previous graphical state and writes a pop state operator to the content stream.
public WriteRestoreState ( string traceMessage, string elementName ) : void
traceMessage string
elementName string
return void

WriteSaveState() public method

Saves the current graphical state and writes a push state operator to the content stream.
public WriteSaveState ( string traceMessage, string elementName ) : void
traceMessage string
elementName string
return void

WriteSegment() public method

Writes the specified PolyLineSegment to the content stream.
public WriteSegment ( PdfSharp.Xps.XpsModel.PolyLineSegment seg ) : void
seg PdfSharp.Xps.XpsModel.PolyLineSegment
return void

WriteTextTransform() public method

Writes the specified text transformation matrix to the content stream.
public WriteTextTransform ( PdfSharp.Drawing.XMatrix matrix ) : void
matrix PdfSharp.Drawing.XMatrix
return void