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

How do you "inject" PostScript properly into another PostScript job?

New Here ,
Jul 18, 2011 Jul 18, 2011

Copy link to clipboard

Copied

Hi all, Is there a standard or right way to inject multiple different PostScript streams into another one?

We are currently doing it in two different ways.

1)      As we programmatically build the “outer” PostScript stream and add pages we may decide to read a complete new PostScript stream from the file system and include it into our own. This inner PostScript is a complete PostScript program on its own and typically is produced by MS Word printing to a file. We may do this several times before completing our “outer” PostScript.  This method is used when we intend to send the PostScript to a physical printer device.

2)      Same as above, however we use the “Run” command.  We do this when converting from PS to PDF.  The PostScript interpreter has access to the file system in this case.

We have been doing this for several years and while it has worked for the most part, I can’t help wondering if we should be doing something differently, perhaps somehow saving the state of the outer PostScript before injecting the inner PostScript, and then restoring that state after the inner PostScript.  Any suggestions or comments would be helpful, thank you.

TOPICS
Programming

Views

681

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
Contributor ,
Jul 18, 2011 Jul 18, 2011

Copy link to clipboard

Copied

LATEST

Encapsulating the sub-streams of PostScript with a "save" and "restore" pair would be "good practice", and although it appears that you aren't having any issues, this practice would allow you to input sub-streams that did not clean up after themselves without causing the primary stream to fail or give erroneous results.

Both methods you are currently using would benefit from using save/restore.

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