1

Is there a way I could convert PDF pages into images, but the final output to still be a PDF (containing the images as pages)?

The reason for this is to prevent text copying on iOS devices (apparently permissions are not set correctly for iOS).

I am currently using iTextSharp to handle the PDF (encryption, setting permissions).

Amedee Van Gasse
  • 7,280
  • 5
  • 55
  • 101
Marius Popa
  • 564
  • 1
  • 5
  • 22
  • Use Ghostscript and the pdfimage devices. Either pdfimage8 (gray), pdfimage24 (RGB) or pdfimage32 (CMYK) renders the incoming content (from whatever source language, (PostScript,. PDF, PCL, PXL, XPS) to an image and then wraps that image into a PDF file. You can have all pages in one file or use %d in the output filename to get each page as a separate file. Use -r (resolution) to define the resolution of the output image. – KenS Nov 08 '19 at 14:06
  • Do you have an example on how to use this? My solution is developed in .NET Core and hosted on Linux environments. – Marius Popa Nov 09 '19 at 09:37
  • The only example I could give you would be a Ghostscript command line from a shell; "gs -sDEVICE=pdfimage24 -sOutputFile=out.pdf input.pdf". There's a ghostscriptsharp and a Ghostscript.NET, neither of which are from Artifex so I can't say much about them. I've no clue how you;'d go about using either of those on Linux. – KenS Nov 09 '19 at 13:24
  • Does this answer your question? [Use Ghostscript to convert each page of a PDF to images and the output is still PDF](https://stackoverflow.com/questions/68117298/use-ghostscript-to-convert-each-page-of-a-pdf-to-images-and-the-output-is-still) – samm Aug 10 '22 at 07:56

0 Answers0