Removing Background Layers from Pdfs?
#1  MarjaE 06-18-2020, 03:07 PM
Some pdfs include background layers which can obscure foreground text. All this can slow pdf loading, increase file sizes, and interfere with reading. My preferred pdf reading software can't hide layers, and the Kindle Dx's can't either.

I have coordination issues, and use scrolling software, which get interpreted as trackpad or scrollwheel actions. I also have sensory issues, and certain animation, such as smooth scrolling and zooming, can trigger my migraines.

Acrobat Reader isn't an option, since, at least in reponse to my scrolling software, it imposes smooth scrolling.

Pdf Studio Free isn't a great option, since it interprets it as zooming. I can open pdfs in it, hide layers, and print to a new pdf without text info. That suggests a multi-step process with Coherent PDF to blacken text, Pdf Studio Free to export a version without the extra layers, possibly Willus's k2pdfopt to reduce the output size, and either Willus's k2pdfopt or OCRmyPDF to rebuild the text info.

Ghrostscript isn't a great option either. -dFILTERIMAGE -dFILTERVECTOR can remove all images, including the backgrounds, but it sometimes screws with the page layout, and of course it loses any text which had been rendered as an image, as well as other images which didn't get in the way.

GS9 Color Management implies that Ghostscript *can* turn all text black, so that lighter text will be visible, but it doesn't say how. Otherwise Coherent PDF can do that, in an extra step.

There's got to be a better way...

#2  phillipgessert 06-18-2020, 04:27 PM
If I remember correctly, Adobe Acrobat (not Reader) can separate vector, raster, and text into layers as a preflight routine. I'm not sure if you can then easily trash the non-text layers, but it's at least a start.

#3  MarjaE 06-18-2020, 05:52 PM
Due to the scrolling issues, I can't use Adobe Reader. I doubt I would be able to use Adobe Acrobat, and I don't think I can afford it either.

#4  phillipgessert 06-18-2020, 06:29 PM
Quote MarjaE
Due to the scrolling issues, I can't use Adobe Reader. I doubt I would be able to use Adobe Acrobat, and I don't think I can afford it either.
Sorry, I didn't really explain what I meant. Acrobat could be used to help trash non-text layers, and you could then save the PDF and read it with the reader of your choice. Moot since you don't have access to Acrobat, though.

#5  MarjaE 06-19-2020, 11:04 PM

1. Identify problem layers using PDFStudio Viewer. (Acrobat Reader could also work, depending.)

2. Duplicate the source pdf. Open it with TextEdit. (Another text editor could also work.)

3. Search for OCProperties. This will list numerical codes under OFF, ON, or other settings, with 0 R after each number.

4. Search for Name(x) where x is one of the names of the problem groups from step 1. You should find a list with numbered objects.

5. Note which numbers correspond with which problem groups. Move the corresponding numbers and 0 R from the ON list to the OFF list.

6. Save.

7. Open.

It gets more complicated if you want to track down specific items to move between OFF and ON OCGs.

But... this doesn't require specialized pdf editing software after all.

P.S. The output may not work well with Ghostscript, but it works well with k2pdfopt.

Today's Posts | Search this Thread | Login | Register