Ahmed, thanks for your post. Sorry in my haste to work on other things I didn't provide you with valid FO.. I should have tested it properly first, anyway here is the example I should have sent you..

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";
  xmlns:ps="http://xmlgraphics.apache.org/fop/postscript";>
  <fo:layout-master-set>
    <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" 
margin="2cm">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:declarations>
    <ps:ps-comment-before>%DocumentMedia: anything 595 842 0 MAIN 
()</ps:ps-comment-before>
    <ps:ps-comment-before>%+ anything 595 842 0 AUX ()</ps:ps-comment-before>
    <ps:ps-comment-before>%+ anything 595 842 0 MAG3 ()</ps:ps-comment-before>
    <ps:ps-comment-before>%+ anything 595 842 0 MAG4 ()</ps:ps-comment-before>
    <ps:ps-comment-before>%+ anything 595 842 0 MAG5 ()</ps:ps-comment-before>
  </fo:declarations>
  <fo:page-sequence master-reference="A4">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>Hello World!</fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

Your post did however help me to uncover a bug that was in the postscript renderer when more than one <ps:ps-comment-?/> element is present within an <fo:declaration/>, I will be submitting a patch shortly that will fix the problem in the FOP trunk.

Thanks again for raising the problem you experienced,

Adrian.

[EMAIL PROTECTED] wrote:
Hi Adrian, Hi Jeremias,

I tried what suggested Adrian and got following error:

[ERROR] FOTreeBuilder - javax.xml.transform.TransformerException:
java.lang.IllegalStateException: endElement() called for fo:root where
there is no current element.

I tried before to use ps-setup-code instead of ps:ps-comment-before. Like
this:
<fo:declarations>
  <ps:ps-setup-code name="MAIN"><![CDATA[ %%DocumentMedia: anything 595
842 0 MAIN ()
%%+ anything 595 842 0 AUX ()
%%+ anything 595 842 0 MAG3 ()
%%+ anything 595 842 0 MAG4 ()
%%+ anything 595 842 0 MAG5 ()]]>
  </ps:ps-setup-code>
</fo:declarations>
The xsl-fo trasform worked but I had this code on every page in the
generated PS (>4 GO for 18.000 pages).

For using DCS option, I understood (may be I am miss-understanding??) that
I should change some FOP Java Sources. I am not a Java specialist and my
customer has no java programmers at all! So it it is a forbidden solution.

Many Thanks.

A+. Ahmed HADDAD.

You're approaching a point where I would say that it's time to write a
PostScript post-processor. At least, that's what I always did in the
past when I had to do stuff like this. I'm unconfortable providing
plug-ins for every sort of possibility in the PS renderer. But you're
lucky since it's now relatively easy to write such a post-processor
since the whole framework for it is already found in XML Graphics
Commons which FOP uses.

See http://xmlgraphics.apache.org/commons/postscript.html#dsc

Jeremias Maerki



On 10.10.2007 12:12:02 ahaddad wrote:
Hi,

I remarked that among ps tags ("ps-setup-code", "ps-page-setup-code"
and "ps-setpagedevice") there is no one which allows to inject PS
instruction only once in the document. I have a case where following
code comes only at the beguinning of the ps file:

%%DocumentMedia: anything 595 842 0 MAIN ()
%%+ anything 595 842 0 AUX ()
%%+ anything 595 842 0 MAG3 ()
%%+ anything 595 842 0 MAG4 ()
%%+ anything 595 842 0 MAG5 ()

and not in every page.

The generated ps file is correctally opened by gsView for the moment:
I dont know yet if it will be "accepted" by Xerox printer. Anyway,
there is a risk that ps file will be enormous when programs will be
deployed...

A+. Ahmed HADDAD.

--------------------------------------------------------------------- To
unsubscribe, e-mail: [EMAIL PROTECTED] For
additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to