Hi,
I have a scenario where I am converting an EMF to PDF using PDFSharp and a clipping rectangle with zero with and height is not working. A zero with or height clipping rectangle is used to hide the output from drawing commands.
The code at fault is the use of System.Drawing2D.GraphicsPath.AddRectangle at XGraphicsPath.AddRectangle(XRect).
replace the contents of this function with
this.gdipPath.StartFigure(); this.gdipPath.AddLines( new PointF[] { rect.TopLeft.ToPointF(), rect.TopRight.ToPointF(), rect.BottomRight.ToPointF(), rect.BottomLeft.ToPointF() } ); this.gdipPath.CloseFigure();
Which successfully initialises the GraphicsPath with the zero with or height rectangle and allows clipping to be performed on this path.
Cheers Ryan
|