mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-30 22:13:48 +02:00
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)
This commit is contained in:
parent
541db88ebf
commit
36386d06cc
1 changed files with 2 additions and 7 deletions
|
|
@ -8,9 +8,8 @@
|
|||
__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 @@ def add_links(self):
|
|||
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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue