GNU bug report logs -
#33684
DocView bombs out upon password protected PDFs
Previous Next
Full log
View this message in rfc822 format
Federico Tedin <federicotedin <at> gmail.com> writes:
Hi Federico,
> Here's the new version of the patch, which enables using MuPDF to open
> password-protected PDF files.
>
> One problem I encountered while writing it is that function
> `doc-view-pdf->png-converter-mupdf' uses a small hack to add "draw" to
> the arguments list passed to `doc-view-start-process', only when
> `doc-view-pdfdraw-program' has the value "mutool". This is because the
> "mudraw" command has been replaced at some point by the "mutool"
> command, which requires passing "draw" as a subcommand to do the same
> work. I ended up using the same hack in the new function I created,
> with a reference to the original one, but I'm not sure this was the
> best possible approach. Is there a cleaner way to solve this?
You could have extracted that into its own function, e.g.,
(defun doc-view-pdfdraw-program-subcommand ()
"Return the mutool subcommand replacing mudraw.
Recent mupdf distribution replaced mudraw with `mutool draw'."
(when (string-match "mutool[^/\\]*$" doc-view-pdfdraw-program)
'("draw")))
and use that at those two places.
Could you please commit the patch locally (including the ChangeLog style
commit message) and send it exported with "git format-patch"?
Bye,
Tassilo
PS: I had acually also accepted using the ghostscript password check
with mupdf, too. But since you don't need ghostscript for PDFs if you
have mupdf, your approach is even better.
This bug report was last modified 6 years and 102 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.