1

I downloaded the Linux Essentials PDF file from LPIC site, the link for which is https://www.linuxcertification.co.za/sites/default/files/linux-esentials-manual.pdf

I saved the PDF file on my system and opened it using Foxit PDF reader as well as Adobe reader. Now, when viewing the file in Chrome as a PDF, there are no Red boxes visible:

enter image description here

However when I view it in Foxit and Adobe, then these boxes show up:

enter image description here

What is causing this issue?

I tried converting the PDF file to word using online convertors and then converted the Word file to PDF. In most cases, the boxes were removed however the text alignment was distorted and few times even some grammatical error was seen.

I cannot rely on opening the file in Chrome all the time and wish to use either Foxit or Adobe reader to open the file. Any help would be appreciated.

5
  • These boxes are part of the PDF. Why Chrome does not render them is beyond me. Whether these boxes should appear is an option with hypertex, a LaTeX package.
    – Daniel B
    Commented Dec 17, 2017 at 12:04
  • @DanielB so how can i remove them?
    – John S
    Commented Dec 17, 2017 at 12:08
  • You cannot. Like I said: They’re part of the document. Well, you could remove each of them manually with a PDF editor, but that’s just not feasible.
    – Daniel B
    Commented Dec 17, 2017 at 12:18
  • @DanielB - so is there a way I can convert it to Word, preserve the alignment using open source software ? this way I can convert it back to PDF and have no red boxes
    – John S
    Commented Dec 17, 2017 at 12:23
  • PDF files cannot be converted to Word documents in a lossless manner. PDF offers many features that Word does not. Your best bet is to contact the authors mentioned in the document to request a version without boxes.
    – Daniel B
    Commented Dec 17, 2017 at 12:29

1 Answer 1

1

As a matter of fact, you can remove the borders, quite easily so because they are not in what makes up the PDF pages themselves. The borders are actually part of the link annotations that allow you to navigate the document. So for removing their appearance one just needs to adjust the appropriate PDF objects.

The document's license doesn't allow derivates to be distributed. So here is a script that uses HexaPDF to remove the borders from the link annotations:

require 'hexapdf'
doc = HexaPDF::Document.open(ARGV[0])
doc.pages.each {|page| page[:Annots]&.each {|a| a = doc.deref(a); a[:C] = nil; a[:Border] = [0, 0, 0]}}
doc.write(ARGV[0] + '.pdf', validate: false)

You need to install HexaPDF (gem install hexapdf, needs a working Ruby 2.4 installation), save this script as a Ruby file, for example remove_borders.rb and then run it like this:

ruby remove_borders.rb path/to/linux-essentials-manual.pdf

The output is a file with the same name but an additional .pdf attached, with the borders of the link annotations removed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .