Print Page | Close Window

DAGetPageHeight returns always 0.0

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1383
Printed Date: 04 Mar 26 at 10:41AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DAGetPageHeight returns always 0.0
Posted By: Didi
Subject: DAGetPageHeight returns always 0.0
Date Posted: 24 Mar 10 at 12:25PM
I want to render a preview of an existing PDF into a given rectangle of my dc.
Is that anyhow possible? The render function takes only the DPI, but not the size in pixel, and it begins always at upper left corner of the DC.
Or have I first to render to a bitmap and then to bitblt the bitmap?
How can I detect the aspect ratio of my PDF (or page)? The commands DAGetPageHeight / DAGetPageWidth always return 0.0 when I call them.
Can I render a part of a page? (zoom)
Thank you very much for any answer!
 
 



Replies:
Posted By: Didi
Date Posted: 24 Mar 10 at 4:04PM
EDIT
the functions PageHeight() and PageWidth() work, in my examples the unis was "point".
Can I detect which unit is given?


Posted By: Paddy
Date Posted: 24 Mar 10 at 7:49PM
Hi, the http://www.quickpdflibrary.com/help/quickpdf/SetMeasurementUnits.php - SetMeasurementUnits function lets you control which measurement unit is used when measurements are given to and returned from the library.


Posted By: Dario
Date Posted: 24 Mar 10 at 9:38PM
You cannot use Da Functions and Normal function together.
The SetMeasurementUnits work with Normal function not DaFunctions
If you want to know the "mm" for example, you have to multiply the value for 25.4/72

Dim HandlerFILE As Long = QUICKPDF_Doc.DAOpenFileReadOnly(FileSelezionato, "")
Dim Pagina As Long = QUICKPDF_Doc.DAFindPage(HandlerFILE, 1)
Dim Misura_l As String = CInt(QUICKPDF_Doc.DAGetPageWidth(HandlerFILE, Pagina) * 25.4 / 72).ToString
Dim Misura_h As String = CInt(QUICKPDF_Doc.DAGetPageHeight(HandlerFILE, Pagina) * 25.4 / 72).ToString
Me.ListaFiles.Items(Indice).SubItems(6).Text = (Misura_l & " x " & Misura_h)
QUICKPDF_Doc.DACloseFile(HandlerFILE)


OK? bye


Posted By: Didi
Date Posted: 25 Mar 10 at 8:17AM
Thank you!
I thought, it could depend on  different files, wich unit is returned, but by default, it's always "point"?
What's the difference between "DA" and "Normal"?
I think QuickPDF is a excellent tool, but newbies like me could save lots of time, if there was more example progams available.


Posted By: Dario
Date Posted: 26 Mar 10 at 1:45PM
When you using DA-Functions.... YES
If you using Normal function like LoadFromFile (for example) you can before set the unit with the function SetMeasurementUnits (1=mm, 2= inches)
DaFunction are the function with hight performance (Direct Access functionality), for me Normal function are all function without prefix "DA" before the function's name.
The problem is that there are many function normal and few DA-Function.
There is a "DEMO App" program with some samples. Download it and install. This is the address.
http://www.quickpdflibrary.com/blog/2009/10/a-customizable-demo-for-quick-pdf-library/

P.S.
You buy the "mantenance" licence, because the QuickPDF Team are really good when you ask assistance.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk