Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 10 Monaten
Letzter Beitrag:
vor 10 Monaten
Beteiligte Autoren:
Erik Schwarz, GuenterP, HIS 21

[WD19] how to know orientation of pdf?

Startbeitrag von Erik Schwarz am 17.10.2016 12: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

Antworten:

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/?1000021279&name=pdfextractpage_function

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

von HIS 21 - am 17.10.2016 13:25
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 portrait format.

A warning however. Printing a multipage document using iPrint-functions and changing landscape / portrait while printing new pages 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.

von GuenterP - am 17.10.2016 13:31
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

von Erik Schwarz - am 18.10.2016 11:14
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.