Steve
Steve

Reputation: 2818

PDFBox or IText Documentation?

I'm a Java programmer what would like to capture acroform XPDF data on the server side.

I would like to do a brief example of sever side Java capturing 2-3 fields worth of data sent to the server via a PDF form as a means of convincing my boss to do a new project in Java rather than .Net, so I don't have a lot of time to invest.

I noticed that there is a scarcity of tutorials for both PDFBox and iText.

I've noticed that the FAQ & "cookbook" on the Apache PDFBox site are slim and there isn't much in the way of tutorials on Google, at least not with the search strings I tried.

iText has a book iText wants you to buy, but again, a scarcity of tutorials.

Could anyone point me to resources that will teach me what I need for a basic demo, in a reasonable amount of time?

I wouldn't mind buying the iText book later, after my boss is convinced to go with Java.

Any advice for getting up and running with either library? I need a little more instruction than the API manuals.

Thanks

Steve

Upvotes: 1

Views: 2001

Answers (1)

Bruno Lowagie
Bruno Lowagie

Reputation: 77528

There is no such thing as XPDF, so I assume that you're talking about XFDF (if you meant to say XDP, my answer will be completely wrong).

ISO is currently working on a separate standard for XFDF and I'm one of the reviewers on the committee. There's XFDF support in iText for fields, but support for annotations is scheduled for next year (we'll develop it as the ISO standard evolves). However, this is irrelevant for your question the way I interpret it: you want to serve a PDF form (similiar to submit_me.pdf) and store an XFDF file on the server.

The sample form on the iText site has 4 buttons. One to submit the data as if the form were an HTML form, one to submit the data as FDF, one to submit the data as XFDF, one to reset the form. The servlet that is called, shows the data that was sent to the server by the viewer (for testing purposes only). If you have Adobe Acrobat (instead of Adobe Reader), you could also have the option of providing a button that sends the filled-out PDF form to the server.

Note that the data shown by the servlet (for instance the XFDF stream) is created by the viewer, NOT by a server-side script. This has the advantage that you don't need any PDF software on the server side. You just need to capture the bytes sent by the browser plug-in. A serious disadvantage is that you'll need a good viewer on the client. This excludes pdf.js (Firefox' PDF plug-in), Preview (Apple) or any other viewer that doesn't know about XFDF. This is a serious disadvantage, as you can't always control which viewer the end user wil use in his browser.

Upvotes: 1

Related Questions