I have a page template that I would like to draw onto another page but I would like to flip the page so it is mirrored.
There is no flip transform on the canvas so I tried using a scale transform of -1,0 but the resulting PDF is blank. I tried with and without a translate transform of (template.width,0) as I assumed the resulting flipped template might be off the page but still blank.
I also tried a scale transform of 0.2f,0 because this should show up without any translate transform but the resulting PDF is still blank.
If I don't use any transform then the resulting PDF does contain the original content.
This is the code I'm using
- Code: Select all
var pdf = new PdfDocument();
pdf.LoadFromFile("filepath");
var newPdf = new PdfDocument();
var t = pdf.Pages[0].CreateTemplate();
var page = newPdf.Pages.Add(t.Size, new PdfMargins(0));
page.Canvas.ScaleTransform(0.2f, 0);
page.Canvas.DrawTemplate(t, new PointF(0, 0));
newPdf.SaveToFile("newFilepath");
Am I missing something? Is there another way to flip a pagetemplate?
Thanks