LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   'Hacking a PDF' (https://www.linuxquestions.org/questions/programming-9/hacking-a-pdf-424474/)

RoaCh Of DisCor 03-13-2006 01:49 PM

'Hacking a PDF'
 
Hi.

I am not a programmer at all, and I'm not sure if this question is allowed... but I must ask.

http://www.linuxquestions.org/questi...d.php?t=423675

That thread describes my problem, but I'll sum it up quickly.

I bought an ebook from an ebook store.

Firstly it downloaded a file called ebx.etd...which wouldn't open in linux. So I ran it over to a friends windows computer, opened it in adobe reader for windows and it worked. It downloaded the pdf, so I was happy. I burnt it, brought it home, and tried opening it..yet it STILL wouldn't work.

Apparently the pdf file was created with 'DRM security', which is supported only on the WINDOWS client, but not the LINUX. The requirements that were listed on the ebook provider were 'adobe reader 6.0 or higher'...so I thought that was excellent, since linux is up to 7.0.6 . After reading, as I said, I found out that even on the same version for linux as windows, it is not supported in linux. I think that's horribly unfair, and I just wasted money.

Anyway, I was wondering if their was anyway to 'bipass' the security. I tried hexing it (haha)...but didnt get too far. I actually got it to open, but it all was blank.

Any help apreciated.

Mega Man X 03-13-2006 02:18 PM

Can't you return the book? They should have some sort of return policies. If, however, the supported/required system clearly described that it would not work with Linux, there's little you can do :\.

There's a very interesting project that can convert a pdf to a word doc. That may save you the trouble:

http://www.investintech.com/

There're similar ones(even free), that can convert pdf's to plain text. Works fine, but if the images on the book are important you will be, once again, in trouble :)

http://www.verypdf.com/pdf2txt/pdf2txt.htm

http://www.download.com/Easy-PDF-to-...-10349874.html

Those alternatives would most likely be easier than trying to bypass some security measures they did on the pdf file, I think :)

Dave Kelly 03-13-2006 03:33 PM

Try the stuff that Mega Man suggests. If no joy there, there is a whole slew of utilities for converting PDF to othere formats. I'll post a list of what I have at the bottom of this message so you will have some idea of what to look for if you need to search google.

Also don't overlook the 'convert' application in 'Imagemagick Suite'. Also run your ebook through "Open Office 2".

Quote:

SilverNail:~# apropos pdf
dvipdf (1) - Convert TeX DVI file to PDF using ghostscript and dvips
foomatic-ppdfile (1) - Generate a PPD file for a given printer/driver combo
gs (1) - Ghostscript (PostScript and PDF language interpreter and previewer)
gs-esp (1) - Ghostscript (PostScript and PDF language interpreter and previewer)
gs-gpl (1) - Ghostscript (PostScript and PDF language interpreter and previewer)
gsnd (1) - Run ghostscript (PostScript and PDF engine) without display
htdig-pdfparser (1) - parse a PDF document (wrapper script for htdig)
kghostview (1) - KDE PS/PDF Viewer
pdf2dsc (1) - generate a PostScript page list of a PDF document
pdf2ps (1) - Ghostscript PDF to PostScript translator
pdffonts (1) - Portable Document Format (PDF) font analyzer (version 3.00)
pdfimages (1) - Portable Document Format (PDF) image extractor (version 3.00)
pdfinfo (1) - Portable Document Format (PDF) document information extractor (version 3.00)
pdfopt (1) - Ghostscript PDF Optimizer
pdftops (1) - Portable Document Format (PDF) to PostScript converter (version 3.00)
pdftotext (1) - Portable Document Format (PDF) to text converter (version 3.00)
ps2ascii (1) - Ghostscript translator from PostScript or PDF to ASCII
ps2pdf (1) - Convert PostScript to PDF using ghostscript
ps2pdf12 (1) - Convert PostScript to PDF 1.2 (Acrobat 3-and-later compatible) using ghostscript
ps2pdf13 (1) - Convert PostScript to PDF 1.3 (Acrobat 4-and-later compatible) using ghostscript
ps2pdfwr (1) - Convert PostScript to PDF without specifying CompatibilityLevel, using ghostscript
pstotext (1) - extract ASCII text from a PostScript or PDF file
texi2dvi4a2ps (1) - Compile Texinfo and LaTeX files to DVI or PDF
tiff2pdf (1) - convert a TIFF image to a PDF document
update-xpdfrc (8) - program to generate xpdf's configuration file
xpdfrc (5) - configuration file for Xpdf tools (version 3.00)
gv (1x) - a PostScript and PDF previewer
SilverNail:~#


Randux 03-13-2006 04:15 PM

There's also an option in Win Acroread (the adobe reader) to save a copy. Maybe if someone didn't do their homework, the saved copy won't be DRM-protected.

There are several PDF readers for linux: xpdf, gv, xv(?) and adobe. I happen to like the adobe one best, as much as I hate to admit it, but in a pinch like now, those other ones should be worth trying- they sure don't support DRM.

RoaCh Of DisCor 03-13-2006 06:35 PM

Quote:

Originally Posted by Mega Man X
Can't you return the book? They should have some sort of return policies. If, however, the supported/required system clearly described that it would not work with Linux, there's little you can do :\.

There's a very interesting project that can convert a pdf to a word doc. That may save you the trouble:

http://www.investintech.com/

There're similar ones(even free), that can convert pdf's to plain text. Works fine, but if the images on the book are important you will be, once again, in trouble :)

http://www.verypdf.com/pdf2txt/pdf2txt.htm

http://www.download.com/Easy-PDF-to-...-10349874.html

Those alternatives would most likely be easier than trying to bypass some security measures they did on the pdf file, I think :)

Hey thanks for the suggestions!

So far no luck, all of them tell me that the file is encrypted ;(.

Thanks though!

kev82 03-13-2006 07:06 PM

DRM, capitalism, email charges, ... what on earth is the world coming to? Wherever it is, I don't want to be there.

Anyway, It takes no more than 30s of googling(I love the fact that people recognise google as a verb!) to find lots of info and utilities for decrypting PDFs. I can't remember the forum policies, and am too tired to look them up so I won't post links. But needless to say there is a patch for xpdf out there to allow printing. At which point one could convert the printed postscript back to an unencrypted pdf with the above tools/utilities.

Mega Man X 03-14-2006 03:16 PM

I have to agree with kev82 here. This kind of trouble that we have to face makes me sad. PDF means Portable Document Format for crying out loud. Still, they put some fancy protection on it :rolleyes:. What makes me even more sad is the fact that peoples who did not pay for that pdf, most likely can use it without a problem. Same goes for peoples buying games: So many copy protections, CD-key protections, Play with CD-on drive, crappy applications like Steam... while peoples cracking it can play Online without problems connecting to a server to allow you to play among other annoyances. I bet those crackers even laugh at us :\

Well, try kev82 suggestions. If everything else fails, see if you can find the pdf on some p2p. Since you've paid for it, you won't feel like you are doing something wrong, I guess :)

scuzzman 03-14-2006 03:20 PM

You can always just run Acrobat/Reader through Wine...

RoaCh Of DisCor 03-14-2006 05:30 PM

Hey thanks for suggestions. No luck still :(.

@Scuzz, I can only get 5.0 to run properly with wine. I have to have 6.0 or higher to have the DRM functionality. I actually did get it to install...6.0...but the program itself doesn't display fully. Also, I can't seem to 'activate' adobe 6.0 from wine...which is also ANOTHER requirement to view this PDF. I get an error that it cannot find the adobe activator.

Dave Kelly 03-14-2006 06:19 PM

Quote:

Originally Posted by RoaCh Of DisCor
Apparently the pdf file was created with 'DRM security', which is supported only on the WINDOWS client, but not the LINUX. The requirements that were listed on the ebook provider were 'adobe reader 6.0 or higher'.

This sound like a another case of MS not playing nice. Didn't I read recently of instances like this where MS has created their own version of PDF.

I think I would complain sternly to the source you bought from about their documents conforming to the PDF standard.

RoaCh Of DisCor 03-14-2006 07:36 PM

I am, haha. Although, the person is like talking to a brick wall. They just paste worthless information on how to open the PDF in windows like I'm stupid. I've explained it, but they don't seem to get it. None the less I decided to install windows with vmware, and use that for now...even if it's incredibly slow. I wish there was a way to read it in linux, but it doesn't seem so. I can't even print it.

chrism01 03-14-2006 10:46 PM

Apparently some distors eg Gentoo have a compile option to ignore/turn off drm restrictions:
http://ask.slashdot.org/askslashdot/...4/209206.shtml
"But some gentoo ebuilds do, indeed, have USE flags that aren't just ./configure flags for some applications. For example, you can install xpdf with the 'nodrm' use flag, which applies a patch to cause xpdf to ignore drm restrictions."
http://gentoo.linuxhowtos.org/browse...=app-text/xpdf

Phyrexicaid 03-15-2006 07:11 AM

Why not download pdfcreator http://sourceforge.net/projects/pdfcreator/

That way you can print to this pdf plugin from your friends Windows pc. Perhaps this will solve your problem?

PhenuxRizing 09-27-2006 02:51 PM

You can get windows to convert that encrypted pdf into a postscript file, easily read in any linux distro.

Just follow the directions on this website

http://www.sketchpad.net/postscript-printer-winxp-1.htm

once you print the pdf to file instead of a printer you can transfer that file over to your linux box or you can open it directly in windows if you install ghostscript and ghostscript-viewer. Good luck, hope this helps

senyahnoj 09-27-2006 04:37 PM

As per PhenuxRizing's tip - then run the postscript file through ps2pdf on linux to convert it back to a PDF without any crap in it.


All times are GMT -5. The time now is 04:51 AM.