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.

  • 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 Dec 17 '17 at 12:04
  • @DanielB so how can i remove them? – John S Dec 17 '17 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 Dec 17 '17 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 Dec 17 '17 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 Dec 17 '17 at 12:29
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.