lokeshj / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

Printing PDFs without pdf extension? #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Is there a way to print generated pdfs that don't have a pdf file extension. 
Example, applet.appendPDF("http://www.example.com/pdf.php?id=1"); throws error 
"Exception occured: This may not be a PDF File" and does not print although it 
is a PDF.

Original issue reported on code.google.com by rvtecrv...@gmail.com on 13 Mar 2012 at 10:19

GoogleCodeExporter commented 9 years ago
May have to be added. Are you relying on any session cookies that Java would be 
aware of?

I'll check this code tonight and see if I'm filtering on extension.

Original comment by tres.fin...@gmail.com on 13 Mar 2012 at 10:25

GoogleCodeExporter commented 9 years ago
Actually, it is looking for Content-disposition in the header it seems.
This works:
<?php
header('Content-Type: application/pdf');
header('Content-Disposition:inline;filename=example.pdf');
?>
This does not:
<?php
header('Content-Type: application/pdf');
?>

Original comment by rvtecrv...@gmail.com on 13 Mar 2012 at 10:32

GoogleCodeExporter commented 9 years ago
Good catch.  I reviewed the code, and there are no strict bindings to file 
extension or Content-Disposition.  Since jZebra uses PDF-RENDERER as a plugin, 
it is likely the limitation is with PDF-RENDERER.  I would suggest anyone using 
jZebra for pdf printing through php appends your header tags.  I'm putting it 
in the wiki, and marking bug as WontFix.

Feel free to open a bug report with PDF-RENDERER project if you think it's 
worth addressing, and if you do, also feel free to cross-link back to this bug 
report.

-Tres

Original comment by tres.fin...@gmail.com on 14 Mar 2012 at 1:48