Reading PDF Form Data in LiveCode?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
Does anyone have any code or suggestions for reading the data from PDF forms? I have several hundred form fields in 5 different design forms in PDF format that I need to extract. The data is mainly text fields but may include a few checkboxes and radio buttons. Any thoughts please?

Thanks

Peter
--
Peter Reid
Loughborough, UK


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
before wheel invention it might be prudent to see how the existing apps do
this.
especially if this is a one shot.

https://pdf.wondershare.com/top-pdf-software/free-pdf-to-csv-converter.html
--
Stephen Barncard - Sebastopol Ca. USA -
mixstream.org


On Wed, Oct 10, 2018 at 7:45 AM Peter Reid via use-livecode <
[hidden email]> wrote:

> Does anyone have any code or suggestions for reading the data from PDF
> forms? I have several hundred form fields in 5 different design forms in
> PDF format that I need to extract. The data is mainly text fields but may
> include a few checkboxes and radio buttons. Any thoughts please?
>
> Thanks
>
> Peter
> --
> Peter Reid
> Loughborough, UK
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
That looks like an interesting list.
We just started on a new app in LC for managing troves of scanned
documents, and one of the tasks we were planning to add was connecting to
an OCR service and a PDF-converter.

On Wed, Oct 10, 2018 at 11:04 AM Stephen Barncard via use-livecode <
[hidden email]> wrote:

> before wheel invention it might be prudent to see how the existing apps do
> this.
> especially if this is a one shot.
>
> https://pdf.wondershare.com/top-pdf-software/free-pdf-to-csv-converter.html
> --
> Stephen Barncard - Sebastopol Ca. USA -
> mixstream.org
>
>
> On Wed, Oct 10, 2018 at 7:45 AM Peter Reid via use-livecode <
> [hidden email]> wrote:
>
> > Does anyone have any code or suggestions for reading the data from PDF
> > forms? I have several hundred form fields in 5 different design forms in
> > PDF format that I need to extract. The data is mainly text fields but may
> > include a few checkboxes and radio buttons. Any thoughts please?
> >
> > Thanks
> >
> > Peter
> > --
> > Peter Reid
> > Loughborough, UK
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
Have you heard of my app? :-)

What I do on a Mac is tell Acrobat (via Applescript) to create an fdf file which is an xml formatted file of all the values in the form controls. I then have a function that parses that file into a livecode array. Windows is trickier, because you cannot tell acrobat for windows to do anything from outisde without going through a C API that Adobe provides for that purpose.

If however your workflow allows for a user interaction, then you can just create an action to run a javascript. Here's the code:

this.exportAsFDF(true, true, null, false);

Once you have that file, I can send you the code I use to parse it.

Bob S


> On Oct 10, 2018, at 08:03 , Stephen Barncard via use-livecode <[hidden email]> wrote:
>
> before wheel invention it might be prudent to see how the existing apps do
> this.
> especially if this is a one shot.
>
> https://pdf.wondershare.com/top-pdf-software/free-pdf-to-csv-converter.html
> --
> Stephen Barncard - Sebastopol Ca. USA -
> mixstream.org
>
>
> On Wed, Oct 10, 2018 at 7:45 AM Peter Reid via use-livecode <
> [hidden email]> wrote:
>
>> Does anyone have any code or suggestions for reading the data from PDF
>> forms? I have several hundred form fields in 5 different design forms in
>> PDF format that I need to extract. The data is mainly text fields but may
>> include a few checkboxes and radio buttons. Any thoughts please?
>>
>> Thanks
>>
>> Peter
>> --
>> Peter Reid
>> Loughborough, UK


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
I didn't see in any of the descriptions a way to script or automate conversions. I suppose if any has a watch folder auto conversion feature that could work.

Bob S


> On Oct 10, 2018, at 08:08 , Mike Kerner via use-livecode <[hidden email]> wrote:
>
> That looks like an interesting list.
> We just started on a new app in LC for managing troves of scanned
> documents, and one of the tasks we were planning to add was connecting to
> an OCR service and a PDF-converter.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
I should have mentioned, you need Acrobat for this, Reader won't do it, and any Acrobat alternative would need to be able to run javascripts.

Bob S


> On Oct 10, 2018, at 08:16 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> Have you heard of my app? :-)
>
> What I do on a Mac is tell Acrobat (via Applescript) to create an fdf file which is an xml formatted file of all the values in the form controls. I then have a function that parses that file into a livecode array. Windows is trickier, because you cannot tell acrobat for windows to do anything from outisde without going through a C API that Adobe provides for that purpose.
>
> If however your workflow allows for a user interaction, then you can just create an action to run a javascript. Here's the code:
>
> this.exportAsFDF(true, true, null, false);
>
> Once you have that file, I can send you the code I use to parse it.
>
> Bob S
>
>
>> On Oct 10, 2018, at 08:03 , Stephen Barncard via use-livecode <[hidden email]> wrote:
>>
>> before wheel invention it might be prudent to see how the existing apps do
>> this.
>> especially if this is a one shot.
>>
>> https://pdf.wondershare.com/top-pdf-software/free-pdf-to-csv-converter.html
>> --
>> Stephen Barncard - Sebastopol Ca. USA -
>> mixstream.org
>>
>>
>> On Wed, Oct 10, 2018 at 7:45 AM Peter Reid via use-livecode <
>> [hidden email]> wrote:
>>
>>> Does anyone have any code or suggestions for reading the data from PDF
>>> forms? I have several hundred form fields in 5 different design forms in
>>> PDF format that I need to extract. The data is mainly text fields but may
>>> include a few checkboxes and radio buttons. Any thoughts please?
>>>
>>> Thanks
>>>
>>> Peter
>>> --
>>> Peter Reid
>>> Loughborough, UK
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
On macOS, try PDFzone (on the App Store). Great app.



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
I have used https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ server version in the past.

Mark
On Oct 10, 2018, 8:48 AM -0700, Peter Reid via use-livecode <[hidden email]>, wrote:

> Does anyone have any code or suggestions for reading the data from PDF forms? I have several hundred form fields in 5 different design forms in PDF format that I need to extract. The data is mainly text fields but may include a few checkboxes and radio buttons. Any thoughts please?
>
> Thanks
>
> Peter
> --
> Peter Reid
> Loughborough, UK
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
Doesn't seem to work. I enter this syntax in a terminal session:

pdftk "/Users/bobsneidar/Documents/Installs/3PL Logistics/Hawthorne/20130815-3PL Logistics Site Survey.pdf" output "/Users/bobsneidar/Documents/Installs/3PL Logistics/Hawthorne/20130815-3PL Logistics Site Survey_data.fdf" generate_fdf

Doesn't throw an error, just doesn't do anything. I have to ctrl-c to get my terminal back. Do you see any issue with my statement?

Bob S


> On Oct 10, 2018, at 08:53 , Mark via use-livecode <[hidden email]> wrote:
>
> I have used https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ server version in the past.
>
> Mark


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
On 10/10/2018 10:16 AM, Bob Sneidar via use-livecode wrote:
> Doesn't seem to work. I enter this syntax in a terminal session:
>
> pdftk "/Users/bobsneidar/Documents/Installs/3PL Logistics/Hawthorne/20130815-3PL Logistics Site Survey.pdf" output "/Users/bobsneidar/Documents/Installs/3PL Logistics/Hawthorne/20130815-3PL Logistics Site Survey_data.fdf" generate_fdf
>
> Doesn't throw an error, just doesn't do anything. I have to ctrl-c to get my terminal back. Do you see any issue with my statement?

Dunno. But I'd immediately suspect the spaces in the pathnames.

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
Have you tried leaving off the output filename? Should dump it to stdout then.

Mark
On Oct 10, 2018, 10:29 AM -0700, Mark Wieder via use-livecode <[hidden email]>, wrote:

> On 10/10/2018 10:16 AM, Bob Sneidar via use-livecode wrote:
> > Doesn't seem to work. I enter this syntax in a terminal session:
> >
> > pdftk "/Users/bobsneidar/Documents/Installs/3PL Logistics/Hawthorne/20130815-3PL Logistics Site Survey.pdf" output "/Users/bobsneidar/Documents/Installs/3PL Logistics/Hawthorne/20130815-3PL Logistics Site Survey_data.fdf" generate_fdf
> >
> > Doesn't throw an error, just doesn't do anything. I have to ctrl-c to get my terminal back. Do you see any issue with my statement?
>
> Dunno. But I'd immediately suspect the spaces in the pathnames.
>
> --
> Mark Wieder
> [hidden email]
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
That's why I enclosed them in quotes. Dragging the files into the terminal creted paths with delimited spaces, but I got the same result.

Bob S


> On Oct 10, 2018, at 10:28 , Mark Wieder via use-livecode <[hidden email]> wrote:
>
> On 10/10/2018 10:16 AM, Bob Sneidar via use-livecode wrote:
>> Doesn't seem to work. I enter this syntax in a terminal session:
>> pdftk "/Users/bobsneidar/Documents/Installs/3PL Logistics/Hawthorne/20130815-3PL Logistics Site Survey.pdf" output "/Users/bobsneidar/Documents/Installs/3PL Logistics/Hawthorne/20130815-3PL Logistics Site Survey_data.fdf" generate_fdf
>> Doesn't throw an error, just doesn't do anything. I have to ctrl-c to get my terminal back. Do you see any issue with my statement?
>
> Dunno. But I'd immediately suspect the spaces in the pathnames.
>
> --
> Mark Wieder


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
Still locks up. I have an email in to the guy who maintains it. I just thought if someone had this working they could provide me with proper syntax. I cannot get the prompt working either. This from the man page:

pdftk <input PDF files | - | PROMPT>
            [ input_pw <input PDF owner passwords | PROMPT> ]
            [ <operation> <operation arguments> ]
            [ output <output filename | - | PROMPT> ]

I'm not that good at internreting man page syntax. I have yet to get it right one single time. :-)

Bob S


> On Oct 10, 2018, at 10:32 , Mark via use-livecode <[hidden email]> wrote:
>
> Have you tried leaving off the output filename? Should dump it to stdout then.
>
> Mark


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading PDF Form Data in LiveCode?

Bob Sneidar via use-livecode
I never received a reply to my email about the proper syntax to produce an fdf file from a fillable form. Anyone who intends to use pdftk, be aware you may not get support.

Bob S


> On Oct 10, 2018, at 10:38 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> Still locks up. I have an email in to the guy who maintains it. I just thought if someone had this working they could provide me with proper syntax. I cannot get the prompt working either. This from the man page:
>
> pdftk <input PDF files | - | PROMPT>
>            [ input_pw <input PDF owner passwords | PROMPT> ]
>            [ <operation> <operation arguments> ]
>            [ output <output filename | - | PROMPT> ]
>
> I'm not that good at internreting man page syntax. I have yet to get it right one single time. :-)
>
> Bob S
>
>
>> On Oct 10, 2018, at 10:32 , Mark via use-livecode <[hidden email]> wrote:
>>
>> Have you tried leaving off the output filename? Should dump it to stdout then.
>>
>> Mark
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode