Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to remove restrictive permissions from a PDF file (on Linux)

3,784 views
Skip to first unread message

Dennis O'Neill

unread,
Dec 6, 2014, 10:20:05 PM12/6/14
to
I can remove restrictive permissions on Windows but how do you
best remove overly restrictive PDF permisions on Linux?

I'm using the test-creation web site below to create tests:
http://www.problem-attic.com

Unfortunately, that test-creation web site creates problematic PDFs
in that they cannot be concatenated by the web site itself.

When I tried to concatenate the PDFs that it created, I found that
they are printable, but all other permissions are restricted by a
password that the site must create (as it's not "my" password that
it used.

While it makes sense that you wouldn't want to change a test PDF,
I want to concatenate multiple PDFs and change the number of the
test questions so that they flow as if they were all together.

While I can remove PDF permissions on Windows using Ghostscript,
GSView, and ps2edit, I don't know to do so on Linux.

Do you know an easy way to remove restrictive PDF permissions on Linux?

Axel Berger

unread,
Dec 7, 2014, 7:57:25 AM12/7/14
to
Dennis O'Neill wrote:
> password that the site must create

Who or what writes and compiles the PDFs inthe first place? "The site"
ist not precise enough for a sensible start. Don't attempt to remove
those restictrictions, stop them from being set.

Axel

Nomen Nescio

unread,
Dec 7, 2014, 9:51:24 AM12/7/14
to
> Do you know an easy way to remove restrictive PDF permissions on Linux?

pdftk might do the job.. it can create RC4-encrypted PDFs, so it
should be able to remove the encryption as well.

If the document is AES-encrypted, then pdftk won't work.

Dennis O'Neill

unread,
Dec 7, 2014, 10:56:18 AM12/7/14
to
Axel Berger wrote, on Sun, 07 Dec 2014 13:56:56 +0100:

> Who or what writes and compiles the PDFs inthe first place? "The site"
> ist not precise enough for a sensible start. Don't attempt to remove
> those restictrictions, stop them from being set.

Clearly, the PDF is created by the software running underneath the web
site. Since you don't have a login to the web site, allow me to explain
how it works (as it's a simple site, overall).

1. You log into the web site
2. You navigate to a section (e.g., science, math, etc.)
3. You select a sub section (e.g., the elements, complex numbers, etc.)
4. You select a set of questions (out of many hundreds available)
5. You hit a button and voila, a test PDF is created, with an answer key.

The site is simple. It's strength is that it contains thousands of
questions and multiple-choice answers from grades K-12 from which to
choose our questions and that it formats & creates the test and
answer key for us, once we select the desired questions.

The biggest weakness of the web site is that it is utterly atrocious
when it comes to its use model or options or even stability.

In a way, it's good that there isn't anything else you can do
because the site has so very few buttons and zero options, that
you really can figure it out quickly.

For example, while you can *copy* one test to another, you can't
concatenate them. You can't edit (i.e., change) the questions either,
and the output choice is PDF or nothing. There aren't many buttons,
and there are no settings, so, it's not like there's anything hidden
that I missed.

Since I have a lot of experience with PDF, I know it is trivially easy
to convert the resulting PDF to Microsoft Word or to Powerpoint, but,
after doing that, the age-old problem that the conversion isn't
perfect comes up. Sure, I can edit the heck out of the mangled
results, but this two-column formatted test output is particularly
mangled, such that *every* question needs extensive editing.

So, simply converting to Word, while it will work, isn't feasible
over the long run.

My current goal is to create a matched test and study guide,
each with 60 questions in it. So, I create a test of matched
pairs, of 120 questions.

a. I make two copies of that 120-question set of matched pairs.
b. One copy is called the test, the other is the study guide.
c. I then delete all the even questions in the test, and,
d. I delete all the odd questions in the study guide

Now I have a matched set of questions for the test & study guide.
However, the web site is such that working on 120 questions is
cumbersome.

So, it's easier to work with 10 or 20 questions and concatenate.
That would be easy if I could concatenate the PDF output.
But, the permission is such that I can't edit the output PDF.

As I said, I *know* how to remove permissions on Windows:
1. Install GPL Ghostscript 9.00 for 32-bit Windows (gs900w32.exe)
http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs900/gs900w32.exe
2. Install GSview release v4.9 Win32 self extracting archive (gsv49w32.exe)
http://mirror.cs.wisc.edu/pub/mirrors/ghost/ghostgum/gsv49w32.exe
3. Install ps2edit (pstoeditsetup350.exe)
http://prdownloads.sourceforge.net/pstoedit/pstoeditsetup350.exe?download
4. Bring up GSView by clicking on its shortcut
5. File->Open->protected_pdf_file.pdf
6. File->Convert (pdfwrite, 600dpi, all pages, ok)

While that works, all I'm asking is how to remove permissions on Linux.

Does anyone know how to remove PDF permissions on Linux?

Thomas Kaiser

unread,
Dec 7, 2014, 11:15:03 AM12/7/14
to
Dennis O'Neill wrote in <news:m61tb0$vcc$1...@solani.org>
> Does anyone know how to remove PDF permissions on Linux?

Depends on whether user or owner password ist set. And this is also
the simple key for a web search leading you to tons of explanations:

https://duckduckgo.com/?q=remove+owner+user+password+pdf+linux

Regards,

Thomas

William Unruh

unread,
Dec 7, 2014, 11:16:23 AM12/7/14
to
On 2014-12-07, Dennis O'Neill <don...@aol.is.invalid> wrote:
> Axel Berger wrote, on Sun, 07 Dec 2014 13:56:56 +0100:
>
>> Who or what writes and compiles the PDFs inthe first place? "The site"
>> ist not precise enough for a sensible start. Don't attempt to remove
>> those restictrictions, stop them from being set.
>
> Clearly, the PDF is created by the software running underneath the web
> site. Since you don't have a login to the web site, allow me to explain
> how it works (as it's a simple site, overall).
>
> 1. You log into the web site
> 2. You navigate to a section (e.g., science, math, etc.)
> 3. You select a sub section (e.g., the elements, complex numbers, etc.)
> 4. You select a set of questions (out of many hundreds available)
> 5. You hit a button and voila, a test PDF is created, with an answer key.

Ah, it is a test for students, not a test of pdf. Sorry that confused
me.
I guess there are enough questions, that even if the students got an
account on the web site and got the answers to all the questions it
would not matter (they would have a pretty good grasp of the material).
>
> The site is simple. It's strength is that it contains thousands of
> questions and multiple-choice answers from grades K-12 from which to
> choose our questions and that it formats & creates the test and
> answer key for us, once we select the desired questions.
>
> The biggest weakness of the web site is that it is utterly atrocious
> when it comes to its use model or options or even stability.
>
> In a way, it's good that there isn't anything else you can do
> because the site has so very few buttons and zero options, that
> you really can figure it out quickly.
>
> For example, while you can *copy* one test to another, you can't
> concatenate them. You can't edit (i.e., change) the questions either,
> and the output choice is PDF or nothing. There aren't many buttons,
> and there are no settings, so, it's not like there's anything hidden
> that I missed.
>
> Since I have a lot of experience with PDF, I know it is trivially easy
> to convert the resulting PDF to Microsoft Word or to Powerpoint, but,
> after doing that, the age-old problem that the conversion isn't
> perfect comes up. Sure, I can edit the heck out of the mangled
> results, but this two-column formatted test output is particularly
> mangled, such that *every* question needs extensive editing.
>
> So, simply converting to Word, while it will work, isn't feasible
> over the long run.

I have not tried it, but might libreoffice work better than Word?

>
> My current goal is to create a matched test and study guide,
> each with 60 questions in it. So, I create a test of matched
> pairs, of 120 questions.
>
> a. I make two copies of that 120-question set of matched pairs.
> b. One copy is called the test, the other is the study guide.
> c. I then delete all the even questions in the test, and,
> d. I delete all the odd questions in the study guide
>
> Now I have a matched set of questions for the test & study guide.
> However, the web site is such that working on 120 questions is
> cumbersome.
>
> So, it's easier to work with 10 or 20 questions and concatenate.
> That would be easy if I could concatenate the PDF output.
> But, the permission is such that I can't edit the output PDF.
>
> As I said, I *know* how to remove permissions on Windows:
> 1. Install GPL Ghostscript 9.00 for 32-bit Windows (gs900w32.exe)
> http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs900/gs900w32.exe
> 2. Install GSview release v4.9 Win32 self extracting archive (gsv49w32.exe)
> http://mirror.cs.wisc.edu/pub/mirrors/ghost/ghostgum/gsv49w32.exe
> 3. Install ps2edit (pstoeditsetup350.exe)
> http://prdownloads.sourceforge.net/pstoedit/pstoeditsetup350.exe?download
> 4. Bring up GSView by clicking on its shortcut
> 5. File->Open->protected_pdf_file.pdf
> 6. File->Convert (pdfwrite, 600dpi, all pages, ok)
>
> While that works, all I'm asking is how to remove permissions on Linux.

Well, all of those programs also exist on Linux so presumably you could
just do the same on Linux as on Windows.
packages ghostscript, gv, pstoedit.
on my Mageia3 install.

Dennis O'Neill

unread,
Dec 7, 2014, 1:57:19 PM12/7/14
to
William Unruh wrote, on Sun, 07 Dec 2014 16:16:05 +0000:

> Ah, it is a test for students, not a test of pdf.
> Sorry that confused me.

I am sorry for not being clear. Yes, it is a test I'm creating for
the final exam for Algebra 1 and 2 for students in high school.

I'm actually helping someone else create that test, but, that's
not an important criterion.

What matters, for this topic, is that the file that is output
by the http://www.problem-attic.com is a somewhat-protected PDF,
which allows printing, but nothing else.

What also matters is that the web site is extremely limited in
terms of formatting and editing of the final PDF that it outputs,
so, I need to munge the output PDF outside of Windows.

I can easily remove PDF permissions on Windows; I just want to
be able to remove PDF permissions on Linux, if I can.

> I guess there are enough questions, that even if the students got an
> account on the web site and got the answers to all the questions it
> would not matter (they would have a pretty good grasp of the material).

I don't think the students care that much about Algebra, and, if they
did, hallelujah that they would spend that much effort learning the
answers to thousands of math questions.

In fact, the teacher is thinking of going over the *exact* test with
any student that want to come to the *extra credit* study session.

This is, after all, only high school. The point isn't to kill the
kids; it's to get them to work on their algebra.

Anyway, the problem "I" am having is being able to edit the PDF,
on Linux, because I first need to remove permissions on Linux.

I can easily remove permissions on Windows but that's not the
question - since the goal is a longer-term process, which doesn't
need Windows to work.

I can concatenate and change page order in Linux easily with pdftk,
but I need to change the numerical number of each question in the
concatenated files - hence I need to remove permissions so as to
change the numbering system of the resultant PDF file.

How, on Linux, do "you" remove permissions?

Dennis O'Neill

unread,
Dec 7, 2014, 2:06:23 PM12/7/14
to
Peter Pearson wrote, on Sun, 07 Dec 2014 17:42:57 +0000:

> I've been happy with pdftk

I have pdftk on Linux:
$ sudo apt-get install pdftk ghostscript

Looking at the man pages for pdftk, and searching for
the word "permission", I find only the one option:

$ pdftk [ allow <permissions> ]
Printing = Top Quality Printing
DegradedPrinting = Lower Quality Printing
ModifyContents = Also allows Assembly
Assembly
CopyContents = Also allows ScreenReaders
ScreenReaders
ModifyAnnotations = Also allows FillIn
FillIn
AllFeatures = Allows the user to perform all of the above, and top quality printing.

Dennis O'Neill

unread,
Dec 7, 2014, 2:33:34 PM12/7/14
to
Marek Novotny wrote, on Sun, 07 Dec 2014 13:04:28 -0600:

> Do you have a link for this file?

Hi Marek,

From lurking, I know you're a very helpful guy.

I, my self, am trying to help a stressed-out school teacher.

Because of that, I had not realized, until just this moment that
*anyone* can create an account on that test-creation web site,
especially since it seems to not require a valid email address.

To create a protected PDF file for you, I just did the following:

1. I went to the problematic web site:
http://www.problem-attic.com
2. I clicked the "Sign Up" button
http://www.problem-attic.com/signup
3. I entered an email address of "f...@bar.com"
4. I gave it a first name of "foo" and a last name of "bar"
5. I gave it a password of "snafu" and confirmed that password
6. I clicked the agree button and that created the account
7. I clicked the "create your first document" button
http://www.problem-attic.com/account/documents/firsttime
8. I named my first new document "PDF Permission Test for Marek"
9. I selected the "State Assessments" section (the top left link)
10. I selected the "Science" button
11. I selected the first item in the list of available topics
"Periodic table, properties of elements"
12. I clicked the "Add" button for the the first 10 questions
13. I clicked the "Preview" button at the top of the page
14. This created the PDF; so I then hit the download button in
that preview window.
15. I saved the PDF as /tmp/PDF_Permission_Test_for_Marek.pdf

I'm not sure how to *upload* that resultant PDF for you.
So, I saved it as /tmp/PDF_Permission_Test_for_Marek.pdf.jpg
I tried to upload it to tinypic.com, but that failed because it
knew it wasn't a PDF.

Googling for how to upload a PDF file, I find this reference:
http://smallbusiness.chron.com/upload-pdf-files-internet-53339.html

It suggests KeepAndShare.com, but, that site didn't work because
it insisted on sending an activation link to "f...@bar.com".

Looking for a file-sharing site that doesn't require registration:
http://www.ebizmba.com/articles/file-sharing-websites

I find http://www.4shared.com which accepted the PDF file, saying:
"Your file 'PDF_Permission_Test_for_Marek.pdf' has been successfully
uploaded."

I "think" this is the URL:
http://search.4shared.com/q/CCAD/1/PDF_Permission_Test_for_Marek.pdf

Dennis O'Neill

unread,
Dec 7, 2014, 2:39:01 PM12/7/14
to
Dennis O'Neill wrote, on Sun, 07 Dec 2014 19:33:34 +0000:

> 15. I saved the PDF as /tmp/PDF_Permission_Test_for_Marek.pdf

You can log into that problematic web site using the login
of "f...@bar.com", with the password of "snafu" to access the
file.

Meanwhile, I tried pdftk on that file, with the results shown:

$ pdftk PDF_Permission_Test_for_Marek.pdf
WARNING: The creator of the input PDF:
PDF_Permission_Test_for_Marek.pdf
has set an owner password (which is not required to handle this PDF).
You did not supply this password. Please respect any copyright.
Done. Input errors, so no output created.

So, pdf toolkit knows that the file has certain permissions,
which we want to remove.

Again, we know how to remove these permissions on Windows, but,
the goal is to figure out how to remove PDF permissions on Linux.

We'll probably need "ghostscript" which I have installed:
$ sudo apt-get install ghostscript

Dennis O'Neill

unread,
Dec 7, 2014, 2:42:47 PM12/7/14
to
Dennis O'Neill wrote, on Sun, 07 Dec 2014 19:39:01 +0000:

> You can log into that problematic web site using the login
> of "f...@bar.com", with the password of "snafu" to access the
> file.

I even tried the *only* password that was given the the web
site, which was, literally, the word "snafu":

$ pdftk PDF_Permission_Test_for_Marek.pdf input_pw snafu output unsecured.pdf
Error: Failed to open PDF file:
PDF_Permission_Test_for_Marek.pdf
OWNER OR USER PASSWORD REQUIRED, but not given (or incorrect)
Errors encountered. No output created.
Done. Input errors, so no output created.


This confirmed what I had already known, which is that the web
site is *not* using the login password to prevent editing of
the resultant PDF file.

Dennis O'Neill

unread,
Dec 7, 2014, 2:44:23 PM12/7/14
to
Dennis O'Neill wrote, on Sun, 07 Dec 2014 19:42:46 +0000:

> This confirmed what I had already known, which is that the web
> site is *not* using the login password to prevent editing of
> the resultant PDF file.

This was further confirmed with the use of "qpdf" which is native
on Ubuntu-based Linux systems such as mine:

$ qpdf -password=snafu -decrypt PDF_Permission_Test_for_Marek.pdf unsecured.pdf
PDF_Permission_Test_for_Marek.pdf: invalid password

Dennis O'Neill

unread,
Dec 7, 2014, 2:46:40 PM12/7/14
to
Dennis O'Neill wrote, on Sun, 07 Dec 2014 19:44:23 +0000:

> This was further confirmed with the use of "qpdf" which is native
> on Ubuntu-based Linux systems such as mine:

Likewise with the xpdf-utils' "pdftops" command:

$ sudo apt-get install xpdf-utils

$ pdftops -upw snafu PDF_Permission_Test_for_Marek.pdf unsecured.pdf
Command Line Error: Incorrect password

Dennis O'Neill

unread,
Dec 7, 2014, 2:54:54 PM12/7/14
to
Looking at the permissions of the protected PDF file we
can see that the "Security = Encrypted" status:

$ okular PDF_Permission_Test_for_Marek.pdf
File > Properties

The encrypted status is clearly shown in this screenshot here:
http://i61.tinypic.com/o6md6q.jpg

Dennis O'Neill

unread,
Dec 7, 2014, 3:09:45 PM12/7/14
to
Dennis O'Neill wrote, on Sun, 07 Dec 2014 19:54:53 +0000:

> $ okular PDF_Permission_Test_for_Marek.pdf
> File > Properties
>
> The encrypted status is clearly shown in this screenshot here:
> http://i61.tinypic.com/o6md6q.jpg

Hi Marek,

I think I figured it out!

This shows the original PDF is encrypted:
$ cp PDF_Permission_Test_for_Marek.pdf secured.pdf
$ okular secured.pdf
(File > Properties = http://i57.tinypic.com/6gwz6a.jpg)

This procedure apparently removed the PDF encryption:
$ pdf2djvu secured.pdf -o temp.djvu
$ djvups temp.djvu temp.ps
$ ps2pdf temp.ps unsecured.pdf

This shows the new PDF is now unencrypted:
$ okular unsecured.pdf
(File > Properties = http://i57.tinypic.com/t899op.jpg)

Now I can proceed to concatenate the PDF files, and then
edit the PDF directly, to change the problem numbers so
that they are sequential, even though the file is made
up of multiple files.

BTW, if you know how to *edit* PDF on Linux, let me know,
as the only way I know how to edit PDF text is either to
convert to Word or to use Adobe Acrobat on the PDF file.

Dennis O'Neill

unread,
Dec 7, 2014, 3:16:19 PM12/7/14
to
Dennis O'Neill wrote, on Sun, 07 Dec 2014 20:09:45 +0000:

> I think I figured it out!
----------------------------------------------------------------------------
Here is a summary of how to remove PDF permissions on Linux:
----------------------------------------------------------------------------
To remove pdf permissions from an encrypted PDF file on Ubuntu-based Linux:

$ sudo apt-get install pdf2djvu
(That installs djvups, among other things)
$ sudo apt-get install context
(That installs ps2pdf, among other things)

$ pdf2djvu secured.pdf -o temp.djvu
$ djvups temp.djvu temp.ps
$ ps2pdf temp.ps unsecured.pdf

$ okular secure.pdf
(File > Properties => Security = Encrypted)
http://i57.tinypic.com/6gwz6a.jpg
$ okular unsecure.pdf
(File > Properties => Security = Unencrypted)
http://i57.tinypic.com/t899op.jpg
----------------------------------------------------------------------------
If you know of another way to remove PDF permissions on Linux, let me know!
----------------------------------------------------------------------------

Jonathan N. Little

unread,
Dec 7, 2014, 3:26:37 PM12/7/14
to
You mean break the password protections of the PDF document itself? I
did not think this was possible directly as part of Adobe's design. The
only way I can think of to bypass this is to print the PDF (if the PDF
has printing privileges allowed) to a virtual PDF printer to create a
new PDF from the original.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Paul

unread,
Dec 7, 2014, 3:46:21 PM12/7/14
to
So you're saying you have a Windows solution and not a Linux
solution, implying this teacher runs Linux ? What about
installing Windows in a VM, and doing the work there ?
VirtualBox (from Oracle/Sun) is free and can host a Windows OS.
And Windows OSes can be installed for short periods of time, without
a license key, and you can get useful work done in them.
For example, on Windows 7, even after the evaluation period
has expired, the OS will still run for short periods of time
before it just reboots on you. Any where from 30 minutes to
an hour or so.

You can get ready-to-run VMs from here. They do not have
a license key, and are not activated. Images are available
for VirtualBox. This saves on hunting down Windows installer
DVDs. I have a set of four files for Windows 7, and that
download is 3.4GB total. The one for VirtualBox should
be a similar size.

https://www.modern.ie/en-us/virtualization-tools#downloads

*******

You listed some tools you use. Are you sure they're not
build-able under Linux as well ? Why can't you ./configure,
make, make install and so on ? Have you tried ?

*******

PDF exist in binary and text format. From Adobe "PDF Reference 1.6"

Portability

PDF files are represented as sequences of 8-bit binary bytes...

Any PDF file can also be represented in a form that uses only
7-bit ASCII (American Standard Code for Information Interchange)
character codes. This is useful for the purpose of exposition,
as in this book. However, this representation is not recommended
for actual use...

That suggests a mechanism for passing a PDF via pastebin.
That's if you can find a tool to do the conversion, *AND*
the protection schemes allow it.

*******

There is at least one commercial product for cracking PDFs,
including the weaker forms of encryption. Which you can
easily find in a search. I expect that's for Windows.
And the version that "does everything" is hundreds of
dollars. So if you have a big budget, there's a tool
for the job.

Paul

Dennis O'Neill

unread,
Dec 7, 2014, 4:00:54 PM12/7/14
to
Jonathan N. Little wrote, on Sun, 07 Dec 2014 15:26:26 -0500:

> You mean break the password protections of the PDF document itself? I
> did not think this was possible directly as part of Adobe's design.

I have been removing PDF permissions when necessary for about 10 years
now, so, it's definitely possible (as shown for Windows earlier).

What I wanted was to do the same on Linux (since I had converted all
my WinXP boxes to Ubuntu when Windows support expired).

Now, with pdf2djvu and context, we can easily remove the permissions
on Linux, so, I can move on to converting the result to MS Word on
Linux or other ways of editing the PDF file.

> The only way I can think of to bypass this is to print the PDF (if the PDF
> has printing privileges allowed) to a virtual PDF printer to create a
> new PDF from the original.

IIRC, that never worked.

Dennis O'Neill

unread,
Dec 7, 2014, 4:02:53 PM12/7/14
to
Paul wrote, on Sun, 07 Dec 2014 15:46:20 -0500:

> So you're saying you have a Windows solution and not a Linux
> solution, implying this teacher runs Linux ?

You inferred that, but I never implied that.

The teacher is on the Macintosh, but in reality, she just uses
the web page and mails me the (encrypted) PDF result.

I am on Linux.

I'm just trying to mail back a concatenation of the various PDF
files, with all the questions numbered sequentially.

Dennis O'Neill

unread,
Dec 7, 2014, 4:05:06 PM12/7/14
to
Paul wrote, on Sun, 07 Dec 2014 15:46:20 -0500:

> What about installing Windows in a VM, and doing
> the work there ?

Ever since I converted all my Windows XP machines to Linux
(when support for Windows died), I have been successful in
finding a Linux solution for everything I did on Windows.

This problem is no different.

At the moment, I have an easy solution for removing the
PDF permissions on Linux using dejavu and ps2pdf; but
now my issue is how to EDIT the resulting PDF on Linux
so as to change the problem numbers.

I can easily edit the PDF on Windows - I just now need to
move on to this second problem - which is editing the
(now unencrypted) PDF on Linux.

Does anyone know what's the best way to edit the text inside
a PDF on Linux?

Dennis O'Neill

unread,
Dec 7, 2014, 4:07:00 PM12/7/14
to
Paul wrote, on Sun, 07 Dec 2014 15:46:20 -0500:

> There is at least one commercial product for cracking PDFs,
> including the weaker forms of encryption.

Just to be clear, I have no desire to "crack" the password.

All I wanted to do was remove the restrictions, which I have
done simply by removing the encryption in the PDF, on Linux.

Now the problem is *editing* the text of the PDF on Linux.
If you know how, that would be good.

On Windows, I just use Adobe Acrobat; but I'm looking for a
solution that edits the text inside a PDF on Linux.

Dennis O'Neill

unread,
Dec 7, 2014, 4:13:58 PM12/7/14
to
Marek Novotny wrote, on Sun, 07 Dec 2014 14:17:01 -0600:

> It really depends how how the PDF was created. I could simply be an
> image file wrapped in a PDF wrapper. Or it could be text that you can
> edit. I use PDF Studio 9 on Linux and Acrobat Pro on the Mac.

Hi Marek,
I already had fired up a Windows box earlier and converted the PDF
files the teacher had sent me earlier, to Microsoft Word.

When edited in Microsoft Word, the text inside was clearly text, so,
the web site is creating a PDF file containing text, and not just an
image of the text.

While I can certainly edit the resulting textual-PDF file on Windows,
using Adobe Acrobat, and I can fire up a virtual machine (which is
a cop out), what I'm trying to do is avoid firing up the Windows desktop.

What I'm now trying to figure out is how best to EDIT a text-based
PDF file on Linux.

Any suggestions?

NOTE: I'm googling as we speak ...

Dennis O'Neill

unread,
Dec 7, 2014, 4:23:11 PM12/7/14
to
Nomen Nescio wrote, on Sun, 07 Dec 2014 15:51:22 +0100:

> pdftk might do the job.. it can create RC4-encrypted PDFs, so it
> should be able to remove the encryption as well.
>
> If the document is AES-encrypted, then pdftk won't work.

I was able to remove the encryption on both Windows and on Linux,
but I wasn't able to remove it using pdftk on Linux.

What tool can I use on Linux to tell the "type" of encryption?

Dennis O'Neill

unread,
Dec 7, 2014, 4:25:50 PM12/7/14
to
Thomas Kaiser wrote, on Sun, 07 Dec 2014 16:15:02 +0000:

> Depends on whether user or owner password ist set. And this is also
> the simple key for a web search leading you to tons of explanations

Most pdf solutions are for Windows.
Very few are for Linux.

Since I was on Windows for years, I can do anything I need to do to
a PDF on Windows.

But the question was specific to Linux.
a. How to remove all permissions on Linux, and,
b. How to edit the text inside the PDF on Linux.

I've solved the first problem, but now I'm working on the second.

If a simple google search would have found the answer, I would never
have asked in the first place.

Axel Berger

unread,
Dec 7, 2014, 4:55:31 PM12/7/14
to
Dennis O'Neill wrote:
> In a way, it's good that there isn't anything else you can do

I may be a bit dense, but I'm still not clear: Do you run the site or do
you just use it? In the first case you should go to the root of the
problem, presumably a few lines of PHP, in the second, which I had not
considered before, you have to make do with what is delivered.

Axel

Dennis O'Neill

unread,
Dec 7, 2014, 5:21:24 PM12/7/14
to
Axel Berger wrote, on Sun, 07 Dec 2014 22:54:57 +0100:

> I may be a bit dense, but I'm still not clear: Do you run the site or do
> you just use it? In the first case you should go to the root of the
> problem, presumably a few lines of PHP, in the second, which I had not
> considered before, you have to make do with what is delivered.

Hi Axel,

I don't run the site, and, in fact, I don't even use it, although I
did create a login "f...@bar.com" with a password "snafu" so that you,
or anyone else, can create a PDF for a grade school or high school
exam.

A friend of mine, who is a teacher, on Macintosh (if that matters),
has to create a test for high school kids, and she was instructed to
create that 60-question test using that web site, which, it turns out,
outputs a password-protected PDF which can only be printed, and not
edited.

On Windows, I converted that password-protected PDF to Microsoft Word,
but it was far too screwed up to be efficient. On Windows, I could
easily remove the password protections also, but, since I'm 99.99%
on Linux, I simply wanted to know how to remove the password protection
in Linux.

I found out how to remove the password protection (which turned out, as
most things are, to be trivial, once you know how).

I created that "f...@bar.com" login to see if there were any editing
abilities in the web site, and it turns out they are less than
rudimentary, so, all the real edits are going to have to be made in
the resulting PDF output files.

At the moment, I'm testing out Linux solutions for editing text-based
PDF files. If anyone on this newsgroup has experience editing PDF files
on Linux (not just concatenating or removing pages, but editing the text
inside the PDF), please impart your wisdom to us all!

Thanks.

Paul

unread,
Dec 7, 2014, 5:33:27 PM12/7/14
to
In the list here, LibreOffice Draw is mentioned.

http://en.wikipedia.org/wiki/List_of_PDF_software

The only concern I have about LibreOffice, is the
output engine seems to use Cairo. And in a test case
I ran a few months ago, it was producing single character
output, rather than printing "strings". Which leads to
problems when you go to actually print stuff (the
spacing can get screwed up). But at least in a quick
test, I could select a text string and move it, as
well as edit the string.

*******

If you're a glutton for punishment, there is Adobe Illustrator.
(Yes, it's Windows, but you can do things in it that you're
not going to find anywhere else.) This particular download
has a back-story (there is an actual Adobe page with the
links for the entire suite on it).

http://www.techspot.com/downloads/5724-adobe-illustrator-cs2-free.html

Adobe shut down the license server for CS2 Suite. To prevent
their customers from being inconvenienced, they made copies
of the software, with license key exposed on the download page,
for use. Many people jumped to the conclusion this was
"free" software. But it was really a sloppy way of
distributing a copy of paid software to their customers,
so they could continue to use the product (it was to
solve a licensing issue, caused by the server shutdown).
CS2 was released around the year 2005, so it might not be
able to edit just anything you throw at it. At one time,
Illustrator edited in PostScript, but later switched
to PDF. I don't know any more about it than that. It's
a "drawing tool", rather than a "text editor". You can
do things like arrange text on spline curves, do big
3D letters, all sorts of crazy stuff. But you'd need
to be a rocket scientist to get good results. There
are people who spend 8 hours a day in that program,
every day, earning a living.

By comparison, most other editors are mainly
"compass point editors", with text horizontal or
vertical. And less inclined to support more free-form
creations. That's a lot harder to do, and where a
tool like Illustrator would have the edge.

*******

Another thing that's hard to do, is repair damage.
If a tool in your tool flow, takes a "string" of
text and displays it as individual letters, the
next editor you use, won't be able to wipe and
edit large groups of letters. If the letters
get separated, each one a separate string in effect,
it can be a bitch to fix. (I've experienced this
while using Tailor Postscript editor for Mac, and
having to edit letters one at a time.) And I suspect
that's something LibreOffice Draw would do, is convert
the strings to separate standalone letters. You'd better
test that before getting too excited.

I think LibreOffice would kick ass, if it had
some other print/output engine in it.

Paul

Dennis O'Neill

unread,
Dec 7, 2014, 5:37:57 PM12/7/14
to
Paul wrote, on Sun, 07 Dec 2014 17:33:25 -0500:

> In the list here, LibreOffice Draw is mentioned.
>
> http://en.wikipedia.org/wiki/List_of_PDF_software

Yeah, I tried it on the document I created for Marek.
The result was much worse than expected.
Even Gimp did a better job than LibreOffice Draw.

What I prefer is pdfedit, but it fails to install on
Ubuntu 14.04.

$ sudo apt-get install pdfedit
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pdfedit

Thomas Kaiser

unread,
Dec 7, 2014, 5:39:11 PM12/7/14
to
["Followup-To:" header set to comp.text.pdf.]
Axel Berger wrote in <news:<5484CCB1...@B.Maus.De>
> Dennis O'Neill wrote:
> I may be a bit dense, but I'm still not clear: Do you run the site or do
> you just use it? In the first case you should go to the root of the
> problem, presumably a few lines of PHP, in the second, which I had not
> considered before, you have to make do with what is delivered.

The site creates PDFs with an empty user password and just an owner
password. So removing the restrictions is easy (on the teacher's OS X
depending on the OS version using for example the default PDF viewer
Preview.app). The example PDF took just 1 second using

http://www.freemypdf.com

And using "CleanPDF" works almost instantly

https://www.macupdate.com/app/mac/49937/cleanpdf/download

(it uses internally just GhostScript's new MuPDF engine or to be more
precise simply the pdfclean tool that removes annoying PDF restrictions
in PDF files: http://www.mupdf.com/docs/browse/source/tools/pdfclean.c
-- "apt-get install mupdf-tools")

There's a simple rule: If you can open a PDF with any viewer without
specifying a password then you won't need GhostScript or complicated
refrying attempts to remove the restrictions.

Regarding the other question how to edit text inside PDF: don't. PDF is
the exact opposite of an editable format. Maybe on Linux OpenOffice
works with rather primitive PDF files.

Regards,

Thomas

Dennis O'Neill

unread,
Dec 7, 2014, 5:48:02 PM12/7/14
to
Thomas Kaiser wrote, on Sun, 07 Dec 2014 22:39:10 +0000:

> Regarding the other question how to edit text inside PDF: don't. PDF is
> the exact opposite of an editable format.

I have been editing PDF text for a decade, mostly using the tools
provided by Adobe for that express purpose (on Windows).

Once I put all the PDFs together, all I need to do is change the
numbers so that they are sequential. So, for those kinds of minor
edits, pdf editors are perfect.

Thomas Kaiser

unread,
Dec 7, 2014, 5:57:43 PM12/7/14
to
Dennis O'Neill schrieb in <news:m62lf1$rjo$4...@solani.org>
> Thomas Kaiser wrote, on Sun, 07 Dec 2014 22:39:10 +0000:
>
>> Regarding the other question how to edit text inside PDF: don't. PDF
>> is the exact opposite of an editable format.
>
> I have been editing PDF text for a decade, mostly using the tools
> provided by Adobe for that express purpose (on Windows).

Then we're speaking about different things. In my active time as a
prepress operator we had to use at least PitStop or better Solvero (many
thousand bucks) to 'edit' text with typography in mind:

http://www.enfocus.com/en/products/pitstop-pro/
http://www.onevision.com/solvero.html?&gclid=cnc4rpxq_pecfsosggodxse29g

Simply adding single letters might work with Acrobat. But PDF is 'by
design' not an editable format but the opposite: An archive format
preserving the look of the original document (if you want to edit... get
the latter)

Regards,

Thomas

Jonathan N. Little

unread,
Dec 7, 2014, 6:00:31 PM12/7/14
to
Dennis O'Neill wrote:
> Jonathan N. Little wrote, on Sun, 07 Dec 2014 15:26:26 -0500:
>
>> You mean break the password protections of the PDF document itself? I
>> did not think this was possible directly as part of Adobe's design.
>
> I have been removing PDF permissions when necessary for about 10 years
> now, so, it's definitely possible (as shown for Windows earlier).

Really? Okay edit this PDF. Change the text:

<http://www.littleworksstudio.com/temp/usenet/editthis.pdf>

William Unruh

unread,
Dec 7, 2014, 6:10:05 PM12/7/14
to
Why do not use exactly the same procedure as on Windows. Ie, use
ghostscript, ghoseveiw and pdf2edit just as you do on windows. All are
afailable for Linux, as I mentioned in an earlier reply. Now djvu might
be better, I do not know, but just in case it is not, try the same
procedure as on Windows.

Dennis O'Neill

unread,
Dec 7, 2014, 6:12:38 PM12/7/14
to
Thomas Kaiser wrote, on Sun, 07 Dec 2014 22:39:10 +0000:

> There's a simple rule: If you can open a PDF with any viewer without
> specifying a password then you won't need GhostScript or complicated
> refrying attempts to remove the restrictions.

This is good to know, as removing the encryption turns out to be
easy in most (if not all) cases.

> Regarding the other question how to edit text inside PDF: don't. PDF is
> the exact opposite of an editable format. Maybe on Linux OpenOffice
> works with rather primitive PDF files.

Actually, the PDF format would be useless in many cases, if it couldn't
be edited natively.

The fact it can be edited makes a document that would otherwise be
useless, useful again.

Even Adobe supplies editing capabilities in Acrobat for PDF files.

Thomas Kaiser

unread,
Dec 7, 2014, 6:13:44 PM12/7/14
to
Jonathan N. Little schrieb am 07.12.2014 in <news:m62m5s$2pl$1...@dont-email.me>
> Dennis O'Neill wrote:
>>
>> I have been removing PDF permissions when necessary for about 10 years
>> now, so, it's definitely possible (as shown for Windows earlier).
>
> Really? Okay edit this PDF. Change the text:
>
><http://www.littleworksstudio.com/temp/usenet/editthis.pdf>

Haha, this one uses real AES-256 encryption introduced with Acrobat X
even without a user password:

macbookpro-tk:~ tk$ pdfcrack editthis.pdf

PDF version 1.7
Security Handler: Standard
V: 5
R: 5
P: -3904
Length: 256

Will take ages maybe even with Elcomsoft's APPR with GPU acceleration...

http://www.elcomsoft.com/apdfpr.html#chart

Regards,

Thomas

Dennis O'Neill

unread,
Dec 7, 2014, 6:14:24 PM12/7/14
to
William Unruh wrote, on Sun, 07 Dec 2014 23:09:46 +0000:

> Why do not use exactly the same procedure as on Windows. Ie, use
> ghostscript, ghoseveiw and pdf2edit just as you do on windows. All are
> afailable for Linux, as I mentioned in an earlier reply. Now djvu might
> be better, I do not know, but just in case it is not, try the same
> procedure as on Windows.

That's a good point, which I hadn't even considered, mostly, I guess,
because I hadn't made the connection that the *same* software was
available on both platforms.

My mistake.

Luckily, dejavu worked just fine on Linux, despite my error, for
removing the encrypted permission from the PDF file.

Now I'm testing the native PDF editors on Linux ...

Thomas Kaiser

unread,
Dec 7, 2014, 6:24:28 PM12/7/14
to
Dennis O'Neill schrieb am 07.12.2014 in <news:m62mt5$rjo$5...@solani.org>
> Thomas Kaiser wrote, on Sun, 07 Dec 2014 22:39:10 +0000:
>
>> There's a simple rule: If you can open a PDF with any viewer without
>> specifying a password then you won't need GhostScript or complicated
>> refrying attempts to remove the restrictions.
>
> This is good to know, as removing the encryption turns out to be
> easy in most (if not all) cases.

Sorry, I made the mistake to also mention the exception. Starting with
Acrobat X Adobe implemented AES-256 for PDFs with an empty user password
but with an owner password set. Depending on the password's strength it
might be impossible to change the restrictions then. But prior to
Acrobat X the main difference was always owner vs. user password. If you
have a PDF where just the owner password is set then it's easy to remove
the restrictions (pdfclean in.pdf out.pdf) unless the newer strong
encryption has been chosen. And cracking a PDF that has a user password
set means running dictionary attacks or brute force attempts against it.

>> Regarding the other question how to edit text inside PDF: don't. PDF
>> is the exact opposite of an editable format. Maybe on Linux OpenOffice
>> works with rather primitive PDF files.
>
> Actually, the PDF format would be useless in many cases, if it couldn't
> be edited natively.

I know that many people fail to understand the purpose of an archive
format like PDF. It was never meant to be an editable format but
something to preserve contents between sender and receiver instead.

> Even Adobe supplies editing capabilities in Acrobat for PDF files.

This is so limited and crappy that I wouldn't call it editing. YMMV.

Regards,

Thomas

Peter Köhlmann

unread,
Dec 7, 2014, 6:57:28 PM12/7/14
to
Jonathan N. Little wrote:

> Dennis O'Neill wrote:
>> Jonathan N. Little wrote, on Sun, 07 Dec 2014 15:26:26 -0500:
>>
>>> You mean break the password protections of the PDF document itself? I
>>> did not think this was possible directly as part of Adobe's design.
>>
>> I have been removing PDF permissions when necessary for about 10 years
>> now, so, it's definitely possible (as shown for Windows earlier).
>
> Really? Okay edit this PDF. Change the text:
>
> <http://www.littleworksstudio.com/temp/usenet/editthis.pdf>
>
>

Sneaky. Posting a "text" as a picture

Axel Berger

unread,
Dec 7, 2014, 7:43:11 PM12/7/14
to
Thomas Kaiser wrote:
> I know that many people fail to understand the purpose of an archive
> format like PDF. It was never meant to be an editable format but
> something to preserve contents between sender and receiver instead.

Being surrounded by Office program users I frequently come across cases
where documents and presentations open quite differently from what the
author intended. PDF is finished and final and will look exactly the
same on whatever machine, device or OS you choose to open it.

I custumarily enclose my TeX source in the PDF as an attachment (not
always and usually not on versions I offer for public download) and so
offer the best of both worlds - strict fidelity and full and
unrestricted editability.

Axel

Paul

unread,
Dec 7, 2014, 8:42:49 PM12/7/14
to
Jonathan N. Little wrote:
> Dennis O'Neill wrote:
>> Jonathan N. Little wrote, on Sun, 07 Dec 2014 15:26:26 -0500:
>>
>>> You mean break the password protections of the PDF document itself? I
>>> did not think this was possible directly as part of Adobe's design.
>>
>> I have been removing PDF permissions when necessary for about 10 years
>> now, so, it's definitely possible (as shown for Windows earlier).
>
> Really? Okay edit this PDF. Change the text:
>
> <http://www.littleworksstudio.com/temp/usenet/editthis.pdf>
>
>

http://i57.tinypic.com/261d98n.gif

Steps (and I don't understand why this works, at all).

GSView+(one of GS8.63, GS9.10, GS9.14)

If I try GS9.10 or GS9.14, they're missing "pswrite". Which
causes a lot of my attempts to break.

If I use the available "ps2write" in those versions of
GhostScript, I get Level 2 PostScript, which doesn't
seem to handle the document all that well. Post processing
has errors when fed into various interpreters or distillers.

However, when I did File:Convert in GSView 5.0 and
selected "pdfwrite" as the converter and "600DPI" (whatever
that means), I got the new document. Next, popped the new
document into Acrobat (from my Distiller package of years
ago), and I was able to edit.

Doing the Edit, caused an additional font entry to be added
to the document. The letter "W" in my edit, would not be
in the embedded font, so a non-matching font was added.
I didn't receive a warning or anything, even though the
original font was ArialMT and the new one was just Arial.

I'm not really sure what the original security setting was
supposed to lock. I think maybe the reason I got away
with it, was "Printing: None".

http://i57.tinypic.com/346vm2q.gif

Paul

Dennis O'Neill

unread,
Dec 7, 2014, 8:57:54 PM12/7/14
to
Jonathan N. Little wrote, on Sun, 07 Dec 2014 18:00:21 -0500:

> Really? Okay edit this PDF. Change the text:
> <http://www.littleworksstudio.com/temp/usenet/editthis.pdf>

It was trivial to remove the permissions.
I didn't bother to edit it (because I'm working on editing in Linux),
but editing in Windows would have been as trivial.

$ pdf2djvu secured.pdf -o temp.djvu
This gave errors, but appears to have worked.
$ djvups temp.djvu temp.ps
$ ps2pdf temp.ps unsecured.pdf
This is the PDF that resulted.
$ okular unsecured.pdf
File > Properties, where Security = Unencrypted
http://i61.tinypic.com/2nk7y0x.jpg

I'm confused what you were expecting.
Were you expecting that unencrypted result or something else?

Dennis O'Neill

unread,
Dec 7, 2014, 8:59:22 PM12/7/14
to
Thomas Kaiser wrote, on Sun, 07 Dec 2014 23:13:43 +0000:

> Haha, this one uses real AES-256 encryption introduced with Acrobat X
> even without a user password:

Take a look at my example, and, if you have a linux laptop, you
can easily reproduce what I did, which says the results are now
unencrypted.

I'm confused, but I didn't bother firing up a Windows box to edit
the result - but - were you expecting the encryption to be so easily
removed?

Or, should we have expected a different answer?

Jonathan N. Little

unread,
Dec 7, 2014, 9:05:00 PM12/7/14
to
It is absolutely not in image. Vector. Embedded font.

Dennis O'Neill

unread,
Dec 7, 2014, 9:16:14 PM12/7/14
to
Dennis O'Neill wrote, on Mon, 08 Dec 2014 01:57:54 +0000:

> It was trivial to remove the permissions.
> I didn't bother to edit it (because I'm working on editing in Linux),
> but editing in Windows would have been as trivial.

Since I don't feel like firing up Windows to edit it in Adobe Acrobat,
I'll just edit it on Linux - but it will take me a few minutes because
I've never edited *any* PDF on Linux, but if the editing is as trivial
as it was removing the encryption, I should be good to go in a few...

STEP 0: Choose the PDF editing software for Linux
http://sourceforge.net/projects/pdfedit/

STEP 1: Download the tarball on Linux
http://sourceforge.net/projects/pdfedit/files/latest/download

STEP 3: Figure out what to do with the results:
http://www.quora.com/How-do-I-install-a-tar.bz2-file-in-Ubuntu

That help page says to run these simple steps:
$ tar -xf pdfedit-0.4.5.tar.bz2
$ cd pdfedit-0.4.5
$ ./configure
...
checking if zlib is wanted... configure: error: libz not found

Drat. I've never compiled before.
The subsequent "make" and "sudo make install" both failed; so, I
probably need this thing called a "zlib" (and/or a "libz").

(At this point, I need advice from the Linux gurus since I have
never compiled anything in my life.)

Dennis O'Neill

unread,
Dec 7, 2014, 9:43:25 PM12/7/14
to
Dennis O'Neill wrote, on Mon, 08 Dec 2014 02:16:13 +0000:

> (At this point, I need advice from the Linux gurus since I have
> never compiled anything in my life.)

Since I have never compiled before, can you tell me what the
next step is to get the "pdfedit" program running on Kubuntu
14.04?

$ uname -a
Linux doneill 3.11.0-14-generic #21-Ubuntu SMP Tue Nov 12 17:04:55
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Choose the PDF editing software for Linux
http://sourceforge.net/projects/pdfedit/

Figure out what to do with the results:
http://www.quora.com/How-do-I-install-a-tar.bz2-file-in-Ubuntu

That help page says to run these simple steps:
$ tar -xf pdfedit-0.4.5.tar.bz2
$ cd pdfedit-0.4.5
$ ./configure
...
checking if zlib is wanted... configure: error: libz not found

Drat. I've never compiled before.

Googling, I found the following DIY:
http://www.makeuseof.com/tag/compile-install-tar-gz-tar-bz2-files-ubuntu-linux/

Following that DIY, I run:
$ sudo apt-get install build-essential checkinstall
$ ls -ld /usr/local/src
=> drwxr-xr-x 2 root root 4096 Oct 16 2013 /usr/local/src
$ sudo chown $USER /usr/local/src
$ ls -ld /usr/local/src
=> drwxr-xr-x 2 foo root 4096 Oct 16 2013 /usr/local/src
$ sudo chmod u+rwx /usr/local/src

$ sudo apt-get install apt-file
$ sudo apt-file update

$ cp /tmp/pdfedit-0.4.5.tar.bz2 /usr/local/src/.

$ cd /usr/local/src/.
$ tar -xjvf pdfedit-0.4.5.tar.bz2
=> pdfedit-0.4.5/
$ cd /usr/local/src/pdfedit-0.4.5/
$ view README
$ sudo apt-get install autoconf
$ ./configure
...
checking if zlib is wanted... configure: error: libz not found

$ apt-file search libz
This finds far too much information for me to parse properly.

$ apt-cache search zlib
This still finds too much stuff to make any sense to a noob.

Guessing, I'll try this from here:
http://ubuntuforums.org/showthread.php?t=1528204
$ sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev

$ ./configure
checking zlib in /usr... ok
checking for boostlib >= 1.20.0... configure: error: We could not
detect the boost libraries (version 1.20 or higher). If you have a
staged boost library (still not installed) please specify $BOOST_ROOT
in your environment and do not give a PATH to --with-boost option.
If you are sure you have boost installed, then check your version number
looking in <boost/version.hpp>.
See http://randspringer.de/boost for more documentation.

Again, shooting in the dark to install what seems to be missing:
$ sudo apt-get install boostlib
(that fails)

Paul

unread,
Dec 7, 2014, 10:10:39 PM12/7/14
to
You're headed in the right direction. Looking at the
output of ./configure for missing stuff.

Then, look in Synaptic for name_of_lib-dev. Your "zlib1g-dev"
is the right naming convention, but it still might not be
the exactly right one. I'm not sure what the naming convention
on your exampls is exactly. The -dev package might have .h files
for the /usr/include type stuff. In Synaptic, if you do properties
on the package after it's installed, you can check the file
list and see what sort of stuff got added.

Paul

Dennis O'Neill

unread,
Dec 7, 2014, 10:13:13 PM12/7/14
to
Dennis O'Neill wrote, on Mon, 08 Dec 2014 02:43:24 +0000:

> Since I have never compiled before, can you tell me what the
> next step is to get the "pdfedit" program running on Kubuntu
> 14.04?

I'm going to give up on compiling on Linux (for now) since every
time I get past one step, a new problem comes along (which, I
know, is the game)... but, for now, here is where I stand on
trying to get pdfedit to work in 64-bit Linux so that I can at
least *try* to edit the suggested protected PDF file in Linux
that Jonathan N. Little kindly posted.

How to install pdfedit on Ubuntu (actually Kubuntu 14.04):

Choose the PDF editing software for Linux
http://sourceforge.net/projects/pdfedit/

Download the tarball on Linux
http://sourceforge.net/projects/pdfedit/files/latest/download

Figure out what to do with the results:
http://www.quora.com/How-do-I-install-a-tar.bz2-file-in-Ubuntu

That help page says to run these simple steps:
$ tar -xf pdfedit-0.4.5.tar.bz2
$ cd pdfedit-0.4.5
$ ./configure
...
checking if zlib is wanted... configure: error: libz not found

Drat. I've never compiled before.

Googling, I found the following DIY:
http://www.makeuseof.com/tag/compile-install-tar-gz-tar-bz2-files-ubuntu-linux/

Following that DIY, I run:
$ sudo apt-get install build-essential checkinstall
$ ls -ld /usr/local/src
=> drwxr-xr-x 2 root root 4096 Oct 16 2013 /usr/local/src
$ sudo chown $USER /usr/local/src
$ ls -ld /usr/local/src
=> drwxr-xr-x 2 dennis root 4096 Oct 16 2013 /usr/local/src
http://askubuntu.com/questions/168053/how-to-install-all-the-boost-development-libraries
$ sudo apt-get install libboost-all-dev

$ cd /usr/local/src/pdfedit-0.4.5/
$ ./configure
...
configure: error: QTDIR environment variable must be set

I give up (for now)... on installing "pdfedit" on Linux.

Dennis O'Neill

unread,
Dec 7, 2014, 10:24:57 PM12/7/14
to
Jonathan N. Little wrote, on Sun, 07 Dec 2014 18:00:21 -0500:

> Really? Okay edit this PDF. Change the text:
> <http://www.littleworksstudio.com/temp/usenet/editthis.pdf>

Hi Jonathan,

It was trivial to edit that (presumably protected) PDF file:
http://i57.tinypic.com/kali14.gif

As I said, I've been editing PDFs for a decade or more, so, this
one was no exception (I used the same Windows PDF-security removal
procedure I had posted long ago already in this thread).

That I could edit your file easily on Windows was no surprise (to me);
but I'm trying to figure out how to install the "pdfedit" editor
on Linux so that I can edit any PDF (yes, even an encrypted PDF)
on Linux.

If you want the unprotected PDF file, let me know where I
can upload it without having to register my email address.

But anyone can follow what I did simply by removing the protection
and then editing the text of the resulting PDF file.

Dennis O'Neill

unread,
Dec 7, 2014, 10:33:13 PM12/7/14
to
Jonathan N. Little wrote, on Sun, 07 Dec 2014 18:00:21 -0500:

>> I have been removing PDF permissions when necessary for about 10 years
>> now, so, it's definitely possible (as shown for Windows earlier).
>
> Really? Okay edit this PDF. Change the text:
> <http://www.littleworksstudio.com/temp/usenet/editthis.pdf>

Just so you know, I did fire up my ancient Windows XP desktop and
then I tried to open your file *directly* in my ancient Adobe Acrobat 6
which, predictably, gave the following error on your (presumably)
protected PDF file: http://i59.tinypic.com/fdtzk8.gif

Of course, after a quick run through an ancient version of Windows
Ghostscript, all the encrypted permissions were removed instantly.
http://i60.tinypic.com/2nun7yp.gif

The result was that it was trivially easy to remove the permission
and edit the file, even given my Windows XP machine (and all the
software on it) has to be something like 10 years old or so ...
http://i60.tinypic.com/23t2w7p.gif

If you want me to send you the now-edited PDF, just let me know
what is a good way to upload a PDF without having to register or
give away my email address (a free file sharing site must exist).

Anyway, as I said, I've been (removing permissions and) editing PDF
text forever on Windows; but what I need now is to install a good free
PDF editor on Linux.

I've chosen the Sourceforge "pdfedit"; but I just need some help
in compiling it (I've never compiled before).

Dennis O'Neill

unread,
Dec 7, 2014, 10:38:21 PM12/7/14
to
Paul wrote, on Sun, 07 Dec 2014 22:10:38 -0500:

> You're headed in the right direction. Looking at the
> output of ./configure for missing stuff.
>
> Then, look in Synaptic for name_of_lib-dev. Your "zlib1g-dev"

I got past the zlib stuff (by googling).
Then new boostlib stuff popped up, which I got past (by googling).
Then new QTDIR environment variable stuff popped up.

Since Jonathan Little challenged me with a (presumably protected) PDF,
I didn't want to try too long to compile "pdfedit" to prove to him
that PDF editing is something we have been doing for a decade or more,
even on supposedly "protected" files.

So, I emailed Jonathan's file to myself, and blew the dust off an
ancient Windows XP box (it has to be ten years old, as is the software
on it) to remove the protections from and edit the file that Jonathan
posted and to post back the results.

If Jonathan wants that unencrypted file, I'll be glad to post it,
but, anyone with 10-year-old software on Windows XP can convert it,
and edit it, so (like all good science), my results should be
eminently reproducible on Windows XP.

I'd like to reproduce the same results on Linux, but, right now,
I'm stymied by the lack of the ability to install the suggested
freeware pdf editor (pdfedit).

Dennis O'Neill

unread,
Dec 7, 2014, 10:45:18 PM12/7/14
to
Jonathan N. Little wrote, on Sun, 07 Dec 2014 21:04:50 -0500:

> It is absolutely not in image. Vector. Embedded font.

It's funny, but, two things happened when I tried two approaches
to removing the permission from your PDF file & then editing it.

First, I removed the permission on Linux, and, since I didn't
have a Linux PDF editor (yet), I emailed both the original PDF
and the unencrypted PDF to myself, and opened both on an ancient
WinXP box.

In that case, the encrypted PDF wouldn't open in Adobe Acrobat 6
(predictably); but the unencrypted PDF opened just fine, and showed
that there were no permissions set. However, for whatever reason,
Adobe Acrobat 6 wouldn't *select* the text to edit it.

So, I simply started with the original PDF on Windows, and then
ran an ancient version of Ghostscript to open up the encrypted
PDF, which removed the encryption, and then I saved that result.

Going back to Adobe Acrobat 6 to open up the Ghostscript created
PDF, then I *could* select the text and edit it easily.

So, it's funny, and I don't understand why, but, in both cases I
was able to remove all permissions - but - in one case, the text
was not selectable in Adobe Acrobat 6, while in the other case,
I had absolutely no problem selecting (and then editing) the text.

If someone can explain why this happened, that would be nice.

Dennis O'Neill

unread,
Dec 7, 2014, 10:58:19 PM12/7/14
to
Thomas Kaiser wrote, on Sun, 07 Dec 2014 22:57:43 +0000:

> Simply adding single letters might work with Acrobat.
> But PDF is 'by design' not an editable format but the opposite

I don't have any fancy tools, and my Windows tools are a decade
old or so, but I have been editing text in PDFs for all that time.

However, you are correct in that the Adobe Acrobat program (mine
is the ancient version #6) has a "rudimentary" text editor.
http://i57.tinypic.com/kali14.gif

That rudimentary text editor can easily change words and
sentences, using the correct font, but, nobody in their right
mind would use it for document creation.

You can change the entire meaning of sentences, and you can
both add and delete, but, if you try to add and/or delete too
much, the paragraphs get all messed up.

So, I use it for minor edits only since I can simply convert
the PDF to Microsoft Word if I need to perform major edits
anyway.

Dennis O'Neill

unread,
Dec 7, 2014, 11:12:31 PM12/7/14
to
Thomas Kaiser wrote, on Sun, 07 Dec 2014 23:24:27 +0000:

> If you
> have a PDF where just the owner password is set then it's easy to remove
> the restrictions (pdfclean in.pdf out.pdf) unless the newer strong
> encryption has been chosen.

Even though I had no problem with removing the protection of
Jonathan's file on either Linux or an ancient version of Windows XP,
I always am looking for good PDF-related software.

Unfortunately, I didn't find this "pdfclean" program for linux:

$ sudo apt-get install pdfclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pdfclean

Googling, this page implies "mupdf" comes with "pdfclean":
$ sudo apt-get install mupdf

But, I can't find "pdfclean" as part of mupdf.

Where do we get "pdfclean" for Linux?

Dennis O'Neill

unread,
Dec 7, 2014, 11:20:40 PM12/7/14
to
Axel Berger wrote, on Mon, 08 Dec 2014 01:42:42 +0100:

> PDF is finished and final and will look exactly the
> same on whatever machine, device or OS you choose to open it.

Except when we edit the PDF to change what it looks like.

Here is, for example, Jonathan Little's original PDF file:
http://www.littleworksstudio.com/temp/usenet/editthis.pdf

Here is what the original PDF looked like:
http://i60.tinypic.com/23t2w7p.gif

Here is what the edited PDF looked like:
http://i57.tinypic.com/kali14.gif

Here is what the Linux "pdfinfo" command says about the original:
$ pdfinfo editthis.pdf
Title: Untitled-1
Keywords: Test Password Protected PDF
Author: Jonathan N Little
Creator: CorelDRAW X5
Producer: Corel PDF Engine Version 15.2.0.695
CreationDate: Sun Dec 7 17:57:13 2014
ModDate: Sun Dec 7 17:57:13 2014
Tagged: no
Form: none
Pages: 1
Encrypted: yes (print:no copy:no change:no addNotes:no algorithm:AES-256)
Syntax Error: Missing 'endstream' or incorrect stream length
Syntax Warning: Failed parsing hints table object
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Page size: 612 x 792 pts (letter)
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Page rot: 0
File size: 10240 bytes
Optimized: yes
PDF version: 1.7

After removing the encryption, here is what pdfinfo says:
$ pdfinfo gs1_unsecured.pdf
Title: Ghostscript wrapper for C:\tmp\editthis.pdf
Creator: GSview
Producer: GPL Ghostscript 9.07
CreationDate: Sun Dec 7 19:03:28 2014
ModDate: Sun Dec 7 19:05:46 2014
Tagged: no
Form: none
Pages: 1
Encrypted: no
Page size: 595 x 792 pts
Page rot: 0
File size: 33962 bytes
Optimized: no
PDF version: 1.5

Paul

unread,
Dec 7, 2014, 11:36:59 PM12/7/14
to
Dennis O'Neill wrote:
> Dennis O'Neill wrote, on Mon, 08 Dec 2014 02:43:24 +0000:
>
>> Since I have never compiled before, can you tell me what the
>> next step is to get the "pdfedit" program running on Kubuntu
>> 14.04?
>
> I'm going to give up on compiling on Linux (for now) since every
> time I get past one step, a new problem comes along (which, I
> know, is the game)...

It's in 12.04. And just a guess would be, maybe it's
a Qt3 versus Qt4 problem, and that's why it got dropped.

http://i59.tinypic.com/14mwapz.gif

This is one of the reasons I have Ubuntu VMs that go back
many releases. Most of the machines are perfectly useless
now, but in this case, I'm lucky that I just happened
to have installed that thing.

Now, when I just tried pdfedit-0.4.5, it asked for a password
for that file.

I also tested on a file that didn't have permissions issues,
and the UI on the program isn't all that great. I wouldn't
want to be doing a large number of edits in there.

Paul

Dennis O'Neill

unread,
Dec 7, 2014, 11:50:01 PM12/7/14
to
Paul wrote, on Sun, 07 Dec 2014 20:42:47 -0500:

> If I try GS9.10 or GS9.14, they're missing "pswrite". Which
> causes a lot of my attempts to break.

I had fired up an ancient Windows XP machine, with Adobe
Acrobat version 6 and Ghostscript version 5.0 to remove
the permissions from the PDF file that Jonathan kindly
provided.

This ancient set of software had no problem removing the
permission from and then editing the text embedded in
Jonathan's CorelDRAW X5 PDF file.

Dennis O'Neill

unread,
Dec 7, 2014, 11:53:40 PM12/7/14
to
Paul wrote, on Sun, 07 Dec 2014 23:36:58 -0500:

> I also tested on a file that didn't have permissions issues,
> and the UI on the program isn't all that great. I wouldn't
> want to be doing a large number of edits in there.

That's too bad, as I just wanted an editor on Linux to make
minor text edits, just as I had on Windows XP with Adobe Acrobat 6.

Jonathan N. Little

unread,
Dec 8, 2014, 12:24:30 AM12/8/14
to
Dennis O'Neill wrote:
> Jonathan N. Little wrote, on Sun, 07 Dec 2014 21:04:50 -0500:
>
>> It is absolutely not in image. Vector. Embedded font.
>
> It's funny, but, two things happened when I tried two approaches
> to removing the permission from your PDF file & then editing it.
>
> First, I removed the permission on Linux, and, since I didn't
> have a Linux PDF editor (yet), I emailed both the original PDF
> and the unencrypted PDF to myself, and opened both on an ancient
> WinXP box.
>
> In that case, the encrypted PDF wouldn't open in Adobe Acrobat 6
> (predictably); but the unencrypted PDF opened just fine, and showed
> that there were no permissions set. However, for whatever reason,
> Adobe Acrobat 6 wouldn't *select* the text to edit it.
>
> So, I simply started with the original PDF on Windows, and then
> ran an ancient version of Ghostscript to open up the encrypted
> PDF, which removed the encryption, and then I saved that result.
>
> Going back to Adobe Acrobat 6 to open up the Ghostscript created
> PDF, then I *could* select the text and edit it easily.

Interesting that an ancient open-source tool could disabled Adobe's
protections.

> So, it's funny, and I don't understand why, but, in both cases I
> was able to remove all permissions - but - in one case, the text
> was not selectable in Adobe Acrobat 6, while in the other case,
> I had absolutely no problem selecting (and then editing) the text.
>
> If someone can explain why this happened, that would be nice.
>


Jonathan N. Little

unread,
Dec 8, 2014, 12:36:09 AM12/8/14
to
Dennis O'Neill wrote:
> Paul wrote, on Sun, 07 Dec 2014 22:10:38 -0500:
>
>> You're headed in the right direction. Looking at the
>> output of ./configure for missing stuff.
>>
>> Then, look in Synaptic for name_of_lib-dev. Your "zlib1g-dev"
>
> I got past the zlib stuff (by googling).
> Then new boostlib stuff popped up, which I got past (by googling).
> Then new QTDIR environment variable stuff popped up.
>
> Since Jonathan Little challenged me with a (presumably protected) PDF,
> I didn't want to try too long to compile "pdfedit" to prove to him
> that PDF editing is something we have been doing for a decade or more,
> even on supposedly "protected" files.
>
> So, I emailed Jonathan's file to myself, and blew the dust off an
> ancient Windows XP box (it has to be ten years old, as is the software
> on it) to remove the protections from and edit the file that Jonathan
> posted and to post back the results.
>
> If Jonathan wants that unencrypted file, I'll be glad to post it,
> but, anyone with 10-year-old software on Windows XP can convert it,
> and edit it, so (like all good science), my results should be
> eminently reproducible on Windows XP.

This is a non-binary NG, but my email is real. Yes I'd be interested in
looking at it. Of course Corel licensed the PDF component from Adobe and
I have no Acrobat installed, but it would be interesting if a PDF
created from Adobe's software to be so easily circumvented.

>
> I'd like to reproduce the same results on Linux, but, right now,
> I'm stymied by the lack of the ability to install the suggested
> freeware pdf editor (pdfedit).
>

First just install the package build-essential

sudo apt-get install build-essential

Then download the tarball pdfedit-0.4.5.tar.gz from sourceforge

Extract the source and make the install...

William Unruh

unread,
Dec 8, 2014, 12:43:13 AM12/8/14
to

Jonathan N. Little

unread,
Dec 8, 2014, 12:49:00 AM12/8/14
to
~$ wget ftp://ftp.theory.physics.ubc.ca/outgoing/editthis.pdf
--2014-12-08 00:46:44--
ftp://ftp.theory.physics.ubc.ca/outgoing/editthis.pdf
=> ‘editthis.pdf’
Resolving ftp.theory.physics.ubc.ca (ftp.theory.physics.ubc.ca)...
142.103.234.23
Connecting to ftp.theory.physics.ubc.ca
(ftp.theory.physics.ubc.ca)|142.103.234.23|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /outgoing ... done.
==> SIZE editthis.pdf ... 5873
==> PASV ... done. ==> RETR editthis.pdf ...
No such file ‘editthis.pdf’.

Thomas Kaiser

unread,
Dec 8, 2014, 12:52:59 AM12/8/14
to
Jonathan N. Little schrieb in <news:m63cls$1j9$1...@dont-email.me>
> Dennis O'Neill wrote:
>> Jonathan N. Little wrote, on Sun, 07 Dec 2014 21:04:50 -0500:
>>
>>> It is absolutely not in image. Vector. Embedded font.
>> [...]
>> So, I simply started with the original PDF on Windows, and then
>> ran an ancient version of Ghostscript to open up the encrypted
>> PDF, which removed the encryption, and then I saved that result.
>>
>> Going back to Adobe Acrobat 6 to open up the Ghostscript created
>> PDF, then I *could* select the text and edit it easily.
>
> Interesting that an ancient open-source tool could disabled Adobe's
> protections.

It's still the very same question since the beginning: Owner password
(no need to enter a password to *open* the PDF) vs. user password. The
latter is always combined with more or less strong encryption the former
(just an owner password) is always only a hint for the application in
question that opens the PDF. If it can be opened without a password then
everything can be done with _the contents_ that are used to display the
page layout.

In the past removing an owner password was always plain simple. With
Acrobat X Adobe introduced AES-256 encryption so from then on it might
be even impossible to decrypt to stuff to remove the restrictions.

But since it can still be displayed when no user password ist set, there
exist always ways to create a freshly PDF from the visual contents. And
this is what Dennis has done. He didn't removed restrictions but created
a whole new PDF instead containing just the page layout (and PDF is much
much more. If you would've used a fully blown PDF containing hyperlinks,
form fields, tags, images with 16 bit color depth, color management,
layers, annotations and so on nothing of this would have survived the
'refrying' [1] process through GhostScript)

If you only deal with PDFs containing just black and white text and
graphics primitives then you might get the idea that refrying (convert
the _visual_ contents to PostScript and convert it back to a brand new
and internally different PDF) might be the same as removing the
restrictions associated with the owner password. But this is not the
case. Same applies to 'edit PDF' -- close to impossible if you get a
'real PDF' into your hands.

Regards,

Thomas

[1] https://web.archive.org/web/20091016054421/http://www.acrobatusers.com/blogs/leonardr/why-refrying-pdf-evil

Thomas Kaiser

unread,
Dec 8, 2014, 1:05:38 AM12/8/14
to
Dennis O'Neill schrieb in <news:m638fe$ohm$7...@solani.org>
> Thomas Kaiser wrote, on Sun, 07 Dec 2014 23:24:27 +0000:
>
>> If you have a PDF where just the owner password is set then it's easy
>> to remove the restrictions (pdfclean in.pdf out.pdf) unless the newer
>> strong encryption has been chosen.
>
> Even though I had no problem with removing the protection of
> Jonathan's file

You didn't do that. You just used a tool that is able to output the
visual contents to a new file destroying completely the internal
structure of the source PDF. All that might be embedded in a 'real PDF'
will always get lost with such approaches.

It's still important to get the difference between an owner password and
an user password.

> Unfortunately, I didn't find this "pdfclean" program for linux:

As said twice already... it's part of Artifex' new MuPDF engine, so it
should read 'apt-get install mupdf-tools' instead.

> Where do we get "pdfclean" for Linux?

tk@tux:~$ apt-cache search pdfclean
mupdf-tools - commmand line tools for the MuPDF viewer

Then

tk@tux:~$ apt-cache show mupdf-tools
...
This package contains command line tools using the MuPDF library:
...
pdfclean to decompress and pretty print streams and objects in PDF files.

BTW: This is not the 'Linux way' but Debian instead. On other distros
you would have to use yum, pacman and the like instead.

Regards,

Thomas

Dennis O'Neill

unread,
Dec 8, 2014, 1:20:49 AM12/8/14
to
Jonathan N. Little wrote, on Mon, 08 Dec 2014 00:35:57 -0500:

> This is a non-binary NG, but my email is real. Yes I'd be interested in
> looking at it. Of course Corel licensed the PDF component from Adobe and
> I have no Acrobat installed, but it would be interesting if a PDF
> created from Adobe's software to be so easily circumvented.

I emailed to your address the original file and the edited result.

That edited result was created by the following method on Windows:
1. I copied your original to Windows XP.
2. I removed permission with Ghostscript version 5.
3. I edited it with Adobe Acrobat version 6 and I had absolutely
no problem selecting the text to change it.

I also sent you a second email with the result from Linux:
a. I copied your original to Linux.
b. I removed permissions with Dejavu.
c. I tried editing with Adobe Acrobat version 6 on Windows but I
could not select the text for some reason, even though Acrobat
reported that the file was no longer protected.

You can let me know here, in the newsgroup, when you get those,
as I don't check that throwaway email often.

Dennis O'Neill

unread,
Dec 8, 2014, 1:30:33 AM12/8/14
to
Jonathan N. Little wrote, on Mon, 08 Dec 2014 00:35:57 -0500:

> First just install the package build-essential
> sudo apt-get install build-essential
> Then download the tarball pdfedit-0.4.5.tar.gz from sourceforge
> Extract the source and make the install...

I had figured out the need for build-essential, but, I stopped
when it complained about the lack of a path for Qt:

$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 311 not upgraded.

When I run "./configure", I get a QTDIR error:
configure: error: QTDIR environment variable must be set

Googling, I find this Ubuntu documentation:
https://answers.launchpad.net/ubuntu/+question/62204

That says to set:
export QTDIR=/usr/share/qt3

But, I only have /usr/share/qt4 (Kubuntu 14.10).

So, I set it and tried to run ./configure again:
export QTDIR=/usr/share/qt4
./configure
...
checking for QT qmake... found /usr/bin/qmake but it failed check
checking for another... found /usr/bin/qmake but it failed check
checking for another... configure: error: unable to find qmake for QT3

I think I'm gonna give up trying to compile pdfedit on Kubuntu 14.10.

Thomas Kaiser

unread,
Dec 8, 2014, 1:45:52 AM12/8/14
to
Dennis O'Neill schrieb in <news:m63g00$reb$1...@solani.org>
> 2. I removed permission with Ghostscript version 5.

No, you didn't do that. You created a new document based on the visual
contents. Which is easy if one uses only outdated technology from 15
years ago in PDF (black and white text) but will fail with every modern
PDF that uses just a small subset of PDF 1.4 or above.

Think about it: If an owner password is set you can open the PDF for
display. Since this is possible and the PDF viewer is able to display
the contents it can send this stuff not only to the screen but also
redirect it into a virtual printer device (if printing is 'allowed' and
the PDF viewer in question honors this setting! In the past there
existed many PDF viewers that didn't care at all about these security
settings so even when you were not 'allowed' to print they didn't care
-- that's the whole problem with the owner password. Since it is _not_
required to open a PDF -- unlike the user password -- the PDF's contents
are accessible by the PDF viewer. And all of the restrictions depend on
the PDF viewer honoring these settings or not)

But nowadays even PDFs with just an owner password can be protected by a
better encryption and when you want to remove these restrictions to get
access to all the PDF internals (layers, metadata, form fields and so
on) then it might need a brute-force attack that might take ages. While
refrying is still possible since the whole concept of being able to
_open_ the PDF without being queried for a password makes the 'owner
password' approach a matter of good will. If the viewer is allowed to
display the PDF's contents than an application is always able to
redirect the visual contents into another file. Without removing the PDF
restrictions since it's a new PDF file containing just the page contents
(all other contents are gone -- try this with a fillable form and you
realize the difference)

Regards,

Thomas

Dennis O'Neill

unread,
Dec 8, 2014, 1:50:40 AM12/8/14
to
Thomas Kaiser wrote, on Mon, 08 Dec 2014 06:45:51 +0000:

> No, you didn't do that. You created a new document based on the visual
> contents. Which is easy if one uses only outdated technology from 15
> years ago in PDF (black and white text) but will fail with every modern
> PDF that uses just a small subset of PDF 1.4 or above.

I appreciate the clarification, and I don't doubt what you're saying
which is that I created a "something" COPY of the original PDF, without
the permissions.

The "something" copy is more than just a visual copy, since the fonts
are there, but, it might not be a faithful copy of everything possible
in a PDF file.

The fact is that I've been making these copies, and editing the results
for years (probably only a handful of times a year though) on Windows,
and, the method I wrote about has worked for me faithfully.

Here's my old Windows instructions, from my notes:
Windows instruction for removing permission pdf permission files:

Download GPL Ghostscript 9.00 for 32-bit Windows (gs900w32.exe)
http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs900/gs900w32.exe
Download GSview release v4.9 Win32 self extracting archive (gsv49w32.exe)
http://mirror.cs.wisc.edu/pub/mirrors/ghost/ghostgum/gsv49w32.exe
Optional: Download ps2edit (pstoeditsetup350.exe)
http://prdownloads.sourceforge.net/pstoedit/pstoeditsetup350.exe?download
Run each of those installers in the order downloaded above
Bring up GSView by clicking on its shortcut
File->Open->protected_pdf_file.pdf
File->Convert (pdfwrite, 600dpi, all pages, ok)
It will ask for a file name for the new editable PDF file


I tried to install "pdf2edit" and "ghostview" or "gsview" on Linux,
but none were found in apt-get.

Dennis O'Neill

unread,
Dec 8, 2014, 1:53:22 AM12/8/14
to
Dennis O'Neill wrote, on Mon, 08 Dec 2014 06:30:32 +0000:

> I think I'm gonna give up trying to compile pdfedit on Kubuntu 14.10.

I got one step further, before I decided to give up trying to
compile pdfedit for 64-bit Kubuntu 14.04.

$ export QTDIR=/usr/share/qt4
$ ./configure
...
checking for QT qmake... found /usr/bin/qmake but it failed check
checking for another... found /usr/bin/qmake but it failed check
checking for another... configure: error: unable to find qmake for QT3

So, googling for this new problem, I find:
https://lists.debian.org/debian-user/2008/05/msg00742.html

This suggests the following command; but it failed:
$ sudo apt-get install qt3-dev-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package qt3-dev-tools

Dennis O'Neill

unread,
Dec 8, 2014, 1:56:01 AM12/8/14
to
Thomas Kaiser wrote, on Mon, 08 Dec 2014 06:05:37 +0000:

> You didn't do that. You just used a tool that is able to output the
> visual contents to a new file destroying completely the internal
> structure of the source PDF. All that might be embedded in a 'real PDF'
> will always get lost with such approaches.

Thanks for that clarification.

I agree that all I did was make a "copy" of the original PDF, where
that copy didn't have any permissions set.

That copy made on Linux using current tools seems to be different than
the copy made using ancient tools on Windows in that in the Windows
derived copy, the text was easily editable, while the Linux-derived
copy had no permissions, but, the text wasn't selectable (which is a
requirement for editing it, at least with Adobe Acrobat 6 on Windows).

Dennis O'Neill

unread,
Dec 8, 2014, 2:04:12 AM12/8/14
to
William Unruh wrote, on Sun, 07 Dec 2014 23:09:46 +0000:

> Why do not use exactly the same procedure as on Windows. Ie, use
> ghostscript, ghoseveiw and pdf2edit just as you do on windows.

I was able to find Ghostscript in apt-get, but not the other two
tools, ghostview (or gsview) and/or ps2pdf, in apt-get.

This is all that I could install on Linux (so far):
$ sudo apt-get install ghostscript

Thomas Kaiser

unread,
Dec 8, 2014, 2:57:56 AM12/8/14
to
Dennis O'Neill wrote in <news:m63ihb$reb$6...@solani.org>
> William Unruh wrote, on Sun, 07 Dec 2014 23:09:46 +0000:
>
>> Why do not use exactly the same procedure as on Windows. Ie, use
>> ghostscript, ghoseveiw and pdf2edit just as you do on windows.
>
> I was able to find Ghostscript in apt-get, but not the other two
> tools, ghostview (or gsview) and/or ps2pdf, in apt-get.

Wrong approach, you might want to use "apt-cache search" instead or
simply do web searches instead of relying on a tool you're not familiar
with.

tk@tux:~$ apt-cache search ghostview
...
gv - PostScript and PDF viewer for X

tk@tux:~$ apt-cache show gv
...
Description-en: PostScript and PDF viewer for X
gv is a comfortable viewer of PostScript and PDF files for the X
Window System. It uses the ghostscript PostScript interpreter
and is based on the classic X front-end for gs, ghostview, which
it has replaced now.

> This is all that I could install on Linux (so far):
> $ sudo apt-get install ghostscript

Unfortunately you always refer to 'Linux' and don't say which specific
distro you're using in which version (since then it might be possible
for more experienced readers to assist you in getting software installed
eg. using 'backports' or 'apt pinning'. Compiling complex software with
many dependencies is always PITA)

BTW: The teacher you're assisting is on OS X. This is the perfect
platform if one still wants to do lightweight editing inside PDFs since
OS X 'display manager' is built on top of PDF. Every bit of information
OS X displays on screen is PDF internally. So there are a couple of
basic frameworks integrated in the operating system that make dealing
with PDF *objects* quite simple.

If the teacher would have used eg. Proview PDF Editor she would have
been able to open the restricted PDFs, rearrange them and make basic
text edits/additions.

http://www.macupdate.com/app/mac/33564/proview-pdf-editor

And for removal of the restrictions if just a simple owner password is
used this tiny 'Automator Action' combined with MuPDF's cleanpdf would
have done the job instantly without installation dramas on Linux or
inappropriate refrying attempts that alter the PDF's contents:

http://www.macupdate.com/app/mac/49937/cleanpdf

BTW: If you will ever succeed in installing pdfedit than you should
realize that it's an editor that focuses on the PDF's internal structure
and not primarily on the visual contents. If you walk along the object
tree inside the PDF when comparing an original PDF and one of your GS
variants you might get a clue what's happening behind the scenes.

http://pdfedit.cz/en/user_doc.html#gui_objtreepropedit_id

(the same is possible with Acrobat [Pro] on Windows and OS X from within
the preflight functionality that exposes the whole internal structure of
PDFs if wanted. Without such functionality it's not possible to answer
questions like 'why isn't the text selectable?')

Regards,

Thomas

Thomas Kaiser

unread,
Dec 8, 2014, 3:27:14 AM12/8/14
to
Dennis O'Neill schrieb in <news:m63hnv$reb$3...@solani.org>
> Here's my old Windows instructions
> ...
> Bring up GSView by clicking on its shortcut
> File->Open->protected_pdf_file.pdf
> File->Convert (pdfwrite, 600dpi, all pages, ok)
> It will ask for a file name for the new editable PDF file

And you got a brand new PDF. In Linux you would simply do a

cleanpdf source.pdf target.pdf

and on OS X it would be enough to select one or many PDFs in Finder,
then right click on them and use "CleanPDF" (which basically invokes
MuPDF's cleanpdf). Pdfinfo output before

Encrypted: yes (print:yes copy:no change:no addNotes:no)
File size: 50748 bytes
PDF version: 1.4

and after:

Encrypted: no
File size: 50823 bytes
PDF version: 1.4

It's the same PDF with restrictions removed.

There's no need to follow outdated instructions destroying the PDF's
'non visible' contents if it's just about removing an owner password and
its restrictions _if_ this owner password is not based on AES-256 as in
Jonathan's case. Then you're lost unless you go the refrying route which
is something completely different. BTW: You even failed to realize that
you modified the page size before when refrying Jonathan's PDF:

Page size: 612 x 792 pts (letter)
File size: 10240 bytes
Optimized: yes
PDF version: 1.7

vs. GhostScript's freshly created PDF based on visual contents:

Page size: 595 x 792 pts
File size: 33962 bytes
Optimized: no
PDF version: 1.5

Regards,

Thomas

ken

unread,
Dec 8, 2014, 4:42:42 AM12/8/14
to
In article <slrnm8amg3.26u...@phg-online.de>,
Thomas...@phg-online.de says...

> > I was able to find Ghostscript in apt-get, but not the other two
> > tools, ghostview (or gsview) and/or ps2pdf, in apt-get.
>
> Wrong approach, you might want to use "apt-cache search" instead or
> simply do web searches instead of relying on a tool you're not familiar
> with.
>
> tk@tux:~$ apt-cache search ghostview
> ...
> gv - PostScript and PDF viewer for X
>
> tk@tux:~$ apt-cache show gv
> ...
> Description-en: PostScript and PDF viewer for X
> gv is a comfortable viewer of PostScript and PDF files for the X
> Window System. It uses the ghostscript PostScript interpreter
> and is based on the classic X front-end for gs, ghostview, which
> it has replaced now.

Just a note in passing, gv on Linux is not the same application as
Ghostview on Windows. While both do use Ghostscript, the capabilities of
the two applications are significantly different.

That said, there is nothing 'magic' about Ghostview, it simply uses
Ghostscript to do the heavy lifting, so you could do exactly the same
without using Ghostview at all, on Windows or any other platform.

However, as alluded to by Thomas, and probably others (I haven't read
all the posts on this thread), using Ghostscript's pdfwrite on a
password protected (or, indeed, any) PDF file does not 'remove the
password'. What it does is create a brand new PDF file by, in effect,
printing the original PDF file. This has consequences; some content may
be transformed (fonts for example), some may be rendered (eg transparent
content if the output PDF is set to be PDF 1.3 or less) and some
'metadata' may not be preserved. In particular certain kinds of
annotation are not carried through (mostly things like Movies, embedded
3D data etc, which don't make sense when printing).

There can be advantages to this approach as well, but its important to
understand what it is you are actully doing, so that changes in the PDF
file don't catch you by surprise.

Ken

Eef Hartman

unread,
Dec 8, 2014, 4:46:08 AM12/8/14
to
In alt.os.linux Thomas Kaiser <Thomas...@phg-online.de> wrote:
> gv - PostScript and PDF viewer for X
>
> tk@tux:~$ apt-cache show gv

Note: gv is not ghostview, it's a branch from the sources OF ghostview:
> gv was written by Johannes Plass, using the source code for Tim
> Theisen's ghostview 1.5 as a starting point.
The package gv now is the most common ghostscript viewer in Linux
distro's.

Ghostview itself is now dead, but there are several derivatives (and
alternatives) from its sources, see i.e.
http://pages.cs.wisc.edu/~ghost/gv/index.htm

ken

unread,
Dec 8, 2014, 5:04:55 AM12/8/14
to
In article <5485735f$0$2858$e4fe...@news2.news.xs4all.nl>,
E.J.M....@gmail.com says...

> Note: gv is not ghostview, it's a branch from the sources OF
ghostview:
> > gv was written by Johannes Plass, using the source code for Tim
> > Theisen's ghostview 1.5 as a starting point.
> The package gv now is the most common ghostscript viewer in Linux
> distro's.
>
> Ghostview itself is now dead, but there are several derivatives (and
> alternatives) from its sources, see i.e.
> http://pages.cs.wisc.edu/~ghost/gv/index.htm

Its true that the old Ghostview for Unix systems is long gone, but
Ghostview for Windows was developed by Russell Lang (he owned the
trademark as well) and although its been some time since there was a
release, its not dead.

Artifex is in the process of putting together a new version of Ghostview
which will use both Ghostscript and MuPDF. Currently this runs on
Windows, but we are investigating making a *nix version using Qt.
(hopefully this covers Mac OS/X, Linux, etc)


Ken

ken

unread,
Dec 8, 2014, 6:46:19 AM12/8/14
to
In article <MPG.2eef87e83...@usenet.plus.net>, k...@spamcop.net
says...

> Its true that the old Ghostview for Unix systems is long gone, but
> Ghostview for Windows was developed by Russell Lang (he owned the
> trademark as well) and although its been some time since there was a
> release, its not dead.
>
> Artifex is in the process of putting together a new version of Ghostview
> which will use both Ghostscript and MuPDF. Currently this runs on
> Windows, but we are investigating making a *nix version using Qt.
> (hopefully this covers Mac OS/X, Linux, etc)

Mired in my own confusion here. I should have been referring to *GSView*
above, not Ghostview. The one and only Ghostview was created by Tim
Theisen and was a Unix application.

GSView was originally available on Windows Linux and OS/X but recent
versions, at least, have only been available on Windows. It is GSView
that Russell owns the rights to and its GSView that Artifex will release
a new version of, hopefully on *nix systems and Windows, and with
improved functionaltiy all round.

Apologies for my confusion,


Ken

Jasen Betts

unread,
Dec 8, 2014, 7:02:17 AM12/8/14
to
On 2014-12-07, Dennis O'Neill <don...@aol.is.invalid> wrote:

> While I can remove PDF permissions on Windows using Ghostscript,
> GSView, and ps2edit, I don't know to do so on Linux.

Have you tried ghostscript, gv, and ps2edit ?

--
umop apisdn

Jasen Betts

unread,
Dec 8, 2014, 7:02:18 AM12/8/14
to
gnome document viewer say "security: no" in the about on the original
document.

On 2014-12-08, Dennis O'Neill <don...@aol.is.invalid> wrote:
> William Unruh wrote, on Sun, 07 Dec 2014 23:09:46 +0000:
>
>> Why do not use exactly the same procedure as on Windows. Ie, use
>> ghostscript, ghoseveiw and pdf2edit just as you do on windows.
>
> I was able to find Ghostscript in apt-get, but not the other two
> tools, ghostview (or gsview) and/or ps2pdf, in apt-get.

gosttview is called "gv" it has been called that since 1993 or earlier
ps2pdf is part of the ghostscript package.

try "pdf2ps" followed by "pdf2ps" it removees the copyright notice.

pdf2ps PDF_Permission_Test_for_Marek.pdf tmp.ps
ps2pdf tmp.ps clear00.pdf


there is another tool called pdftops I am not sure how it differs from
pdf2ps

pdftk does not seem to require a password

pdftk PDF_Permission_Test_for_Marek.pdf output clear01.pdf

it complains about the lack of password, but still completes the process.
as far as I can tell.

but then I am not certain that the PDF was locked.

on the other hand pdf locking requires software that supports that
featur. in othewr words it's voluntary.

> This is all that I could install on Linux (so far):
> $ sudo apt-get install ghostscript

all that's required now is

$ sudo apt-get install gv


As for editing inkscape can edit single page ps or pdf documents (or
open a page from a larger documnet and save it as a single page)

also you can edit some postcript documents with a text editor if you
understand the language,



Seriously unless you can show that all that content is in the public domain
you should probably pay the registration fee so you can have the enhanced
user interface on the website instead of flaunting theit copyright
notice.

--
umop apisdn

Jasen Betts

unread,
Dec 8, 2014, 7:02:19 AM12/8/14
to
On 2014-12-07, Jonathan N. Little <lws...@gmail.com> wrote:
>
> You mean break the password protections of the PDF document itself? I
> did not think this was possible directly as part of Adobe's design. The
> only way I can think of to bypass this is to print the PDF (if the PDF
> has printing privileges allowed) to a virtual PDF printer to create a
> new PDF from the original.

adobe is the onl one who understands how pdf passwords work, everyone
else ignores them :) anyway, not sure these ones are locked.

--
umop apisdn

Jasen Betts

unread,
Dec 8, 2014, 7:02:20 AM12/8/14
to
On 2014-12-07, Jonathan N. Little <lws...@gmail.com> wrote:
> Dennis O'Neill wrote:
>> Jonathan N. Little wrote, on Sun, 07 Dec 2014 15:26:26 -0500:
>>
>>> You mean break the password protections of the PDF document itself? I
>>> did not think this was possible directly as part of Adobe's design.
>>
>> I have been removing PDF permissions when necessary for about 10 years
>> now, so, it's definitely possible (as shown for Windows earlier).
>
> Really? Okay edit this PDF. Change the text:
>
><http://www.littleworksstudio.com/temp/usenet/editthis.pdf>

http://homepages.xnet.co.nz/~jasen/e3.pdf


--
umop apisdn

Jasen Betts

unread,
Dec 8, 2014, 7:02:21 AM12/8/14
to
On 2014-12-07, Peter Köhlmann <peter-k...@t-online.de> wrote:
> Jonathan N. Little wrote:
>
>> Dennis O'Neill wrote:
>>> Jonathan N. Little wrote, on Sun, 07 Dec 2014 15:26:26 -0500:
>>>
>>>> You mean break the password protections of the PDF document itself? I
>>>> did not think this was possible directly as part of Adobe's design.
>>>
>>> I have been removing PDF permissions when necessary for about 10 years
>>> now, so, it's definitely possible (as shown for Windows earlier).
>>
>> Really? Okay edit this PDF. Change the text:
>>
>> <http://www.littleworksstudio.com/temp/usenet/editthis.pdf>
>>
>>
>
> Sneaky. Posting a "text" as a picture

no, it's text.

--
umop apisdn

ken

unread,
Dec 8, 2014, 7:26:07 AM12/8/14
to
In article <m64096$kj1$1...@gonzo.reversiblemaps.ath.cx>, ja...@xnet.co.nz
says...

> > I was able to find Ghostscript in apt-get, but not the other two
> > tools, ghostview (or gsview) and/or ps2pdf, in apt-get.
>
> gosttview is called "gv" it has been called that since 1993 or earlier

No, sorry that's not the case. Ghostview and gv are different
applications (despite my own contruibution to the confusion earlier).


> ps2pdf is part of the ghostscript package.
>
> try "pdf2ps" followed by "pdf2ps" it removees the copyright notice.

I assume you mean pdf2ps followed by ps2pdf. Note that these are just
convenience scripts which invoke Ghostscript itself.

There really isn't a good reason to do PDF->PS->PDF, it just adds more
conversions and an increased likelihood that there will be some
unexpected/unwanted change in the document.

'Round-tripping' as its often called, isn't a good idea in general.


> there is another tool called pdftops I am not sure how it differs from
> pdf2ps

It uses Poppler instead of Ghostscript. But converting to PostScript is
still not a good plan.


> but then I am not certain that the PDF was locked.
>
> on the other hand pdf locking requires software that supports that
> featur. in othewr words it's voluntary.

Hmm, the permissions restrictions are 'voluntary', in that applications
can ignore the flags, but the encryption on the file isn't. That's why
Ghostscript can open the file and honour the 'print' flag.

Note that you can't apply permissions without supplying an owner and
user password (though they can be blank). An empty user password means
that the file can be opened wihtout a password, but applications that do
so are expected to apply the permissions unless the owner password is
supplied.


Ken

Dennis O'Neill

unread,
Dec 8, 2014, 7:40:50 AM12/8/14
to
ken wrote, on Mon, 08 Dec 2014 09:42:03 +0000:

> Just a note in passing, gv on Linux is not the same application as
> Ghostview on Windows. While both do use Ghostscript, the capabilities of
> the two applications are significantly different.

I see.

After installing "gv" on Kubuntu 14.04 (following Thomas' instructions),
I see that the "gv" I installed on Kubuntu 14.04 does not even have a
"File > Convert" button, which is what was used on Windows to "copy" the
PDF without permissions.

Dennis O'Neill

unread,
Dec 8, 2014, 7:58:08 AM12/8/14
to
Jasen Betts wrote, on Mon, 08 Dec 2014 10:58:46 +0000:

> try "pdf2ps" followed by "pdf2ps" it removees the copyright notice.

Thank you Jasen,
That seemed to work fine on Jonathan's Corel-Draw-bsaed protected PDF.

$ pdfinfo secured.pdf
Title: Untitled-1
Keywords: Test Password Protected PDF
Author: Jonathan N Little
Creator: CorelDRAW X5
Producer: Corel PDF Engine Version 15.2.0.695
CreationDate: Sun Dec 7 17:57:13 2014
ModDate: Sun Dec 7 17:57:13 2014
Tagged: no
Form: none
Pages: 1
Encrypted: yes (print:no copy:no change:no addNotes:no algorithm:AES-256)
Syntax Error: Missing 'endstream' or incorrect stream length
Syntax Warning: Failed parsing hints table object
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
...
Page size: 612 x 792 pts (letter)
Page rot: 0
File size: 10240 bytes
Optimized: yes
PDF version: 1.7

$ pdf2ps secured.pdf temp.ps
$ ps2pdf temp.ps not_secured.pdf

$ pdfinfo not_secured.pdf
Creator: GPL Ghostscript 910 (ps2write)
Producer: GPL Ghostscript 9.10
CreationDate: Mon Dec 8 04:53:51 2014
ModDate: Mon Dec 8 04:53:51 2014
Tagged: no
Form: none
Pages: 1
Encrypted: no
Page size: 612 x 792 pts (letter)
Page rot: 0
File size: 7915 bytes
Optimized: no
PDF version: 1.4

Dennis O'Neill

unread,
Dec 8, 2014, 8:03:05 AM12/8/14
to
Jasen Betts wrote, on Mon, 08 Dec 2014 10:58:46 +0000:

> Seriously unless you can show that all that content is in the public domain
> you should probably pay the registration fee so you can have the enhanced
> user interface on the website instead of flaunting theit copyright
> notice.

The purpose of editing the output PDF from that problematic web site
was simply to be able to renumber the problem set of concatenated PDF
files so that it flowed continually.

For example, if file1.pdf contains problems 1 through 4 and file2.pdf
contained problems 1-6, any concatenated PDF would have it's problems
numbered 1,2,3,4,1,2,3,4,5,6 instead of 1,2,3,4,5,6,7,8,9,10.

Likewise with the page count at the bottom of the sheet.

We simply wished to renumber (but we have since given up on that endeavor).

Dennis O'Neill

unread,
Dec 8, 2014, 8:06:07 AM12/8/14
to
Thomas Kaiser wrote, on Mon, 08 Dec 2014 08:27:13 +0000:

> cleanpdf source.pdf target.pdf

Am still looking for how to install this, otherwise wonderful,
command on Linux (64-bit Kubuntu 14.04).

ken

unread,
Dec 8, 2014, 8:08:04 AM12/8/14
to
In article <m6478u$fqg$2...@solani.org>, don...@aol.is.invalid says...

> Thank you Jasen,
> That seemed to work fine on Jonathan's Corel-Draw-bsaed protected PDF.

> $ pdf2ps secured.pdf temp.ps
> $ ps2pdf temp.ps not_secured.pdf

You should be able to get the same result, without going via PostScript,
by using something like:

gs -sDEVICE=pdfwrite -sOutputFile=not-secured.pdf secured.pdf


Converting to PostScript risks the resulting PDF file being
significantly different, because the PDF graphics model is richer than
the PostScript graphics model, this is especially true of PostScript
level 2 which is what the ps2write device in Ghostscript creates.

In addition, annotations will not be preserved as annotations but will
migrate into the PDF content, and metadata such as outlines, hyperlinks
etc will be dropped, as threre is no way to represent these in
PostScript.

While there are potential problems creating a new PDF file from an
existing one, its considerably more likely to succeed than going to
PostScript.

Ken

Dennis O'Neill

unread,
Dec 8, 2014, 8:12:44 AM12/8/14
to
Jasen Betts wrote, on Mon, 08 Dec 2014 09:52:01 +0000:

> Have you tried ghostscript, gv, and ps2edit ?

I do appreciate the advice.

On Kubuntu 14.04 ...
1. I did install "ghostscript"
$ sudo apt-get install ghostscript
$ ghostscript --version
9.10

2. When I tried "gv", there was no "File > Convert" command.
$ gv --version
gv 3.7.4
$ gv secured.pdf
File > (there is no convert command)

3. I couldn't find "ps2edit".
$ ps2edit
ps2edit: command not found
$ sudo apt-get install ps2edit
...
E: Unable to locate package ps2edit
$ apt-cache search ps2edit
(finds nothing)

Dennis O'Neill

unread,
Dec 8, 2014, 8:22:54 AM12/8/14
to
ken wrote, on Mon, 08 Dec 2014 13:07:25 +0000:

> gs -sDEVICE=pdfwrite -sOutputFile=not-secured.pdf secured.pdf

That works much better!

$ gs -sDEVICE=pdfwrite -sOutputFile=not-secured.pdf secured.pdf
GPL Ghostscript 9.10 (2013-08-30)
Copyright (C) 2013 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
>>showpage, press <return> to continue<<

GS>quit

$ pdfinfo not-secured.pdf
Title: Untitled-1
Keywords: Test Password Protected PDF
Author: Jonathan N Little
Creator: CorelDRAW X5
Producer: GPL Ghostscript 9.10
CreationDate: Mon Dec 8 05:20:16 2014
ModDate: Mon Dec 8 05:20:16 2014
Tagged: no
Form: none
Pages: 1
Encrypted: no
Page size: 612 x 792 pts (letter)
Page rot: 0
File size: 9230 bytes

Luuk

unread,
Dec 8, 2014, 8:35:56 AM12/8/14
to
luuk@opensuse:~/tmp> pdftotext editthis.pdf - | sed 's/^L//'
Syntax Error: Missing 'endstream' or incorrect stream length
Syntax Warning: Failed parsing hints table object
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Okay edit this line.

luuk@opensuse:~/tmp> pdftotext e3.pdf - | sed 's/^L//'
✁✂✄ ✆✝✆✝✞ ✞✟✝✠ ✡✝☛☎☞

luuk@opensuse:~/tmp>

Jonathan N. Little

unread,
Dec 8, 2014, 9:22:05 AM12/8/14
to
Dennis O'Neill wrote:
> Jonathan N. Little wrote, on Mon, 08 Dec 2014 00:35:57 -0500:
>
>> This is a non-binary NG, but my email is real. Yes I'd be interested in
>> looking at it. Of course Corel licensed the PDF component from Adobe and
>> I have no Acrobat installed, but it would be interesting if a PDF
>> created from Adobe's software to be so easily circumvented.
>
> I emailed to your address the original file and the edited result.

Got it.

>
> That edited result was created by the following method on Windows:
> 1. I copied your original to Windows XP.
> 2. I removed permission with Ghostscript version 5.
> 3. I edited it with Adobe Acrobat version 6 and I had absolutely
> no problem selecting the text to change it.
>

Now this one I was able to re-import back into Corel and modify with
with abandon. Interesting that to remove protections did triple the size
of the file.

> I also sent you a second email with the result from Linux:
> a. I copied your original to Linux.
> b. I removed permissions with Dejavu.
> c. I tried editing with Adobe Acrobat version 6 on Windows but I
> could not select the text for some reason, even though Acrobat
> reported that the file was no longer protected.
>

Now this conversion the text was actually no longer vector, but
individual bitmaps of each letter.

> You can let me know here, in the newsgroup, when you get those,
> as I don't check that throwaway email often.
>

So goes Adobe's proprietary format! I am not fan of proprietary anyway.
I haven't installed Acrobat reader in years, I used Foxit until it's
plugin stopped working in SeaMonkey and now use Nitro. I wish there was
an real open-source that could replace my CorelDraw, and my last Windows
could be sent to the cornfield.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Jonathan N. Little

unread,
Dec 8, 2014, 9:25:35 AM12/8/14
to
Dennis O'Neill wrote:

> I appreciate the clarification, and I don't doubt what you're saying
> which is that I created a "something" COPY of the original PDF, without
> the permissions.

Which in the end with any file you can take a screenshot to capture the
contents. Will a little OCR restore to an editable format. I have had to
do than on more than one occasion to rescue lost data...

ken

unread,
Dec 8, 2014, 9:27:12 AM12/8/14
to
In article <m64c5q$56l$1...@dont-email.me>, lws...@gmail.com says...

> > That edited result was created by the following method on Windows:
> > 1. I copied your original to Windows XP.
> > 2. I removed permission with Ghostscript version 5.

Version 5 ? (!!!) The current version is 9.15.

> > 3. I edited it with Adobe Acrobat version 6 and I had absolutely
> > no problem selecting the text to change it.
> >
>
> Now this one I was able to re-import back into Corel and modify with
> with abandon. Interesting that to remove protections did triple the size
> of the file.

To be honest, that's not surprising if it really was created using such
an old version of Ghostscript.

>
> > I also sent you a second email with the result from Linux:
> > a. I copied your original to Linux.
> > b. I removed permissions with Dejavu.
> > c. I tried editing with Adobe Acrobat version 6 on Windows but I
> > could not select the text for some reason, even though Acrobat
> > reported that the file was no longer protected.
> >
>
> Now this conversion the text was actually no longer vector, but
> individual bitmaps of each letter.

Well, that might happen depending how the PDF file was produced (and is
considerably more likely if such an old version of Ghostscript was used)



Ken

Jonathan N. Little

unread,
Dec 8, 2014, 9:28:40 AM12/8/14
to
No longer text but a series of bitmap letters.

Dennis O'Neill

unread,
Dec 8, 2014, 9:39:40 AM12/8/14
to
Luuk wrote, on Mon, 08 Dec 2014 14:35:55 +0100:

> luuk@opensuse:~/tmp> pdftotext editthis.pdf - | sed 's/^L//'
> Syntax Error: Missing 'endstream' or incorrect stream length
> Syntax Warning: Failed parsing hints table object
> Syntax Warning: Failed to get object num from hint tables for page 1
> Syntax Warning: Failed parsing page 1 using hint tables
> Syntax Warning: Failed to get object num from hint tables for page 1
> Syntax Warning: Failed parsing page 1 using hint tables
> Okay edit this line.

I'm not sure what that showed, but I got something similar on
Jonathan's 'editthis.pdf' file, except without the Wingdings-like
stuff that Luuk got at the very end.

$ pdftotext editthis.pdf - | sed 's/^L//'

Jonathan N. Little

unread,
Dec 8, 2014, 9:40:42 AM12/8/14
to
Thomas Kaiser wrote:
> Jonathan N. Little schrieb in <news:m63cls$1j9$1...@dont-email.me>
>> Dennis O'Neill wrote:
>>> Jonathan N. Little wrote, on Sun, 07 Dec 2014 21:04:50 -0500:
>>>
>>>> It is absolutely not in image. Vector. Embedded font.
>>> [...]
>>> So, I simply started with the original PDF on Windows, and then
>>> ran an ancient version of Ghostscript to open up the encrypted
>>> PDF, which removed the encryption, and then I saved that result.
>>>
>>> Going back to Adobe Acrobat 6 to open up the Ghostscript created
>>> PDF, then I *could* select the text and edit it easily.
>>
>> Interesting that an ancient open-source tool could disabled Adobe's
>> protections.
>
> It's still the very same question since the beginning: Owner password
> (no need to enter a password to *open* the PDF) vs. user password. The
> latter is always combined with more or less strong encryption the former
> (just an owner password) is always only a hint for the application in
> question that opens the PDF. If it can be opened without a password then
> everything can be done with _the contents_ that are used to display the
> page layout.

So with this one with display also password now truly "protect" a document?

<http://www.littleworksstudio.com/temp/usenet/noprintordisplay.pdf>

Curious if there is any protection as it is common practice for folks to
save sensitive information such as tax returns in PDF format?

Dennis O'Neill

unread,
Dec 8, 2014, 9:45:04 AM12/8/14
to
Jonathan N. Little wrote, on Mon, 08 Dec 2014 09:21:53 -0500:

> Now this conversion the text was actually no longer vector,
> but individual bitmaps of each letter.

Thanks for taking the time and energy to confirm that there
was "something" different about the two methods.

The age-old WinXP Ghostscript "File > Convert" method produced
editable text, while the Linux PDF-to-PS-to-PDF method produced
bitmap text.

That explains nicely why Adobe Acrobat 6, on Windows, could only
edit the text of the former, and not the latter.

Thanks.

Dennis O'Neill

unread,
Dec 8, 2014, 9:48:12 AM12/8/14
to
Jonathan N. Little wrote, on Mon, 08 Dec 2014 09:21:53 -0500:

> my last Windows
> could be sent to the cornfield.

Heh heh ... the hardest part of my conversion of the editthis.pdf
file was booting that ancient Windows XP laptop (the battery was
dead so I had to find a suitable power supply for an old gray
Toshiba laptop).

Once Windows XP support died, I converted everything that was still
in service to Linux. I'm *still* in the steep part of the Linux
learning curve though ... and don't know if it will ever flatten
out...

Dennis O'Neill

unread,
Dec 8, 2014, 9:48:51 AM12/8/14
to
ken wrote, on Mon, 08 Dec 2014 14:26:32 +0000:

> Version 5 ? (!!!) The current version is 9.15.

Heh heh ... I did admit it was an *old* Windows laptop!

It is loading more messages.
0 new messages