Hello itext-questions,
I have such a code:
...................................................................
PdfReader reader = new PdfReader("math.pdf"); // math.pdf - exists
Document doc2 = new Document(PageSize.A4);
PdfCopy wrtr = null;
wrtr = new PdfCopy(doc2, new FileOutputStream("other.pdf"));
doc2.open();
PdfImportedPage page = wrtr.getImportedPage(reader, 1); // HERE I
GET FIRST PAGE OF DOCUMENT
wrtr.addPage(page); // HERE I WRITE THIS PAGE TO ANOTHER DOCUMENT(other.pdf)
PrinterJob job = PrinterJob.getPrinterJob();
Book bk = new Book();
// HERE I ADD PAGE TO PRINTER
bk.append(new PaintCover(page.createGraphics(400,600)), job.defaultPage());
job.setPageable(bk);
if(job.printDialog())
{
job.print();
}
doc2.close();
...................................................................
class PaintCover implements Printable {
public PaintCover(Graphics2D g2d)
{
graph2d = g2d;
}
public int print(Graphics g, PageFormat pf, int pageIndex)
throws PrinterException {
g = (Graphics)graph2d;
}
Graphics2D graph2d;
}
...................................................................
After this code my printer prints free page!!!
Whats wrong i don't know. I thought that uses
page.createGraphics(400,600), I can get acces to docs value.
--
Best regards,
Alexandr mailto:[EMAIL PROTECTED]
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions