Skip to main content
Participant
April 29, 2008
Question

Page-independence detection

  • April 29, 2008
  • 5 replies
  • 1213 views
Is there a utility to which I could submit a PostScript file where the utility could determine whether the PS code is page-independent (DSC conformant, or whatever it's supposed to be called)? I work in a digital print environment, and although PDF/X is great, sometimes I get PS, and I'd like to know ahead of time if my printer's front end has the resources to parse the code.

Is there also a utility that can convert non-compliant PS code to DSC-compliant?

Thank you.
This topic has been closed for replies.

5 replies

Participant
April 30, 2008
BTW, there are save-restore pairs in both PostScript files. I'm not a PostScript programmer. I'm just breezing through the Red Book, trying to come up to speed on this. I was hoping the save-restore would help me narrow down the differences between page-independent and monolithic (what's the appropriate jargon for this?) PostScript.
Participating Frequently
April 30, 2008
Can't tell much from the presence of save-restore. It really is a
complicated or unsolvable problem in the general case.

Just consider this case:

%%Page: 1
/something .... def
....
%%Page: 2
something

This is not page independent. However, it may not be a def. Could be
(and often is) a downloaded font definition, perhaps in binary.

Aandi Inston
Participant
April 30, 2008
Looking at my two Microsoft PostScript outputs, both have the %%PageOrder command. One has a value of ascending and the other is special. According to the Red book, special means you can't reorder the pages.

Is it safe to assume that the absence of the PageOrder command or the presence of %%PageOrder: Special pretty much assures that the PostScript is not page independent?

Does the presence of the command and a value of Ascend or Descend assure page independence, or at least support a high probability?
Participating Frequently
April 30, 2008
>Is it safe to assume that the absence of the PageOrder command or the presence of %%PageOrder: Special pretty much assures that the PostScript is not page independent?

I haven't looked it up but I would imagine the default for %%PageOrder
(if it is missing) would be ascending.

Aandi Inston
Participant
April 29, 2008
I suppose I shouldn't be surprised that after printing your last post to
file using the MS PostScript drivers, once optimized for speed and then
optimized for portability, both files start with %!PS-Adobe-3.0.

Do you have any aspirin?
Participating Frequently
April 29, 2008
This is a well known deficiency of the Windows PostScript driver.
However, did you check for a %%PageOrder: ?

Aandi Inston
Participant
April 29, 2008
I thought that %!PS was required at the beginning of any PostScript file, the "magic number" to tell the printer that it's a PostScript file, so it knows how to interpret it.

Still unsure about page-independence so we don't roll over and play dead on page 15,237 out of 60,000.
Participating Frequently
April 29, 2008
>I thought that %!PS was required at the beginning of any PostScript file

No. A PostScript file is a piece of programming language, and has no
special prefix needs.

However, %! (two characters) is recommended. This is a comment and
irrelevant to the PostScript, but it does match the magic number.

%!PS-Adobe is the magic for a DSC PostScript file.

%!PS is often quoted as being "magic" but it has no special meaning;
it therefore resolves to %! as above.

Aandi Inston
Participating Frequently
April 29, 2008
Well, a PostScript file that is DSC compliant should start with the
characters

%!PS-Adobe

This will mean it is page independent unless the header contains
certain varieties of %%PageOrder: value.

So, that is what the file tells you. To actually verify whether the
file is telling the truth is fantastically hard, possibly impossible:
an advanced computer science problem in provability. That's not the
same as saying there may not be specific cases that can be detected.

Aandi Inston