Sec, blogmal! - patches - xpdf

Categories:

Everything

Januar '17

MoMoMoMoMoMoMo
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

Archive:

Sat, 10 Sep 2005

xpdf and copy&paste

Some time ago, a collegue of mine wanted to copy a few sentences from an pdf document he found on the web. Unfortunately the document was protected, so acrobat reader disabled copy&paste.

When he asked for some help, I replied that if he had used some open source viewer like xpdf he wouldn't have had that problem.

Well. As I quickly found out, this was untrue. The author(s) of xpdf had somehow gotten convinced to honor the "protection"-flags of pdf documents.

I spent some time (much more than it would have taken to retype these three sentences) understanding the source, and finally came up with a single-line patch to restore full functionality of xpdf.

Simply apply the following patch and feel unrestricted again.

--- xpdf/XRef.cc.org	Thu Jan 22 02:26:45 2004
+++ xpdf/XRef.cc	Fri Apr 29 12:15:57 2005
@@ -803,6 +803,7 @@
   // this flag has to be set *after* we read the O/U/P strings
   encrypted = encrypted1;
 
+  permFlags = defPermFlags;
   return ret;
 }
 #else

– Sec


posted at: 23:55 | Category: /patches | permanent link to this entry | 1 comment (trackback)
 

Your Comment
 
Name:
URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Comment:
Save my Name and URL/Email for next time
(Note that comments will be rejected unless you enter 42 in the following box: )

powered by blosxom
in 0.00 s