Merger - ImportedPageData - Wrong height/width

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v10)  /  Merger - ImportedPageData - Wrong height/width

DynamicPDF CoreSuite for .NET (v10) Forum

Hello,

I have somes troubles in VB.NET using this method :

New ceTe.DynamicPDF.Merger.ImportedPageData(pPath, pPageNumber, 0, 0, 1)

If the page in pdf is in landscape like width = 500 and height = 100.

The ImportedPageData as the height to 500 and width to 100.

Did i missed something ?

Posted by a ceTe Software moderator
Hello,

Can you please send over the following details to support@dynamicpdf.com so we can look into it further?

1.        Code sample which uses static data to recreate the behaviour.
2.        Source/input PDF using which you are seeing this behaviour.
3.        Exact version and build number of the DynamicPDF DLL file used in the application. You can get this information by right clicking on the DLL file>> Properties>>Details tab>> Product version or take a screenshot of Details tab and send it over to us.

Thanks,
ceTe Software Support Team.
Posted by a ceTe Software moderator
Hello,

Thanks for the sending requested details to our support team. We looked into the PDF and found that the pages are in portrait mode but are rotated 90 degrees. Hence the dimensions you see for ImportedPageData are expected. For rotated pages you have to take into account the angle of rotation and you can check the Rotate property on the Page object as shown below. 

            PdfDocument pdf = new PdfDocument("document.pdf");
            MergeDocument document = new MergeDocument(pdf);
            float pageWid = document.Pages[0].Dimensions.Width;
            float pageHt = document.Pages[0].Dimensions.Height;
            float roated = document.Pages[0].Rotate;

 Thanks,
ceTe software Support Team.
Hello,

Thanks for answer,

It seems to work, but i still have question.

the solution you propose need to instanciate an object that read all pages of the pdf.
In case of use of large PDF (lots of pages and very large pages) I'm wondering if that will not have a slow inpact on my process.

Do you know if it's possible to just retrive a page like  'ImportedPageData'  and have the value of rotation like your solution for the specifique page only ?

 I have see a property 'angle' in 'ImportedPageData' but it's  equal to 0 for the rotated pages

Thanks,
Posted by a ceTe Software moderator

Hello,

Angle property on ImportedPageData object is used to rotate ImportedPageData when it is placed on a new page. The Angle property does not retrieve the rotation of the page the ImportedPageData is created from.

Unfortunately, there is no other way to check if a page retrieved from an existing PDF is rotated or not without loading it with MergeDocument object. When you create MergeDocument, use MergeOptions.None property to avoid loading extraneous data so the PDF will get loaded faster.

            PdfDocument pdf = new PdfDocument("document.pdf");
            MergeDocument document = new MergeDocument(pdf, MergeOptions.None);

 Thanks,
ceTe software Support Team.

All times are US Eastern Standard time. The time now is 2:09 AM.