I've gone through a lot of existing Printing threads e.g.
Printing HTML with Java Printing Service(JDK1.4 beta)
javax.print and binary formats
Converting JFrame to a .pdf file
Any one uses javax.print API and works?
setting printer options like LEGAL,landscape programatically.
but I could not find a solution to my problem.
I want to print different file formats (pdf, tif, jpg, gif, doc, xls etc.) using Java Printing API. I want printer to decide the paper size that will fit content prperly. Orientation and Number of copies should be provided by the user. I used following but it does not work
It's been while since I worked on printing, but looking at your code and comparing it with mine, the only difference I can see is where you create the print job:
Hi,
Can someone help me with printing request I made before. I also need to send document to printer that has most of the pages A4 size but some pages are A3 size (diagram). Printer should automatically use most appropriate paper size to print the document. How do we code this? Any example.
Hi,
I'm still waiting for a solution for this printing problem.
I need to print different file formats (e.g. pdf, xls, doc, dwg, gif, tif etc.)
Orientation support e.g. Landscape or Portrait
Page sizes (A4, A3 etc.). Also printer should detect the most appropriate paper size in case a multi page document has mix size pages e.g A4, A3 etc.
Multiple copies should also be supported.
My code (see previous posts) works fine with gif file using DocFlavor.INPUT_STREAM.GIF. But pdf printout are not in desired form. Is it because it is not supported as DocFlavor.INPUT_STREAM.PDF. I am using DocFlavor.INPUT_STREAM.AUTOSENSE for pdf.