-2

Does anyone know a way to render or export a pdf with either the text or the images stripped out?

I noticed a way that uses GhostScript: https://stackoverflow.com/a/38010769/4437032

Unfortunately it would require me to get a commercial licence (since I intend to distribute).

The renderer I have been using up until now has been Pdfium, but that library has no capability to do this (without modifying the native code).

I also looked into PDFSharp, but it seems to be more for appending things to PDFs rather than removing things.

I cannot expect any kind of pdf editing software to be installed on machines that run my program, so ideally I'm looking for some free library.

Does anyone know of any solutions?

prw56
  • 326
  • 2
  • 12

1 Answers1

-1

I ended up using the free version of Spire.Pdf to accomplish my goal, using it to create pdfs with either text or images. The free version limits you to a max of 10 pages in processed pdfs, but that is acceptable for me.

No images: delete all the images using Spire.Pdf

No text: extract all the images using Spire.Pdf, draw them onto a blank pdf.

then display the modified pdfs.

prw56
  • 326
  • 2
  • 12