From 36386d06cc954909a173736f1e08a6460084ef0f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 3 Jul 2013 14:42:08 +0530 Subject: [PATCH] PDF Output: Fix mangling of links PDF Output: Fix links that point to URLs with query parameters being mangled by the conversion process. Fixes #1197006 [Broken links in PDF in Adobe reader.](https://bugs.launchpad.net/calibre/+bug/1197006) --- src/calibre/ebooks/pdf/render/links.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/calibre/ebooks/pdf/render/links.py b/src/calibre/ebooks/pdf/render/links.py index 500bbbf6c1..6ec7c500a8 100644 --- a/src/calibre/ebooks/pdf/render/links.py +++ b/src/calibre/ebooks/pdf/render/links.py @@ -8,9 +8,8 @@ __copyright__ = '2012, Kovid Goyal ' __docformat__ = 'restructuredtext en' import os -from future_builtins import map -from urlparse import urlparse, urlunparse -from urllib2 import quote, unquote +from urlparse import urlparse +from urllib2 import unquote from calibre.ebooks.pdf.render.common import Array, Name, Dictionary, String @@ -84,10 +83,6 @@ class Links(object): action = Dictionary({ 'Type':Name('Action'), 'S':Name('URI'), }) - parts = (x.encode('utf-8') if isinstance(x, type(u'')) else - x for x in purl) - url = urlunparse(map(quote, map(unquote, - parts))).decode('ascii') action['URI'] = String(url) annot['A'] = action if 'A' in annot or 'Dest' in annot: