Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7164675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:06:52+00:00 2026-05-28T14:06:52+00:00

I’m writing an application that faxes a document (many supported types) provided by the

  • 0

I’m writing an application that faxes a document (many supported types) provided by the end user. A requirement is that the end user can also provide text to be used as part of a custom fax header.

I’ve been using Ghostscript to render PDFs as TIFFs and it’s been working great so far, but I have yet to find a straightforward way of overlaying the custom header at the top of a PDF. I’ve tried out a few recommendations:

  • How can I make a program overlay text on a postscript file?
  • How can I add a footer to the bottom of each page of a postscript or pdf file in linux?
  • Add comments to PDF files automagically with regular expressions
  • Stamp PDF file with control for position of stamp file

… with no luck.

I’ve used ImageMagick to do this successfully with documents rendered to TIFF via other tools, and I’m aware that ImageMagick can render PDF-to-TIFF on its own. However, I want to stick with Ghostscript because in my experience it has performed better and rendered clearer TIFFs.

Is this possible using Ghostscript and perhaps a PS helper script?

Edit:

Ghostscript (v9.04) is not throwing any errors. For example:

gswin64c -dSAFER -dBATCH -dNOPAUSE -dPDFFitPage -sDEVICE=tiffg3 ^
    -sOutputFile=goofy.tif ^
    -c "/Courier findfont 12 scalefont setfont 50 765 moveto (header text) show" ^
    -f goofy.pdf

… produces a TIFF of the original PDF, but without the text I tried to add. If I append showpage to the postscript one-liner it (predictably, I suppose) prints a new, blank-except-for-header page, which doesn’t help me much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:06:52+00:00Added an answer on May 28, 2026 at 2:06 pm

    I would use another commandline tool combined with Ghostscript for this task. This tool is pdftk.exe. Then use a 3 step approach:

    1. The task of Ghostscript would be to create an (otherwise empty) page with the header text:
      gswin64c.exe ^
        -o header.pdf ^
        -sDEVICE=pdfwrite ^
        -c "/Courier findfont 12 scalefont setfont" ^
        -c "50 765 moveto (header text) show showpage"
      
    2. The task of pdftk would be to overlay (stamp or background) the PDF file with the text header over the original PDF:
       pdftk.exe goofy.pdf background header.pdf output goofy-with-header.pdf

      or

       pdftk.exe goofy.pdf stamp header.pdf output goofy-with-header.pdf
    3. The last step is to employ Ghostscript again in order to create your final TIFF output:
      gswin64c.exe ^
         -dPDFFitPage ^
         -o goofy-with-header.tif ^
         -sDEVICE=tiffg3 ^
          goofy-with-header.pdf
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.