Parsing a PDF file

Jim Hurley jhurley0305 at sbcglobal.net
Sun Jul 10 19:18:31 EDT 2016


hh wrote:

> 
> [Description for MacOS, works on Win/Linux similar.]
> 
> The best results for extracting tables from PDF I had with the free "RAW"
> method:
> 
> = Open the file with Preview.
> = Select All (menu Edit). Copy.
> = Go to a LC stack with a field "INCOMING"
> = Use by a button or the message box the line
>    put clipboardData["Text"] into fld "INCOMING"
> 
> If you use simply "paste" you get (probably unwanted) styles with your text.
> (If you have a lot of files: Preview is scriptable.)
> 

Thanks, that works well. 

I thought I would try to program your method  within LC:

on mouseUp
   get url "https://www.mynevadacounty.com/nc/elections/docs/2016%20Elections/June%207%2c%202016%2c%20Presidential%20Primary/Election%20Results/cumulativereport.pdf"
   set the clipboarddata["text"] to it
   put the clipboarddata["text"] into field 1
end mouseUp

But, no dice. I'm guessing there is something about "Copy" in Preview that is missing in LC.

Same applies to opening the file in Adobe and doing a "save as" and choosing "text (accessible)"

Be nice if LC could beef-up "get url" to do whatever it is that  Preview and Adobe do.

Thanks again,

Jim







More information about the use-livecode mailing list