1

I can't Print the page or copy the text because it is for some reason encrypted downloading is not an option!

If I copy the following:

She is unapproachable

I get this when pasted in any program/app:

Zdn az ~gfppbfjdf`hn

The online PDF.

Similar questions like, Can't copy text from a pdf file do not fit in the description of my question, and I have been searching for 1 hour now.

Could anyone point me in the right direction?

Rafael
  • 115
  • 6
  • You will need to decrypt the pdf file in order to copy the contents of the pdf. – Ramhound Apr 25 '13 at 19:26
  • @Ramhound Not really; see my answer below. – Aaron Miller Apr 25 '13 at 19:30
  • The thing is, I can't download the file. The PDF is stuck up in the website, not even the browser view. as you can see at the link 'online PDF' – Rafael Apr 25 '13 at 20:19
  • Possible duplicate of/related to [PDF has garbled text when copy pasting](http://superuser.com/questions/137824/pdf-has-garbled-text-when-copy-pasting), http://superuser.com/questions/481493, http://superuser.com/questions/119393, http://superuser.com/questions/165073 ... – Karan Apr 25 '13 at 20:42
  • @Karan if you read my question again, it would be more clear for you to understand why it is related and not a duplicate. – Rafael Apr 25 '13 at 21:00
  • PDFs support user and owner passwords, and once you provide them you're free to view and copy text. What you're describing i.e. plain text shown but garbled text copied is not the result of encryption, but most likely a result of non-standard character encoding (see third question linked above i.e. 119393). PDFs can't magically encrypt plain text when you copy it to the clipboard. – Karan Apr 25 '13 at 22:21
  • This isn't actually a PDF. The web page uses a substitution cipher and a corresponding font that displays the correct characters. It's actually a somewhat interesting technique. – daxlerod Apr 26 '13 at 01:00
  • @AaronMiller - You suggested he decrypt the contents, I suggested, he decrypt the file. We basically suggested the samething. He didn't mention he doesn't have a physical copy of the pdf nor was the author of it. – Ramhound Apr 26 '13 at 11:02

1 Answers1

4

I don't have a solution for the question you're actually asking, that is, how to copy text and have it come out readable.

However! It looks from your example like the "encryption" here is a simple character substitution. This being the case, it wouldn't be too hard to pass the copied text through a filter to decrypt it and produce a readable result. For example, assume the following script called decrypt.pl:

#!/usr/bin/perl
use strict;

use utf8;
binmode STDIN, ':utf8';

my %map = (
           # from => to
           'z' => 's',
           'd' => 'h',
           'n' => 'e',
           'a' => 'i',
           '~' => 'u',
           'g' => 'n',
           'f' => 'a',
           'p' => 'p',
           '' => 'r',
           'b' => 'o',
           'j' => 'c',
           'd' => 'h',
           '`' => 'b',
           'h' => 'l',
           # other substitutions here
          );

while (my $line = <STDIN>) {
  foreach my $char (split(//, $line)) {
    my $upcase = (lc($char) eq $char ? 0 : 1);
    my $found = $map{lc($char)};
    if (!$found) {
      die "No substitution found for character '$char'\n";
    };
    $found = uc($found) if $upcase;
    print $found;
  };
};

If you copy whatever text you want from the PDF into a file called e.g. source, then execute cat source | perl decrypt.pl > destination, then the file destination will contain the decrypted content:

[user@host tmp]$ echo 'Zdn az ~gfppbfjdf`hn' > source
[user@host tmp]$ cat source | perl decrypt.pl > destination
[user@host tmp]$ cat destination
She is unapproachable
[user@host tmp]$ 
Aaron Miller
  • 9,782
  • 24
  • 39
  • You've point me in the right direction, I've made a decrypter for it, which worked + viewing the cached version (thanks to the google database) was also a great idea to copy the text. – Rafael Apr 25 '13 at 21:10