Bug 44678 - [PATCH] FOP API does not allow using preconfigured PrinterJob object
Summary: [PATCH] FOP API does not allow using preconfigured PrinterJob object
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: awt renderer (show other bugs)
Version: all
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2008-03-26 06:58 UTC by Antti Karanta
Modified: 2012-04-01 06:31 UTC (History)
0 users



Attachments
patch for the issue (2.82 KB, patch)
2008-03-29 10:41 UTC, Antti Karanta
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Karanta 2008-03-26 06:58:30 UTC
Currently it is not possible to use a custom configured java.awt.print.PrinterJob when printing via FOP. This makes it somewhat awkward to use for printing via its API. See the implementation of org.apache.fop.render.print.PrintRenderer, specifically how instance variable printerJob is initialized in method initializePrinterJob().

There should be some way to parameterize printing w/ custom PrinterJob object. The most natural place for this (from the point of view of the caller) would be a method in org.apache.fop.apps.Fop, since the basic interaction w/ FOP happens via an instance of that class.
Comment 1 Jeremias Maerki 2008-03-26 10:50:28 UTC
Actually, the "Fop" class is not the right place. For these things, it is suggested to use the RendererOptions Map on FOUserAgent (FOUserAgent.getRendererOptions()). The PrintRenderer has access to this Map.

Can we ask you to help us in this area? Good patches are always welcome. It might also make sense to investigate a move towards JPS (Java Printing System) since we've dropped support for Java 1.3. If you need help to get started, just yell.
Comment 2 Antti Karanta 2008-03-29 10:41:41 UTC
Created attachment 21734 [details]
patch for the issue
Comment 3 Antti Karanta 2008-03-29 10:42:12 UTC
You're right - I hadn't had the need to pass in renderer specific parameters so I had missed that.

Here's a patch. I tried to mimic the way transformation specific parameters are handled w/ pdf renderer. If there is something wrong w/ the patch, let me know. 

Any chance of this patch making it to the 0.95 release?

Comment 4 Jeremias Maerki 2008-04-17 06:37:48 UTC
I've applied your patch with modifications/additions. Thanks!
http://svn.apache.org/viewvc?rev=649091&view=rev

Please note that I've applied it to FOP Trunk. Since it is new functionality I'm hesitant to put it in the 0.95 branch because that is supposed to be for bugfixing/stabilizing only.
Comment 5 Glenn Adams 2012-04-01 06:31:19 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed