public void setJobName(String name) {
jobName = name;
}
public void print(ImageEditorEngine engine, ProgressThread thread, PageFormat format, PrintSettings settings) throws PrinterException {
ICC_Profile colorProfile = settings.getColorProfile() != null
? settings.getColorProfile()
: JAIContext.sRGBColorProfile;
MacOSXPrinter.setPageFormat( format );
// In Cocoa there is no way of really controlling the print resolution,
// we always print at full size and then rely on the printer to do the appropriate scaling...
RenderedImage rendering = engine.getRendering(engine.getNaturalSize(),
colorProfile,
engine.getLCMSIntent(settings.getRenderingIntent()),
true);
try {
File spoolFile = File.createTempFile("LZPrintSpool", "tif");
LCTIFFWriter writer = new LCTIFFWriter(spoolFile.getAbsolutePath(),
rendering.getWidth(),
rendering.getHeight());
// No profile for Application Managed Colors
if (colorProfile == JAIContext.sRGBColorProfile)
writer.setByteField( TIFFTags.TIFF_ICC_PROFILE, colorProfile.getData());
writer.putImageStriped(rendering, thread);
if (!thread.isCanceled())
MacOSXPrinter.print(jobName, spoolFile, settings.getPrintBounds());