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

How to pass PS header data to pdfmark?

Engaged ,
May 27, 2011 May 27, 2011

Copy link to clipboard

Copied

Hope this is the right place for this question:

I currently use a bit of PostScript in Distiller's epilogue.ps file to add my name as "Author" to all my PDFs as they are distilled:

[ /Author (My Name) /DOCINFO pdfmark

So far, so good.

Now what I want to do is automatically pass the data in the header of the PostScript file (such as %%Title, %% Creator) to the epilogue file.

e.g. something like this:

[ /Title TitleVariable /DOCINFO pdfmark

so that a .ps file with a header line

%%Title: My File.file

becomes a PDF file with Title: My File.file

Is this possible?

Hope this makes sense.

At the moment, the three "main" PDF metadata fields are always empty, and it's a pain having to fill them manually.

TOPICS
Programming

Views

781

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 ,
May 27, 2011 May 27, 2011

Copy link to clipboard

Copied

LATEST

I don't think that standard PostScript interpreters parse the comment lines automatically so that you would have populated variables/strings available to your PostScript program after the %%EndComments line. (maybe Dov Isaacs knows for sure).

One alternative would be to add at the end of your epiloque a procedure that reads lines in from "currentfile" as strings until "%%EndComments" is found and parses the strings (looking for strings that start with "%%Creator:", "%%Title", etc. and defining your own variables based on the value portion of the strings.

Redbook example of currentfile useage:

/str 100 string def

currentfile str readline

here is a line of text

pop /textline exch def

You would have to be a little bit fancier than this but I hope the concept makes sense.

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