I've posted this on an Oracle forum, but did not get a response. I am hoping there is a different set of expertise on this forum:


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

For example, if I run the below example code 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.

Specifically, before my application has polluted the JVM, it is easy to spot the text in the postscript generated the printer. After my application has loaded some more code, the postscript is no longer reader friendly - it almost appears as if each text character is being point by point.

<without influence of application>
225 1129 M (hello world)
[49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49
49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49
49 49 49 49 0]xS
</without influence of application>

<after application code has loaded in the JVM>
N 235 250 M 235 312 I 250 312 I 251 312 252 312 252 313 -c 252 313 253 314 253 314 -c 253 315 253 316 252 316 -c 252 316 251 317 250 317 -c 215 317 I 214 317 213 316 213 316 -c 212 316 212 315 212 314 -c 212 314 212 313 213 313 -c 213 312 214 312 215 312 -c 230 312 I 230 256 I 216 260 I 215 260 215 261 214 261 -c 214 261 213 260 213 260 -c 212 259 212 259 212 258 -c 212 258 212 257 213 257 -c 213 257 213 256 214 256 -c 235 250 I C
</after application code has loaded in the JVM>

Regretfully my application is too complex to figure out quickly what code is influencing the printer output, so I hoping someone can alert me of what sorts of things can influence the output to the printer - which will help my investigation.