PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD19] how to know orientation of pdf?
[WD19] how to know orientation of pdf?
Iniciado por guest, 17,oct. 2016 14:22 - 3 respuestas
Publicado el 17,octubre 2016 - 14:22
Hi,

I need to print some external pdf-files (single page) in a Report.
As I don't know the orientation, I cannot choose landscape/portrait mode.

Is there a way to check the pdf-file on it's orientation?

thanks

Erik
Publicado el 17,octubre 2016 - 15:25
Hi,

if you want to use native WLanguage function you can use the following function to get an image variable and use the variable to get size of a page of your PDF (it is a little dirty solution for the problem)

http://help.windev.com/en-US/…

You can also use a .NET dll to do something like the following example

http://stackoverflow.com/questions/18879992/how-to-get-pdf-page-dimensions
Publicado el 17,octubre 2016 - 15:31
Hi Erik,

there seems to be no PDF document's property telling you that. However, you could use the PDFExtractPage(..) in order to extract the/a page of the document and judge upon its width and height (ImageHeight(..) and ImageWidth(..)) whether the extracted page is in landscape or partrait format.

A warning however. Printing a multipage document using iPrint-functions and changing landscape / portrait may end up in a bad printout because portrait-margins are kept in ladscape! So currently, mixing of landscape / portrait printing within a single document is not recommended. PC Soft knows about that bug but it's not fixed yet.
Publicado el 18,octubre 2016 - 13:14
Hi Guenter and HIS,

that's exactly what I need. Unfortunately this function is available from WD20 and I have not yet moved (never touch a running System!). Just new Projects are using WX20.

So I have to wait until it's time to Change.

thanks a lot

Erik