Detect the orientation of a PDF file (1 Viewer)

Verkom

New member
Local time
Today, 11:52
Joined
Aug 12, 2015
Messages
1
Hello everyone,

I hope this is the right place to ask this particular question. I googled a couple of hours, but I still didn't find a solution yet, so I'm starting to get a bit desperate.

What am I trying to do:
I'm trying to detect what's the ortientation of a particular PDF file (aways a single page) in a loop. If it's landscape, I want to rotate it 90 degrees. (and move on to the next PDF file).

I found out how to rotate a PDF file (page.SetRotate(90)) but I can't find how to detect it's orientation.

Any help would be highly appreciated,

Friendly greetings,
Jan
 

Tom_2012

New member
Local time
Today, 12:52
Joined
Apr 8, 2017
Messages
3
Jan,

You can just test for the dimensions of the page with GetSize

'Set PDFPage0 = pdDoc.AcquirePage(0)
'Set PDFPage = pdDoc.AcquirePage(0).GetSize()
'If PDFPage.x > PDFPage.y Then PDFPage0.SetRotate (90)

Best regards

Tom
 

Users who are viewing this thread

Top Bottom