PDFsharp change origin

I am using PDFsharp to draw lines of a rather complex shape. To make this process easier and clearer, I would like to change the origin in the upper left corner of the page in the lower left corner. The source code change has not yet been implemented . Is there a way to move the origin to the bottom left corner using methods like RotateTransform

and TranslateTransform

or otherwise? As far as I can tell, the rotational transform revolves around the origin. Maybe I don't know the trick. Using

gfx.TranslateTransform(-612, -792); // Assumes 8.5 inch x 11 inch at 72 points/inch


I can move it to the bottom-right position so that the x increases while remaining on the left, but the added text is flipped. Generated PDF

Is there a way to really move the origin to the bottom left so that y increases and x increases as it goes to the right? Thanks in advance.

EDIT: ThomasH's answer moves the origin to the bottom-left position, but the text still flips. Is there a way to overcome this? See the example given here: http://pastebin.com/fgfjDXF1


source to share

1 answer

A combination of TranslateTransform

and ScaleTransform(1,-1)

should do what you want.



All Articles