Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - pageWidth, DAGetPageWidth results
  FAQ FAQ  Forum Search   Register Register  Login Login

pageWidth, DAGetPageWidth results

 Post Reply Post Reply
Author
Message
ginidat View Drop Down
Beginner
Beginner


Joined: 14 Jun 13
Location: Hanover, German
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote ginidat Quote  Post ReplyReply Direct Link To This Post Topic: pageWidth, DAGetPageWidth results
    Posted: 14 Jun 13 at 5:24PM
Hello all!

I've problems to get the page width and height of different existing documents
of different page sizes (as Adobe Reader confirms).


Using PageWidth (with measure unit "Inch") I allways get 8.5
Using DAGetPageWidth I allways get 0.0

maybe there is something wrong in my code (Delphi XE2):


handle := fPDFLib.DAOpenFileReadOnly( fn, '' );
fPDFLib.SetMeasurementUnits( 2 );
if ( fPDFLib.SelectPage( 1 ) = 1 ) then
   docWidth := fPDFLib.PageWidth;

OR
docWidth := fPDFLib.DAGetPageWidth( handle, 1 );



Have anyone an idea what is going wrong?

Thank's!
Cheers, Ginidat
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jun 13 at 5:31PM
Hi Gini!

Please keep in mind never mix da- and non-da-functions.
A DALoad... isn't a real load so the non-da-function PageWidt won't get a correct result.

Cheers and welcome here,
Ingo

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jun 13 at 8:44AM

You need to be using the following code.  As Ingo mentions the DA functions should only be used with other DA functions.  

  fh := QP.DAOpenFile(fn, '');
  ph := QP.DAFindPage(fh, 1);
  width := QP.DAGetPageWidth(fh, ph);

You might find it easier to use the non-DA functions which also support much more functionality.

  rey := QP.LoadFromFile(fn, '');
  if (ret = 1) then
  begin
    QP.SelectPage(1);
    QP.SetMeasurementUnits(2);
    pageWidth := QP.PageWidth();
  end;

Also by default QPL always has a single 1 page document loaded in memory and this is why QP.PageWidth is returning 8.5.

You might find it useful to read parts of the Developer Guide PDF that comes with QPL.

Andrew.
Back to Top
ginidat View Drop Down
Beginner
Beginner


Joined: 14 Jun 13
Location: Hanover, German
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote ginidat Quote  Post ReplyReply Direct Link To This Post Posted: 17 Jun 13 at 1:27PM
Hello Andrew, Ingo,

thank you for help!

Now it works.
I think my fault was not to use the function "DAFindPage".

Thank's again!

Ginidat
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store