Problem/Motivation

PDF files support links to URLs. Currently the module has two options for handling links

  • "Extract them" (put the URL in brackets after the link)
  • Remove them

It would be great if we can add a third option, to leave the links exactly as they are.

Proposed resolution

Convert the boolean field extract_links to be a 3-option field: extract/remove/none

CommentFileSizeAuthor
#2 printable.keep-links.3213802-2.patch2.68 KBadamps

Comments

AdamPS created an issue. See original summary.

adamps’s picture

Status: Active » Needs review
StatusFileSize
new2.68 KB
t_stallmann’s picture

+1 to this and the patch is working for me against v2.1.1.

nigelcunningham’s picture

Status: Needs review » Fixed

Thanks for the patch! Committed and will be in the next release.

adamps’s picture

Great thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sneakysnk’s picture

Hi,

EDIT: In the meantime, in the extractLinks method of PrintableFormatBase, I instanced a crawler and used his addContent to create the content the "right" way without filtering anything. I guess you'll want to put that in a proper method in the linkExtractor. Let me know if I can help with that.

Following that issue from t_stallmann
https://www.drupal.org/project/pdf_api/issues/3275815

I think that patch causes encoding problems (as stated, like it is utf8 encoded twice or something...).

In the extractLinks method, $content and $rendered_page are different (html entities look encoded in $rendered_page.
I honnestly don't know how to fix this properly (not even sure it's the real issue cause) but just wanted to let you know and get your opinion.

Thank you.