Reputation: 1
I am printing 4 copies of a document. Each copy has only a single line change. While saving it through "microsoft print to PDF", I am getting dialogue box to set location path and has default name of document as "java printing". How can I programmatically change name of the document?
I have read about the DocumentName
attribute class, but I don't know how to use it with a printerJob
object.
Please help with an example.
Upvotes: 0
Views: 844
Reputation: 41
Please try this:
PrinterJob job = PrinterJob.getPrinterJob();
job.setJobName("examplefilename");
Upvotes: 4