Print Page | Close Window

QuickPDF0714 PDF

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=1159
Printed Date: 17 Jan 26 at 12:40AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: QuickPDF0714 PDF
Posted By: kevinfeening
Subject: QuickPDF0714 PDF
Date Posted: 28 Jul 09 at 11:07PM
I am using Delphi 5 and interbase 7.5
 
I require to export to delphi / Interbase a PDF File containing employee data
when i use this code in Delphi
 
     memo1.Clear;
     qPDF := tQuickPDF0714.Create;
     qPDF.UnlockKey(Quickpdfkey);
     try
     if OpenDialog1.Execute then
          begin
          FileRef := qPDF.DAOpenFile(OpenDialog1.FileName,Quickpdfkey);
          PageRef := qPDF.DAFindPage(FileRef,1);
          Memo1.Lines.Text := qPDF.DAExtractPageText(FileRef,PageRef,0);          
     end;
     finally
          qPDF.Free;
     end;
 
The data displays but not in the same order as the PDF file (It waps around in no order). Is there a export program or a PDF Converter to achieve this on Delphi



Replies:
Posted By: DELBEKE
Date Posted: 29 Jul 09 at 6:44AM
You can use qPDF.DAExtractPageText(FileRef,PageRef,3).
With this option set, you'll obtain the textes and positions for each piece of text.


Posted By: kevinfeening
Date Posted: 29 Jul 09 at 7:01AM

3 shows the strings for fonts etc and the text displayed out of order as well

is it possible to display the text only on the same format as the pdf file

the dispay using qPDF.DAExtractPageText(FileRef,PageRef,3)

is still out of order to the actual pdf file the lines are completely mixed up


Posted By: DELBEKE
Date Posted: 29 Jul 09 at 6:29PM
The order of texts is defined at the creation of the PDF and can't be changed.
The fisrt writen on the pdf is the first in the output.


Posted By: kevinfeening
Date Posted: 29 Jul 09 at 11:19PM
Master Listing

28/07/2009 02:31:02 PM Printed  Page 1

Current Employees In Surname Order 

Name No Address Phone

Work Mobile
POWER CLUB SOCIAL CLUB 1132321331

ABN

   130 Peter ANDREWS 123 The Main Road COOLUM BEACH QLD 4573  2312123111

040111223322

    29 Mathew COOPER 95 My Way Lane TEWANTIN QLD 4565  0411132236



Posted By: kevinfeening
Date Posted: 29 Jul 09 at 11:23PM
The previous list is the export from the PDF the first line is OK
the second is OK
the actual 3rd line is showing in the 6th line
ABN on the 7th line should be between SOCIAL CLUB and 1132321331
 
I am trying to get the data from the file for a client who exports data using pdf and wants me to import some of the data into another database is there an export option I can use fro pdf to allow this 


Posted By: swb1
Date Posted: 30 Jul 09 at 1:14AM

No. There is no such text extraction routine. The order of the text in the PDF is not necessarily the same as it appears. If fact my experience has been that it is very rare to find the text in a left-to-right, top-to-bottom order in a PDF document.

You will need to use option 3 and then parse and sort the output so you can put the text in the correct order and on the correct line. There are many ways to accomplish this but none of them are simple. This will require some work on your part.
 
I have posted some sample code @
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_24605136.html#a24975777 - http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_24605136.html#a24975777



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