Page 1 of 1

Convert PDF to Text

Posted: Wed Sep 03, 2008 8:43 pm
by no1g8tor
I have a program that uses text files to fill in data. The company I get these text files are only going to publish them to PDF's from now on so I am dead in the water.

I saw a competing product that lets them use the PDF just like the text file. I am sure the program converts it to text somehow before it imports it in.

I did do a copy all text and paste to notepad and save it to a text file that works, but not perfect.

I know the other program is written in VB. I am sure there is a workaround in RunRev that can make this work without having to manually convert it.

PLEASE HELP. I am out of luck until I figure this out.

Thanks so much

Posted: Thu Sep 04, 2008 1:27 am
by Bernard
There's no way in Rev to do this natively. You will need to use external tools. There are various things you can use and you will need to search the internet to find them. At the bottom line Adobe's full Acrobat product (not just the Reader) is capable of editing PDFs (providing they are published in a form that is not locked to prevent that happening). There are also various (cheaper) shareware offerings I believe (and some free/open-source ones, although as far as I remember they were pretty kludgy).

Posted: Thu Sep 04, 2008 1:59 pm
by no1g8tor
OK, maybe this will work. A buddy of mine does it in VB so I am sure it might work here.

He opens up a pdf in a invisible window, sets focus to the pdf and then does a "select-all" cuts and pastes it to the clipboard, then used the clipboard data, not just the text he needs and then puts it into the array for reading the data.

Is this possible and how to go about it????

Thanks Bernard

Posted: Thu Sep 04, 2008 2:17 pm
by Bernard
That may be possible. I understand that Rev 2.9 can use vbscript, so the vb part could work. Certainly Rev can copy stuff from the clipboard once it's there.

You could be on to a solution there. But I'm afraid I've never used VB, and certainly not from Rev.

Here's a couple of threads in the user list discussing vbscript:
http://www.nabble.com/screen-keyboard-t ... #a18013125
http://www.nabble.com/RR-2.9.0-dp-2---V ... #a14183565

Posted: Fri Sep 05, 2008 5:50 am
by no1g8tor
Thanks Bernard.

I was hoping someone with VBscript knowledge could help. I looked into it and I could not make heads or tails.

Or, if someone else has any other ideas.

Thanks in advance

Convert PDF to text

Posted: Fri Sep 05, 2008 7:49 am
by bjb007
Depending on the security settings of the PDF
there is, somewhere on the AcroRead menu, an
option to save as a text file.

I've used it and it's very good.

Suppose you might need an API or something?
Or a script perhaps to do it from Rev.

Posted: Fri Sep 05, 2008 3:03 pm
by no1g8tor
bjb07, thank you it works great.

Now if someone could help me out to figure out to use runrev to control acroreader?

I have already programmed the download of the PDF, now I need to open it up in acroreader and save to text then close acro and then use my current programming to pull in the text.

Is there a way to control external programs by sending key commands to the externals?

Thanks

Posted: Fri Sep 05, 2008 3:48 pm
by hamlynart
Hi no1g8tor,

Did you ever develop a solution to this? I'd also like to import text from PDF's to Revolution if possible.

Thanks

Jim

Posted: Fri Sep 05, 2008 10:53 pm
by SparkOut
There seems to be some good information and resources in some of the links on this page: http://www.autoitscript.com/forum/lofiv ... 21433.html

Posted: Sat Sep 06, 2008 5:21 am
by no1g8tor
I still have nothing but will look into the suggestions. Keep them coming. I have the solution in VB that a friend uses.

If anyone wants it I will email it to you. I don't want to post it because its not mine but if a few of you want it or maybe you can use it to make suggestions for runrev.

Thanks again