How to convert TIFF to PDF using Ghostscript

6,632

Solution 1

Ghostscript doesn't support TIFF as an input, so you can't immediately use it to turn a TIFF file into a PDF. You might be better to use an image editing application such as ImageMagick.

For anyone who wishes to persist, it is possible to read a TIFF file by writing a PostScript program, which Ghostscript is able to run (because it is a PostScript interpreter). See this question on Stack Overflow:

https://stackoverflow.com/questions/15211428/conversion-tif-to-pdf-ghostscript

Solution 2

Is there any particular reason for using Ghostscript?

If you have gs installed, you very probably also have Image Magick's convert command. This article discusses some aspects of the quality factor and how to maintain a reasonable output size.

Also consider the possibility that, if the input file is technical (i.e. drawings) you might consider tracing the input and doing a conversion to a real vector image, which would create a much smaller PDF.

Share:
6,632

Related videos on Youtube

Kurt Pfeifle
Author by

Kurt Pfeifle

Updated on September 18, 2022

Comments

  • Kurt Pfeifle
    Kurt Pfeifle over 1 year

    How can I convert TIFF to PDF using Ghostscript?

    I tried to use the code below but it not working:

    Snippet

    $input_file_tif='test.pdf';
    $input_file_orig_name='1234.tiff';
    $gs_command = "gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=tiffg3 -r300x300 \
                      -sOutputFile='".$input_file_tif."".$input_file_orig_name."' ";