Hi,
I am new to PDFSharp.
I have a PDF document consisting of a table with some data saved on my hard drive by my c# service. The size of the table is actually meant to print on a
compliments slip sized page, so about 1/3 of an A4 page.
I need to rotate the table by 90" then save it back, as the paper for these cashier receipts needs to be fed long-wise into the printer using the manual feed tray.
So I tried the below code to open an existing document:
Code:
// Rotate and save the PDF;
PdfDocument doc = new PdfDocument(reportName); ;
var page = doc.Pages[0];
page.Rotate = 90;
//Save pdf file.
doc.Save("PDFSharp _" + reportName);
doc.Close();
Before I run the above code, the document referenced by
reportName is 25KB...after that line of code executes, the document is 0 bytes in size.
So obviously I am creating a new document and overwriting my existing one.
What is the correct method call to open an existing single page PDF, rotate it's single page, and save it?
Thanks