[Retep-PDF] Urgent help needed please!
Status: Beta
Brought to you by:
petermount
|
From: Matt H. <ma...@ma...> - 2004-12-19 15:18:43
|
Hey, Peter and crew.
I'm working on a time-crunch invoice app, and found your PDF generation tools to
be just what I needed. Problem is, they're not working.
This is the code I am using to generate the print job:
public int GeneratePDF()
{
PrinterJob prJ = PDF.getPrinterJob();
if (prJ.printDialog()) {
try
{
PageFormat fmt = prJ.defaultPage();
prJ.setPrintable(this ,fmt);
prJ.print();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
return 0;
}
I'm trying to simply print out the Swing form I am working with, as it appears
on screen. When I run this, i get the following in the Netbeans output console:
PF in printPage:
java.awt.print.PageFormat=[height="842.0",orientation="1",width="595.0",matrix="[D@d5c0f9",imageableX="0.0",imageableY="0.0",imageableHeight="842.0",imageableWidth="595.0",paper="java.awt.print.Paper@1701bdc"]
PF in printPage:
java.awt.print.PageFormat=[height="842.0",orientation="1",width="595.0",matrix="[D@633d51",imageableX="0.0",imageableY="0.0",imageableHeight="842.0",imageableWidth="595.0",paper="java.awt.print.Paper@14eaec9"]
PF in printPage:
java.awt.print.PageFormat=[height="842.0",orientation="1",width="595.0",matrix="[D@b533b8",imageableX="0.0",imageableY="0.0",imageableHeight="842.0",imageableWidth="595.0",paper="java.awt.print.Paper@569c60"]
Then, when I try to open the PDF, I get a 2 page blank document and this error
box (Opening with Adobe Reader 6.01):
An unrecognized token " was found.
For reference, I have placed the generated PDF at
www.rollplaygames.com/temp/retep.pdf.
Please help!
|