PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
_____________________________________________________________
First of all, is this a reasonable place to ask questions about the Java
FDF toolkit?
I have a simple scenario with a servlet that assumes the contents of the
inputstream contains the bytes of an FDF. I have a piece of test code
that creates an empty FDFDoc, then adds one field to it, and then sends
the output of "Save()" to the servlet.
When I called "Save()", the result was 148 bytes long. When I got the
inputstream in the servlet, the content length was 148 bytes. When I
called the FDFDoc constructor which takes an inputstream and content
length, it gave me the following exception stack trace (somewhat
elided):
com.adobe.fdf.exceptions.FDFBadFDFException: not enough data in the
input stream to parse FDF
at
com.adobe.fdf.fdfobjects.FDFObjStore.<init>(FDFObjStore.java:124)
at com.adobe.fdf.FDFDoc.<init>(FDFDoc.java:321)
I used some code to print out the FDF data, and it comes out like this:
25 46 44 46 2d 31 2e 32 - 0d 25 2b 29 27 31 0d 0a %FDF-1.2.%????..
31 20 30 20 6f 62 6a 0d - 3c 3c 20 0d 2f 46 44 46 1.0.obj.<<../FDF
20 3c 3c 20 2f 46 69 65 - 6c 64 73 20 32 20 30 20 .<<./Fields.2.0.
52 20 3e 3e 20 0d 3e 3e - 20 0d 65 6e 64 6f 62 6a R.>>..>>..endobj
0d 32 20 30 20 6f 62 6a - 0d 5b 20 0d 3c 3c 20 2f .2.0.obj.[..<<./
54 20 28 66 69 65 6c 64 - 31 29 2f 56 20 28 76 61 T.(field1)/V.(va
6c 75 65 31 29 3e 3e 20 - 0d 5d 0d 65 6e 64 6f 62 lue1)>>..].endob
6a 0d 74 72 61 69 6c 65 - 72 0d 3c 3c 0d 2f 52 6f j.trailer.<<./Ro
6f 74 20 31 20 30 20 52 - 20 0d 0d 3e 3e 0d 25 25 ot.1.0.R...>>.%%
45 4f 46 0d EOF.
What could be wrong here? Why can't it parse the FDF?
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfdev.html