Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to convert PDF to Text Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
18-Sep-03
Category
OLE
Language
Delphi 3.x
Views
193
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Lou Adler

Convert PDF to Text

Answer:

If Reader is installed this code will do it for you: 

1   {
2   courtesy DLoke on the Delphi-Talk mailing list
3   http://www.elists.org
4   }
5   
6   procedure Tform1.PDF2Text(APDFFileName, ATextFileName: TFileName);
7   var
8     App, AVDoc: Variant;
9   begin
10    //create an instance. if no running instance is found a new one is started
11    App := CreateOleObject('AcroExch.App');
12    // App.Show;   //only if you want to..
13    AVDoc := App.GetActiveDoc; //doc handle
14    AVDoc.Open(APDFFileName, ''); //see note below
15    //select all and copy to clipboard
16    App.MenuItemExecute('Edit');
17    App.MenuItemExecute('SelectAll');
18    App.MenuItemExecute('Edit');
19    App.MenuItemExecute('Copy');
20    // Memo1 CAN be set to invisible
21    // You need this in order to get it from
22    // the clipboard into a text file
23    Memo1.PasteFromClipboard;
24    // Save the text to a file
25    Memo1.Lines.SaveToFile(ATextFileName);
26    App.Exit; //unless you want to leave it running.
27  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC