• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing to text to postscript text vs printing to image?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know why the following code would generate Postscript graphics instead of text?

I have a complex application, and I notice when I send something to a printer, the format of the content sent to the printer (via PrinterJob) is different depending on what code in my application has loaded in the JVM.

For example, if I run the below example code as a standalone and check the 'print to file' box in the print dialog, I can inspect the postscript produced. When running this simple code against different JVMs, the output is largely the same except for the time/date stamp.

<simple code>
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(new HelloWorldPrinter() /* Simple implementation of Printable */ );
boolean doPrint = job.printDialog();

try {
job.print();
} catch (PrinterException e) {
e.printStackTrace();
}
</simple code>

However, I have noticed that after certain code is loaded in my larger application the content of printed document output (from inspecting the output from the 'print to file' feature) is largely different - the content has clearly been printed to an image file.
 
reply
    Bookmark Topic Watch Topic
  • New Topic