Fop
  1. Fop
  2. FOP-1514

[PATCH] FOP API does not allow using preconfigured PrinterJob object

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: renderer/awt
    • Labels:
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • External issue ID:
      44678

      Description

      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.

        Activity

        Hide
        Jeremias Maerki added a comment -

        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.

        Show
        Jeremias Maerki added a comment - 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.
        Hide
        Antti Karanta added a comment -

        Attachment fop_printerjob.patch has been added with description: patch for the issue

        Show
        Antti Karanta added a comment - Attachment fop_printerjob.patch has been added with description: patch for the issue
        Hide
        Antti Karanta added a comment -

        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?

        Show
        Antti Karanta added a comment - 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?
        Hide
        Jeremias Maerki added a comment -

        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.

        Show
        Jeremias Maerki added a comment - 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.
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          People

          • Assignee:
            fop-dev
            Reporter:
            Antti Karanta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development