Orientation of imported pages

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Generator for COM/ActiveX (v4)  /  Orientation of imported pages

DynamicPDF Generator for COM/ActiveX (v4) Forum

 Jul 16 2009 2:51 AM
Hi,
i'm programming VB6 and use the newest release of Generator for COM/Active V5 but Generator V5 is not selectable in the product selector for this thread.

The problem:
Source is a PDF document generated with Adobe Acrobat. The document contains 4 pages. First page has landscape orientation the others have portrait orientation.(Acrobat shows correctly different height and width for landscape and portrait pages)
 
It seems that after importing first page (=landscape orientation) of this document via

Set MyPageData = NewTargetPage.AddImportedPageData(Source, 1, 0, 0)

the width and height and angle of the imported page represented by MyPageData are like a portrait orientation and are still the same  for the other imported pages. There is no change.

Is there a way to detect the real orientation of the imported page ?

Best regards
 Jul 16 2009 5:32 AM
Posted by a ceTe Software moderator
Hello,

In order to get the orientation of a page you will have to compare the Height and Width of the page. If the width of the page is more than the height then it is in landscape mode. By checking the height and width of the imported page you can find the page orientation.

Thanks,
ceTe Software Support Team.
 Jul 16 2009 7:52 AM
Hello,

i created the page in Acrobat by making a DIN A4 portrait page and rotate it by 90 degrees clockwise, So i got the landscape oriented page. Then i saved it to a file.

Acrobat shows this page as a landscape page and shows also that width value is bigger than height value. That's ok.

When i import this page from the Acrobat file via ImportedPageData the height and width values of the imported page are like the values of a portrait page (width smaller than height) but should be as in Acrobat (width value is bigger than height).

Could you please check this ?
 Jul 16 2009 9:31 AM
Posted by a ceTe Software moderator
Hello,

It shows that you have a potrait page with a rotation in it. Rotating a page does not make it landscape, but it looks like landscape as it is rotated. YOu will have to check if the page is rotated in your case. You can get the rotation value by using the Rotate property.

int rotation = mergeDocument.Pages[0].Rotate;

If you want to rotate the current page then you can rotate it by using the Rotate property of the page.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 10:01 AM.