vardomskiy (vardomskiy) wrote,

xpdf 3.04 and password protected PDFs / xpdf 3.04 и зашифрованные PDF файлы

For what it's worth, the old patch for xpdf 3.0 still works with version 3.04 with minimal modifications.

All it does, is ignores the settings of the owner password is the user password is not set, allowing one to print or convert PDF file to text, PostScript file, etc.

Старый патч для xpdf 3.0 без особых проблем продолжает работать с xpdf 3.04, и позволяет печатать или конвертировать PDF файлы у которых стоит пароль владельца, но нет пароля для пользователя.

--- xpdf-3.04/xpdf/ 2014-09-17 13:29:34.000000000 -0400
+++ xpdf-3.04/xpdf/ 2014-09-17 13:47:07.000000000 -0400
@@ -958,19 +958,19 @@
 GBool XRef::okToPrint(GBool ignoreOwnerPW) {
-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permPrint);
+  return gTrue;
 GBool XRef::okToChange(GBool ignoreOwnerPW) {
-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permChange);
+  return gTrue;
 GBool XRef::okToCopy(GBool ignoreOwnerPW) {
-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permCopy);
+  return gTrue;
 GBool XRef::okToAddNotes(GBool ignoreOwnerPW) {
-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permNotes);
+  return gTrue;
 Object *XRef::fetch(int num, int gen, Object *obj, int recursion) {
Tags: adobe, broken by design, fuckyou, pdf

  • Netgear GS724T v3 switch - VLANs and serial port

    Начальство одного из обектов решило сэкономить и закупило Netgear GS724Tv3 switch. Этот коммутатор достаточно глючный. Моя рекоммендация не покупать…

  • DMCA takedown of NetApp related posts

    If you are one of the people wondering what happened to my NetApp related posts, here is your answer. While I was away and traveling, I received the…

  • Decrypting PDFs using GhostScript

    For what it's worth, you can use GhostScript to convert encrypted PDFs that have owner password set (but do not have open password set) to…

  • Post a new comment


    default userpic

    Your reply will be screened

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.