Java doesn't provide any way to print a PDF directly. You'll need something else like Acrobat or GhostScript.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prem Joshi
Sent: Monday, November 08, 2004 9:28 AM
To: [EMAIL PROTECTED]
Subject: [iText-questions] Query regarding printing of pdf.
Importance: High

Hi,
I have created a pdf document successfully.
There is a query which says How can I send a pdf file directly to printer.
It will reauire acrobat reader for that.
My concern is like using standard java api we can get a print of a word document using PrinterJob.printDialog() and printJob.print() methods.
I think I have reached upto using a Graphics2d object for printing a pear image as mentioned in example chap10_Graphics2D.But if I want to add a watermark on it I couldn't get the success.One thing I need to highlight that I got the printout only if using the following code:
g2 = (Graphics2D) g; where g is of object Graphics type which pass as a input parameter for print method.
where as this example says
 g2 = tp.createGraphics(w, h, mapper);But using this I haven't get the pear image.
 
I attached the watermark in two place.
1>attached to document that will be successfully watermarking on the pdf file.
2>attached to the PdfWriter also but no effect I observed.
 
Pls. sort out the problem as soon as possible

Reply via email to