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.

Tue Oct 03, 2023 7:12 am

Hi Team,
I'm using a PdfPageBase object to try and get each page's size, but it always returns the first page's size for all the pages.


foreach (PdfPageBase page in doc.Pages)
{
int _Width = page.ActualSize.Width;
int _Height = page.ActualSize.Height;
}

Any suggestion?

sterlingfordev
 
Posts: 13
Joined: Wed Jan 25, 2023 5:31 am

Tue Oct 03, 2023 7:52 am

Hello,

Thanks for your inquiry.
I simulated a PDF file and conducted preliminary testing using the latest version of Spire.PDF(Spire.PDF Pack(Hot Fix) Version:9.9.9), but did not reproduce your issue. If you are not using the latest version, I suggest you use the latest version for testing first. If the issue still exists after testing, please provide the following information for further investigation. Thank you in advance.
1)Your sample PDF file, you can attach here or send it to us via email (support@e-iceblue.com).
2)Application type, such as Console App, .NET Framework 4.8.
3)Your test environment, such as OS info (E.g. Windows 7, 64-bit).

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Tue Oct 03, 2023 2:46 pm

Tried with the latest version still facing the same problem

1) Please find attached document
2) Application type: Console App, NET Framework 4.8.
3) Environment: Windows server 2019, 64-bit

sterlingfordev
 
Posts: 13
Joined: Wed Jan 25, 2023 5:31 am

Wed Oct 04, 2023 12:46 pm

Hello,

Thanks for your feedback.
I tested your pdf file and reproduce your issue, but this is normal phenomenon, due to the second page has a 270 degree of rotation. That means the second page is the same height and width as the first page itself except it's rotated 270 degrees relative to the first page You can use the following code to verify every page’s rotation degree.
Code: Select all
foreach (PdfPageBase page in pdf.Pages)
            {
page.Rotation
}


Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Thu Oct 05, 2023 9:37 am

Ok Thanks

sterlingfordev
 
Posts: 13
Joined: Wed Jan 25, 2023 5:31 am

Sat Oct 07, 2023 2:21 am

Hello,

You're welcome! If you have any issues in future, just feel free to contact us.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.PDF