Skip to main content
Participant
February 11, 2014
Question

Create PS file from PDF and defining different trays for different pages

  • February 11, 2014
  • 1 reply
  • 4175 views

Hi,

I have a PDF file with two kinds of pages: text and labels. I want to print the text pages on paper from a specific printer tray and the labels to another.

I was thinking that the right way to do this was to create a PS file from that PDF and edit it, adding information that defined the tray choice for the different pages.

On the PS file that I created, I noticed a line at the beginning of each page that may be related to what I need:

<< /MediaPosition 3 /TraySwitch false >> setpagedevice 

Is it possible? If so, how can I do it?

Please help!

This topic has been closed for replies.

1 reply

Participating Frequently
February 11, 2014

TraySwitch is level 3 and it is for the case when you run out of media. Look for something similar

to the %%Page lines and add your setpagedevice code there.  Below shows tray 3 for page 1

and tray 2 for page 2. Commented out you could also pick for example based on page size.

There are other options like MediaColor MediaType etc. you can use. Look in your printers PPD

file or manual.

%%BeginPageSetup

%%Page: 1 1

<<

  /MediaPosition 3

% /PageSize [792 1224]

>> setpagedevice

%%EndPageSetup

% many lines of your original file between the pages

%%BeginPageSetup

%%Page: 2 2

<<

  /MediaPosition 2

% /PageSize [612 792]

>> setpagedevice

%%EndPageSetup

chiapaAuthor
Participant
February 11, 2014

Thanks for your reply,

I'll try to make something out of it. The big problem is I can't test it myself, since the solution is for a client that requested it, and they have to test it themselves, on their printers. I may need their printer specifications, and tray numbers or whatever... I don't know.

Can you give me an example on how to define the tray for a specific page? Or a printer?

By setting "MediaPosition" I'm selecting the tray? Is that it?

Thanks

Participating Frequently
February 11, 2014

% this example pulls page 1 from tray 3 and page 2 from tray 4

%%Page: 1 1

<<

  /MediaPosition 3

>> setpagedevice

%%Page: 2 2

<<

  /MediaPosition 4

>> setpagedevice

% this example pulls page 1 from tray 3 and page 2 from manual feed tray 4

%%Page: 1 1

<<

  /MediaPosition 3

>> setpagedevice

%%Page: 2 2

<<

  /MediaPosition 4

/ManualFeed true

>> setpagedevice

% this example picks letter size for page 1 and ledger size for page 2

%%Page: 1 1

<<

  /PageSize [612 792]

>> setpagedevice

%%Page: 2 2

<<

  /PageSize [792 1224]

>> setpagedevice

% this example picks green media  for page 1 and white for page 2

%%Page: 1 1

<<

  /MediaColor (white)

>> setpagedevice

%%Page: 2 2

<<

  /MediaColor (green)

>> setpagedevice

For all these cases if you don't have what you ask for e.g. green media it may error or sub in a new color depending on the policy.

It may also error if e.g. you ask for letter size media but your job is A4 size.