Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sat May 09, 2020 6:07 pm

What is the correct way to determine the current rotation of a PDF?

I am using the Rotation attribute of PdfPageBase class. This seems to correctly provide the original orientation of the scan (from the scanner for example). However, if I take a PDF file with a reported rotation of 90º, load it into Adobe Acrobat and rotate the document by 90º and then load the document into my software again, the angle of rotation still registers as 90º rather than the 180º that I was expecting.

Below is a code extract:


Code: Select all
                PdfPageBase page = pdfDoc.Pages[pdfbCurrent.iPageNumber - 1];
                PdfPageRotateAngle pdfAngle = page.Rotation;

                if (!pdfbCurrent.blPageHeightAdjusted)
                {
                    switch (page.Rotation)
                    {


All help appreciated.

Darren

wraydc
 
Posts: 130
Joined: Wed Apr 11, 2018 5:14 am

Mon May 11, 2020 3:41 am

Hello,

Thanks for your inquiry.
I simulated your scenario and tested with the latest Spire.Pdf Pack(Hot Fix) Version: 6.4.11, but I could get the correct result. If you are using an old version. I suggest that you try again with the latest one. If your issues still occurs after trying, please share us with your testing PDF for reference. You can upload here or send to us via email([email protected]).

Sincerely,
Sara
E-iceblue support team
User avatar

Sara.Yang
 
Posts: 33
Joined: Wed May 06, 2020 1:05 am

Mon May 11, 2020 12:13 pm

Thanks for your prompt response.

I'm currently using the version from Spire.Office 5.3.1, Spire.Pdf.dll is dated March 9th, product version 6.3.0.2046. I'll try with a later version and revert.


Darren.

wraydc
 
Posts: 130
Joined: Wed Apr 11, 2018 5:14 am

Tue May 12, 2020 2:02 am

Hello,

Thanks for your reply.
I’m looking forward to your test results, if there are still problems, please provide your input documents to us for reference, then we will do further investigation. You could upload here or send it to us via email([email protected]).

Sincerely,
Sara
E-iceblue support team
User avatar

Sara.Yang
 
Posts: 33
Joined: Wed May 06, 2020 1:05 am

Return to Spire.PDF

cron