Print Page | Close Window

Help extracting page size

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=752
Printed Date: 18 May 24 at 5:17PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Help extracting page size
Posted By: mac32bit
Subject: Help extracting page size
Date Posted: 29 Jun 07 at 12:12PM
Hi
 
I have 2500+ PDF files that I need to extract the page size from.
 
I have downloaded the QuickPDF v5.21 Delphi 6 DCUs and added the folder they are in to my library path but that is as far as I have got.
 
Is there a manual I can get hold of as I dont know how to use the functions with Delphi 6.
 
Maybe someone could give me some sample code of how to do this.
 
Many thanks in advance.
 
Mac
 
 



Replies:
Posted By: Ingo
Date Posted: 29 Jun 07 at 3:23PM
Hi Mac!

I've uploaded the reference guide now.
You and all the other ones can get it here:
http://www.is-soft.de/qpguide/qp511refguide.pdf

Here is a short delphi example.
First as pixels and second as millimeters:

       QP.SetMeasurementUnits(0); // values as pixel
       hmillis := Round(QP.PageHeight);
       wmillis := Round(QP.PageWidth);

       wh.Text := IntToStr(wmillis) + ' x ' + IntToStr(hmillis) + ' Pixel';

       QP.SetMeasurementUnits(1); // values as millimeters
       hmillis := Round(QP.PageHeight);
       wmillis := Round(QP.PageWidth);

       wh.Text := IntToStr(wmillis) + ' x ' + IntToStr(hmillis);

Best regards,
Ingo



Posted By: mac32bit
Date Posted: 30 Jun 07 at 9:09AM
Hi Ingo
 
I have made some progress thanks to your helpful reply.
The problem is that QP.PageHeight and QP.PageHeight do not return anything other than 216 x 279 mm
The actual page properties of my test file (as shown in Acrobat Reader) are 23.29 x 33.11 in (594 x 841 mm)
I think this is because I do not have an UnlockKey. The manual says that "The library must be unlocked before it can be used"
How can I buy one when the author is no longer selling the software? I only have the 5.21 Delphi DCUs from this forum.
Thanks again for your help!
Mac

Is this code correct ?
procedure TForm2.Button2Click(Sender: TObject);
var
QP : TiSEDQuickPDF;
hmillis, wmillis : integer;
begin
  QP := TiSEDQuickPDF.Create;
  try
  QP.LoadFromFile(Edit1.Text);
  QP.SetMeasurementUnits(1); // values as millimeters
// I tried your suggestion
  hmillis := Round(QP.PageHeight);
  wmillis := Round(QP. PageHeight);
// And I tried this
  wmillis := Round(QP.GetPageBox(2,2));
  hmillis := Round(QP.GetPageBox(2,3));
  wh.Text := IntToStr(wmillis) + ' x ' + IntToStr(hmillis);
  finally
    QP.Free;
  end;
end;


Posted By: Ingo
Date Posted: 30 Jun 07 at 9:21AM
Hi Mac!

You see the dimensions of the page that is actually selected.
An unlock-key for testing one month is here:
343738366767A06BE886EBF94443CB0F
Evaluation valid until 30 July 2007

We've posted here purchase-links... you can still buy the components.
Please read here:
http://www.quickpdf.org/forum/forum_posts.asp?TID=698
But keep in mind you can get support only from quickpdf-users without any guaranties.

Best regards,
Ingo



Posted By: mac32bit
Date Posted: 30 Jun 07 at 10:06AM
Hi Ingo
 
Now my code works with the key :)
 
594 x 841 !!!
 
procedure TForm2.Button2Click(Sender: TObject);
var
QP : TiSEDQuickPDF;
hmillis, wmillis : integer;
begin
  QP := TiSEDQuickPDF.Create;
  try
  QP.UnlockKey('343738366767A06BE886EBF94443CB0F');
  QP.LoadFromFile(Edit1.Text);
  QP.SetMeasurementUnits(1); // values as millimeters
  hmillis := Round(QP.PageHeight);
  wmillis := Round(QP.PageWidth);
  wh.Text := IntToStr(wmillis) + ' x ' + IntToStr(hmillis);
  finally
    QP.Free;
  end;
end;
 
 
Thanks for your help
 
Mac
 
 



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