Search code examples
javapostscriptapache-xml-graphics

PSDocumentGraphics2D - how do I write a <</OutputType(Stacker)>>setpagedevice


I am using the PSDocumentGraphics2D class in the Apache™ XML Graphics Commons library to create a .PS file. Works great.

However I now need the ability to write the below commands at the start/end of a book:

<</OutputType(Stacker)>>setpagedevice
<</EndOfSet true/Jog 3>>setpagedevice
...
<</OutputType ()>>setpagedevice
<</EndOfSet false/Jog 0>>setpagedevice
...
<</OutputType(Stacker)>>setpagedevice
<</EndOfSet true/Jog 3>>setpagedevice

Where/how do I do that?

thanks - dave


Solution

  • Turns out it's easy. The call is:

    ((PSDocumentGraphics2D)graphics).getPSGenerator().writeln(command);
    

    This writes a line directly to the generated file.