• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Page-independence detection

New Here ,
Apr 29, 2008 Apr 29, 2008

Copy link to clipboard

Copied

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.
TOPICS
Programming

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 29, 2008 Apr 29, 2008

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 29, 2008 Apr 29, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 29, 2008 Apr 29, 2008

Copy link to clipboard

Copied

>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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 29, 2008 Apr 29, 2008

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 29, 2008 Apr 29, 2008

Copy link to clipboard

Copied

This is a well known deficiency of the Windows PostScript driver.
However, did you check for a %%PageOrder: ?

Aandi Inston

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2008 Apr 30, 2008

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 30, 2008 Apr 30, 2008

Copy link to clipboard

Copied

>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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2008 Apr 30, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 30, 2008 Apr 30, 2008

Copy link to clipboard

Copied

LATEST
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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines