On 09.05.2006 17:13:40 Chris Bowditch wrote:
> Jeremias Maerki wrote:
> 
> > On 09.05.2006 16:04:37 Chris Bowditch wrote:
> > 
> >>Jeremias Maerki wrote:
> >>
> >>
> >>>On 09.05.2006 13:35:11 Chris Bowditch wrote:
> 
<snip/>
> > This renderer configuration is still implemented as an extension. It's
> > just that the extension is not only about media selection but about
> > configuring the whole renderer which makes the whole thing more
> > universal. Same config layout for both FO-origin configuration and
> > engine-origin configuration.
> 
> What I meant is this sounds awkward to setup. Perhaps if I could see 
> some examples....

ok, I'll try. From a userconfig.xml:

  [..]
  <renderers>
    <renderer mime="application/postscript">
      <auto-rotate-landscape>false</auto-rotate-landscape>
      <printer-setup name="Xerox DocuPrint 180"> 
        <printer-def src="printer-defs/xerox-dp180.xml"/>
        <media-map>
          <media master="form1" media-type="form1"/>
          <media master="letterhead" media-type="letterhead"/>
          <media master="plain" media-type="plain"/>
        </media-map>
      </printer-setup>
      <printer-setup name="Lexmark Optra T614">
        <printer-def media-selection="mediapos">
          <paper-source name="Upper" mediapos="1"/>
          <paper-source name="Manual" mediapos="2"/>
          <paper-source name="Lower" mediapos="4"/>
        </printer-def>
        <media-map>
          <media master="form1" paper-source="Manual"/>
          <media master="letterhead" paper-source="Upper"/>
          <media master="plain" paper-source="Lower"/>
        </media-map>
      </printer-setup>
      <fonts>
        <font metr......
  [..]

In your FO file:

<fo:root [..] ps:printer="HP LJ8000">
  <fo:layout-master-set [..]>
    [..]
  </fo:layout-master-set>
  <fo:declarations>
    <ps:renderer-configuration>
      <ps:auto-rotate-landscape>true</ps:auto-rotate-landscape>
      <printer-setup name="HP LJ8000">
        <printer-def media-selection="mediapos">
          <paper-source name="Upper" mediapos="1"/>
          <paper-source name="Manual" mediapos="2"/>
          <paper-source name="Lower" mediapos="4"/>
          <paper-source name="LargeCapacity" mediapos="5"/>
        </printer-def>
        <media-map>
          <media master="form1" paper-source="Upper"/>
          <media master="letterhead" paper-source="Lower"/>
          <media master="plain" paper-source="LargeCapacity"/>
        </media-map>
      </printer-setup>
      
      <ps:fonts> <!-- adds additional fonts to the setup above if you want -->
        [..]
      </ps:font
    <ps:renderer-configuration>
  </fo:declarations>

Essentially, I'm splitting up the printer-setup into two parts:
printer-def contains the minimum info that would otherwise be found in a
PPD. It can either be inlined, or referenced by a URI for easy reuse.
The media-map defines the mapping between master-names and the media
selection code. Like this it defines the concrete setup of a particular
printer.

The ps:printer attribute on fo:root selects the concrete printer setup
for the document. I imagine this setting can also come from Java code as
a renderer option, depending on whether you prefer to control the whole
thing from the XML side or from the Java side.

Of course, the renderer-configuration element can also be included in
the IF, much like the ps:ps-setup-code extension element.

I've implemented something similar about 4 years ago, although for a
PostScript post-processing component. However, this already incorporates
lessons learned back then, although the example above is not complete.
There are printers which don't like the InputAttributes dictionary, for
example. This is not shown here.

> > 
> > 
> >>because the user has 2 steps to achieve tray selection instead of one.
> > 
> > 
> > I don't see two steps. The master-name is there anyway. If you're going
> > for hard-coded trays or media names is simply a choice (or depends on
> > the printer model). Maybe you see the media name to tray mapping as the
> > second step, but that's something that many operators do anyway.
> 
> By 2 steps I meant:
> 
> 1) the user creates a master name to media name mapping in the 
> configuration file
> 2) For some documents it's necessary to create an alternative 
> configuration in the FO or IF XML overriding the file.

Ah, I see.

> > 
> > 
> >>Isn't the objective behind your proposal to make life easier for the user?
> > 
> > 
> > Absolutely. By hiding implementation details from him. The current PS
> > extension requires quite a bit of knowledge about PostScript.
> > 
> > I think we also have to be aware that not everyone is going to work with
> > the IF. Hey, Chris, you're a power-user! 
> 
> :) True, I guess.
> 
> > Not everyone is. I'm trying to
> > address that but I'm not sure I'm succeeding. Maybe I want too much once
> > more, while something easy such as the existing PS extension is
> > everything people need. The equivalent to that for PCL would probably be
> > a simple extension attribute on simple-page-master: pcl:paper-source="1"
> > to select the upper tray as per the printer's documentation. If people
> > prefer that, ok. It's certainly less work than what I have in mind.
> 
> Well, that's my preference, but let's see what some of the other 
> committers think. I'm certainly happy to compromise and make it slightly 
> harder for power users if it makes it a bit easier for regular users.

I'll let the above sink in a little. It's probably a little more work
than I expected at first to implement the above system. After some good
night's sleep I think it's probably best to simply use the most simple
system for now and do the luxury version when there's concrete demand.
:-)


Jeremias Maerki

Reply via email to