When I try to store a link to a pdf file (opened with PDFView), I get the following error

Unable to percent escape character: \342

The link is stored with the following url:

Stored: file:/tmp/mozilla_chriad0/file.pdf::%PDF-1.6 %\324\343\317\323

When looking for a solution, I found the url-util package. I came up with the following:

(setq x "file:/tmp/mozilla_chriad0/file.pdf::%PDF-1.6 %\324\343\317\323")

(require 'url-util)

(setq y (url-encode-url x))

When I create a link with the content of y, which is [[file:/tmp/mozilla_chriad0/file.pdf::%PDF-1.6%20%%D4%E3%CF%D3]], the link works as intended.

My question: How can I hook into this process and convert the link to the right encoding so that the above error does not occur?


1 Answer 1


I assume that pdf-tools is installed and working. What you are asking for also requires the package org-pdfview which is available from melpa. In this package functions likeorg-pdfview-store-link are declared.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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