Design Question

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Design Question

Post by Pyrite »

I need to figure out a way for my company to give out a template to it's employees, be it by Word Document or PDF or something like that, where the boxes and text are in there, and they just have to fill in the blanks. And then go online and submit it to our site, so that php can parse it and put it in mysql, all broken down and tucked away.

Anybody ever done this? Any ideas on how? Not much luck getting php to parse word docs. PDF would be great, not everyone has pdf creation software. May be could use RTF or something. The employees just need to be able to have the document emailed to them, fill it out (offline, on the airplane, etc) and then send it back to us, and we'll have some way of mass importing each one into mysql.

Could really use some insight into how to do this.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Design Question

Post by Christopher »

You can have PDF forms that can be filled in. Why not just have a web form? Or maybe use some of the offline stuff like Google Gears or Mozilla's offline API?
(#10850)
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Design Question

Post by califdon »

Although I haven't done precisely that, I have done just a little Microsoft Office Automation, and I believe that you could use VBA in either Access or Word to extract bookmarked data from a Word document and insert it into an Access table. Perhaps you could do that at the home office, from the submitted Word documents, then make a single transfer from Access to MySQL. What I have done is the reverse, using VBA in Access to insert data from a table into bookmarks in Word documents. VBA has a document object model that allows you to access parts of a document.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Re: Design Question

Post by Pyrite »

arborint wrote:You can have PDF forms that can be filled in. Why not just have a web form? Or maybe use some of the offline stuff like Google Gears or Mozilla's offline API?
I know you can have PDF's that can be filled in and printed. But are you sure you can have them that can be filled in and saved???

Webforms are not an option.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Re: Design Question

Post by JayBird »

Pyrite wrote:
arborint wrote:You can have PDF forms that can be filled in. Why not just have a web form? Or maybe use some of the offline stuff like Google Gears or Mozilla's offline API?
I know you can have PDF's that can be filled in and printed. But are you sure you can have them that can be filled in and saved???

Webforms are not an option.

You can, but the client needs to have the full Adobe Acrobat application. The reader can't do it.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: Design Question

Post by Ollie Saunders »

but the client needs to have the full Adobe Acrobat application. The reader can't do it.
To create the form you mean. Not to fill it in. I've filled in PDF forms with FoxIt Reader.

You might want to consider XUL (pronounced zool). You can easily create text fields in fact if you know HTML/CSS/JavaScript you should be right at home.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Design Question

Post by pickle »

There is a way to set up a PDF so the reader itself POSTs the data. I've never done it myself, but I'm pretty sure I saw it in the preferences somewhere.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Re: Design Question

Post by JayBird »

ole wrote:
but the client needs to have the full Adobe Acrobat application. The reader can't do it.
To create the form you mean. Not to fill it in. I've filled in PDF forms with FoxIt Reader.

You might want to consider XUL (pronounced zool). You can easily create text fields in fact if you know HTML/CSS/JavaScript you should be right at home.

Yeah, its posts the data, but you cant save a copy of the form with the data entered into it
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: Design Question

Post by Ollie Saunders »

You can with Foxit Reader. I have a file with saved stuff.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Re: Design Question

Post by Pyrite »

Awesome!, so the real question is, can PHP parse the PDF?

I've seen many classes to create them, not many to read/parse them though?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Design Question

Post by alex.barylski »

Pyrite wrote:Awesome!, so the real question is, can PHP parse the PDF?

I've seen many classes to create them, not many to read/parse them though?
Sure. Do people typically bother? No.

PDF is a native plain-text format I believe. However most applications these days encrypt and/or compress the PDF making it not-so-easy on the naked eye(s).

Of course you could reverse what has been done, but that is a tremendous amount of work.

Most people just create a rough template of what they want, and use placeholders to indicate where in the PDF they want data injected, etc. Likewise, libraries like http://www.pdflib.com/products/pdflib-family/ go a littler further and let you dynamically compose a PDF from several "blocks" I think they are refered to as.

HTH
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Design Question

Post by Kieran Huggins »

pickle wrote:There is a way to set up a PDF so the reader itself POSTs the data. I've never done it myself, but I'm pretty sure I saw it in the preferences somewhere.
I've built many such PDFs, and they behave just like a webform. They'll POST to any URL you ask them to. You don't need to safe and send the PDF anywhere, just fill it in and hit "submit" like a web form.

PHP handles the data just like any other form submission. There's no special parsing involved. None. Really.

Incidentally, you can save form data in Adobe Reader (the free viewer) as well as Acrobat (the expensive viewer/writer), provided they're not locked to specifically forbid it. I actually like PDFs, kinda. OK, maybe "like" is a tad strong, but they have a few good uses.
Post Reply