VERIFIED SOLUTION i

Vault paper stock "new mode" and Postscript

New mode was only available in the later versions of Vault, 6.0 forward
I want to set up emulated paper stock for Postscript.  What is the best way to go about doing this.
 
I'm a little confused about page 51 of the customizing Guide where it states:
 
Postscript settings
In PostScript backgrounds, PostScript cannot use TrayMode=Numbered/Named, and you do
not need to export backgrounds to the various GIF file sizes. As well, you do not need to have a
“hacked” PDF file for PDF backgrounds. Instead PostScript backgrounds are actually EPS files,
renamed to .PS in the ResourceSet folder.
Note: sometimes EPS backgrounds can interfere with the state of the Postscript engine and
cause display issues, experiementation is sometimes required to get it to work.
 
Does this mean that one can't use "new mode" for Postscript streams, or does it just mean that you can't use Numbered/Named if you are going to use a .ps/eps file for the backer (but you could if you are going to use PDF for the backer?)
 
page 175 of the Customizing Guide "new" PDF tray mode
 
New mode
To use different pages of a PDF file as background pages:
1. Add a TrayMode entry to Profiles.ini.
2. Add values for Tray.
3. Add a default entry to Tray
Add a TrayMode entry to Profiles.ini file
In the Profiles.ini file, add an entry for TrayMode and set the value to Numbered, for example:
TrayMode=Numbered. If TrayMode is not enabled, then the pages will be rendered as usual.
Add values for Tray
The value of Tray will specify the name of the background PDF file. For example,
Tray=PBBI.wmf implies that the background PDF file name is PBBI.pdf. This file should be
present in the \Default directory of the Render folder, where the product is installed. If this is
not available or the file name specified is incorrect, then pages will be rendered without the
background page merged.
Add the parameters for different background pages such as Tray1 for background page 1,
Tray2 for background page 2 and so on. Note that LAST and LAST1 key words can be used
inside parameter definitions. The LAST parameter means the last page of document pages, the
LAST1 means the (LAST-1)th page (the second page from the last page).Each of these
parameters should be assigned values corresponding to page numbers with which it has to be
merged; examples are as follows:
Tray1 = 5,6,7: implies background Page 1 will be merged with page numbers 5,6 and 7 at
the time they are being rendered.
Tray2=8-last:implies background page 2 will be merged for pages 8 until last, at the time of
rendering.
TrayN=even: indicates to use pages of even value. You can also use “odd” to indicate pages of
odd value.
Note: Only LAST and LAST1 can be used as keywords and LAST1 can only be used in a range
value (e.g. Tray1=2-last1).
Add a default entry to Tray
Add a TrayDefault entry which will correspond to a page that has to be used as a background
for a rendering page which does not have an entry in the previous parameters (Tray1, Tray2).
If there is neither (Tray-N) nor TrayDefault, then pages will be rendered as usual.




You can't use the new mode with Postscript at all so no TrayMode and no PDF backgrounds.
 
For Postscript you'd use EPS backgrounds with the following settings:
 
Tray=basename
Duplex=0
--> all: basename.ps
 
Tray=basename
Duplex=1
---> odd: basename.ps
---> even: basename-back.ps
 
Tray=basename
Duplex=2
---> 1st: basename.ps
---> rest: basename-body.ps
 
Tray=basename
no Duplex=
no /MediaType
no %%PageMedia:
--> all: basename.ps
 
no Duplex=
with /MediaType (alpha)
--> all: alpha.ps
 
no Duplex=
no /MediaType
with %%PageMedia: beta
--> all: beta.ps


Or another scenario, where you might want emulated paper stock with Postscript in such a way that there are three distinct backers:
 
page 1
page 2
all subsequent pages

This is not possible to achieve using the old mode outlined above.  Duplex alone won't allow for distinct backgrounds for pages 1/2/rest like that.
 
If there are MediaType or PageMedia directives in the stream we may be able to key off of that though.

for example:
 
It does have MediaType directives but there are some pages with multiple MediaType settings and that will likely prevent it form working as expected.
 
 
%%Page: 1 1
%%BeginPageSetup
%%PageBoundingBox: 0 0 612 792
%%PageOrientation: Portrait
<< /Duplex false >> setpagedevice
%%EndPageSetup
%DOC1 InstanceGUID=DEDC37765548C44480063FCC4AFFFF8A
<< /MediaType (Factura) /Duplex false>> setpagedevice
STARTP
...
ENDP
%%Page: 2 2
%%BeginPageSetup
%%PageBoundingBox: 0 0 612 792
%%PageOrientation: Portrait
%%EndPageSetup
STARTP
ENDP
%%Page: 3 3
%%BeginPageSetup
%%PageBoundingBox: 0 0 612 792
%%PageOrientation: Portrait
%%EndPageSetup
<< /MediaType (Factura) /Duplex false>> setpagedevice
<< /MediaType (Detalle) /Duplex true>> setpagedevice
STARTP
...
ENDP
 
 
If we set Tray=Default this stream will render the following background:
page 1: Factura.ps
page 2: Default.ps
page 3: Factura.ps
 
If the stream didn't have the duplicated setpagedevice commands we might be able to get page 3 to use Detalle.ps instead.
 
I think the duplicate setpagedevice is it's way of switching to a new front page.

 

 
UPDATED:  August 23, 2017