2

I would like to convert the vector pdf to raster pdf by using ghostscript(i.e. rasterized the vector pdf). But I cannot find the appropriate parameters to do so even if I add the resolution parameter -r300.

The code I used is -dSAFER -dBATCH -dNOPAUSE -dPDFSETTINGS=/screen -dGrap hicsAlphaBits=1 -sDEVICE=pdfwrite -r300 -sOutputFile="output-raster.pdf" "input-vector.pdf"

Anyone know how to rasterized the pdf?

CAL
  • 39
  • 5
  • 1
    Use Ghostscript to save to a raster format and pipe that back to Ghostscript to convert back to pdf. Or just use Imagemagick, since it always rasterizes an input PDF. – fmw42 Sep 22 '17 at 16:16
  • 1
    Thanks. But I would like to convert it by using ghostscript only. Any idea? or It is impossible for doing so by using ghostscript? – CAL Sep 25 '17 at 08:35
  • @CAL Any idea on this? Same problem here – Michael_mhr Feb 14 '22 at 11:02
  • Does this answer your question? [Compressing text heavy PDFs without ghostscript and only ImageMagik causes blurry text](https://stackoverflow.com/questions/23160191/compressing-text-heavy-pdfs-without-ghostscript-and-only-imagemagik-causes-blurr) – M-- Apr 25 '23 at 16:07

1 Answers1

0

You can use pdftocairo from the Poppler library. It can convert a PDF to a raster image format like PNG or JPEG. Then use any image viewer or imagemagick to convert the image to a PDF file if you need a PDF as output.

gettalong
  • 735
  • 3
  • 10
  • 1
    Thanks. But I would like to convert it by using ghostscript only. Any idea? or It is impossible for doing so by using ghostscript? – CAL Sep 25 '17 at 08:35