Received the following:

[[o:Exception]:"java.lang.Exception: CreateInstance failed: new com.ocdevel.FillpdfService((o:String)[o:String], (o:String)[o:String]). Cause: com.itextpdf.text.exceptions.InvalidPdfException: PDF header signature not found. VM: 1.6.0_0@http://java.sun.com/" at: #-32 com.itextpdf.text.pdf.PRTokeniser.checkPdfHeader(PRTokeniser.java:205) #-31 com.itextpdf.text.pdf.PdfReader.readPdf(PdfReader.java:487) #-30 com.itextpdf.text.pdf.PdfReader.(PdfReader.java:181) #-29 co[...]/modules/fillpdf_support/fillpdf_support.module(127): Java->Java('com.ocdevel.Fil...', '', 'bytes') #6 [internal function]: fillpdf_support_merge_pdf('', Array, '9a1158154dfa42c...') #7 /var/www/ocdevel/drupal6/includes/xmlrpcs.inc(212): call_user_func_array('fillpdf_support...', Array) #8 /var/www/ocdevel/drupal6/includes/xmlrpcs.inc(71): xmlrpc_server_call(Object(stdClass), 'merge_pdf', Array) #9 /var/www/ocdevel/drupal6/xmlrpc.php(14): xmlrpc_server(Array) #10 {main}]

PDF Header Signature not found..?

Comments

GreyHawk’s picture

Aw, crap -- I forgot that this was built to work with webform. I built a CCK form for what I wanted to do...so, I suspect this won't work.

Any chance that it could be updated to work with CCK forms that aren't webforms anytime in the near future?

lefnire’s picture

Well it's built to work with both webform & CCK. Webform urls are fillpdf?fid=x&webform[nid]=x&webform[sid]=x, CCK urls are fillpdf?fid=x&nid=x.

Let me check into this xmlrpc business, brb.

lefnire’s picture

well, I tested it from my local to remote & got this error:

# warning: fopen(sites/fillpdf.ocdevel.com/files/fillpdf/test_template.pdf) [function.fopen]: failed to open stream: No such file or directory in /Users/renelle/workspace/ocdevel/drupal6/sites/all/modules/fillpdf/fillpdf.module on line 434.
# warning: filesize() [function.filesize]: stat failed for sites/fillpdf.ocdevel.com/files/fillpdf/test_template.pdf in /Users/renelle/workspace/ocdevel/drupal6/sites/all/modules/fillpdf/fillpdf.module on line 435.
# warning: fread(): supplied argument is not a valid stream resource in /Users/renelle/workspace/ocdevel/drupal6/sites/all/modules/fillpdf/fillpdf.module on line 435.
# warning: fclose(): supplied argument is not a valid stream resource in /Users/renelle/workspace/ocdevel/drupal6/sites/all/modules/fillpdf/fillpdf.module on line 436.
# [[o:Exception]:"java.lang.Exception: CreateInstance failed: new com.ocdevel.FillpdfService((o:String)[o:String], (o:String)[o:String]). Cause: com.itextpdf.text.exceptions.InvalidPdfException: PDF header signature not found. VM: 1.6.0_0@http://java.sun.com/" at: #-32 com.itextpdf.text.pdf.PRTokeniser.checkPdfHeader(PRTokeniser.java:205) #-31 com.itextpdf.text.pdf.PdfReader.readPdf(PdfReader.java:487) #-30 com.itextpdf.text.pdf.PdfReader.(PdfReader.java:181) #-29 co[...]/modules/fillpdf_support/fillpdf_support.module(127): Java->Java('com.ocdevel.Fil...', '', 'bytes') #6 [internal function]: fillpdf_support_merge_pdf('', Array, 'e4da3b7fbbce234...') #7 /var/www/ocdevel/drupal6/includes/xmlrpcs.inc(212): call_user_func_array('fillpdf_support...', Array) #8 /var/www/ocdevel/drupal6/includes/xmlrpcs.inc(71): xmlrpc_server_call(Object(stdClass), 'merge_pdf', Array) #9 /var/www/ocdevel/drupal6/xmlrpc.php(14): xmlrpc_server(Array) #10 {main}]

However, it turns out I had accidentally deleted test_template.pdf, so it couldn't find the file. Restored the file & everything worked. Did you also get the first few "warning: fopen()" errors? Check if your file's still there? I better make sure my module's not deleting anything....

lefnire’s picture

crap, looks like the pdfs are indeed being deleted because I'm missing the file_set_status($file, FILE_STATUS_PERMANENT); after file_save_upload (& therefore the uploaded pdfs are being deemed temporary). Will roll a new version very soon.

lefnire’s picture

Version: 6.x-1.9 » 6.x-1.10
Component: Web Service » Code
Status: Active » Fixed

Ok, that was a bummer bug... I really hope there aren't mega PDF-deletions out in the wild. Sorry guys :s
If you did loose a bunch of PDFs, if you can remember which ones they were & their filenames, just scp/ftp those back into the files/fillpdf directory & everything should still work

GreyHawk’s picture

lefnire, I was certain it was my being an idiot; hadn't even thought it could be a bug.

:)

Thank you for the update.

lefnire’s picture

Title: Error trying to test FillPDF with active data » PDF header signature not found (file missing)
Version: 6.x-1.10 » 6.x-1.9

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.