Here's how to get around copy and paste issues with text from a protected PDF. No programming talent required (which is good, is not a talent I have...). Sharing this knowledge may put me in contravention of some anti-consumer law somewhere, I don't know, it's a weird world.
Scenario: my partner was working on updating a report, reusing and updating material from an earlier report produced by a colleague. This earlier report was only available as a PDF and it turned out this PDF had protection enabled to prevent copy and paste. Now, I could either let her manually type out the material (amounting to quite a few pages of text) or I could find a way around it.
Simple it turns out to be...
In summary: convert the PDF to an image and feed it into an OCR engine. With care on the PDF to image conversion, and presuming a decent font/typography in the original PDF, the resulting OCR output should be near 100%.
There's a bunch of ways this can be achieved, what follows is the process I used (which should be more or less applicable anywhere, but was done with Linux on my partners XPS15). You should be able to more or less cut and paste the following commands to achieve a similar outcome on your own machine, once you've got the right software installed (tesseract and ghostscript).
First convert the PDF to an image (the TIFF format was used here as the PDF was multipage):
gs -o /path/to/outputfile.tif -sDEVICE=tiffgray -r720x720
-g6120x7920 -sCompression=lzw /path/to/inputfile.pdf
Then run OCR software to convert the image to txt:
tesseract /path/to/outputfile.tif /path/to/ocroutputfile
Done. One text file, simply and cleanly formatted, containing all the text from the protected PDF. All DRM can be defeated this easily - if you can see it, it can be copied.
NB If in another scenario if you needed the final output to be more nearly a copy of the original PDF you'd need to involve OCR layout functionality - but much of that's doable with Tesseract by changing the output format to hOCR. And then, if you really wanted to, you could use hocr2pdf to recreate the PDF...
Showing posts with label copyright. Show all posts
Showing posts with label copyright. Show all posts
Sunday, 18 May 2014
Tuesday, 1 May 2012
Another historical perspective...
There are so many questions around the existing copyright system; not least is that, whatever the historical justifications, the world has changed a huge amount since the discussions were last had in full. The presumption that, for example, breach of copyright "for profit" should be seen in the same way as when it was "not for profit" was presumably not considered historically, because the costs of reproduction were such that breach was generally for profit.
Of course the initial presumption that producers of content should have special protection over above producers of other things should also be revisited. Why should not doctors be paid for every time you use the leg they repaired? Plumbers each time someone uses the tap they installed?
For those who want to debate the need for change, please go and read this entry to the Future of Copyright contest. Engage in the debate there, engage in it here, I'm happy. But don't get into the position of thinking there's nothing wrong, just because you're used to thinking that. Today's historical perspective:
Of course the initial presumption that producers of content should have special protection over above producers of other things should also be revisited. Why should not doctors be paid for every time you use the leg they repaired? Plumbers each time someone uses the tap they installed?
For those who want to debate the need for change, please go and read this entry to the Future of Copyright contest. Engage in the debate there, engage in it here, I'm happy. But don't get into the position of thinking there's nothing wrong, just because you're used to thinking that. Today's historical perspective:
A long habit of not thinking a thing wrong, gives it a superficial appearance of being right, and raises at first a formidable outcry in defense of custom. But the tumult soon subsides. Time makes more converts than reason.
Thomas Paine, 1776
Tuesday, 3 April 2012
Copyright, content industries and "that's not fair"
In the sense of "and I'm going to tell my mummy government". Robert Heinlein penned the following quotation, as part of his first ever published story:
"There has grown up in the minds of certain groups in this country the notion that because a man or corporation has made a profit out of the public for a number of years, the government and the courts are charged with the duty of guaranteeing such profit in the future, even in the face of changing circumstances and contrary to public interest. This strange doctrine is not supported by statute or common law. Neither individuals nor corporations have any right to come into court and ask that the clock of history be stopped, or turned back."
"There has grown up in the minds of certain groups in this country the notion that because a man or corporation has made a profit out of the public for a number of years, the government and the courts are charged with the duty of guaranteeing such profit in the future, even in the face of changing circumstances and contrary to public interest. This strange doctrine is not supported by statute or common law. Neither individuals nor corporations have any right to come into court and ask that the clock of history be stopped, or turned back."
Robert A Heinlein, Life-Line, 1939
The copyright reform battle is enshrined in this thinking. On the one side we have people reasonably pointing out that the move to digital from analogue completely changes how content can and is being reproduced, reducing some formerly expensive processes to zero cost; on the other we have the rights holders shouting "no fair" and demanding the law is made tighter, rights extended longer, and that everyone else must be made to expend their resources and all unreasonable efforts to protect their lucrative business model.
But their business model, historically lucrative and rather young, is now outdated. Setting a book for a PDF can be carried out using cost-free software in hours and reproduction is free; people are creating popular music in their bedrooms and distributing it at no cost, and with the rise of Aframe (and presumably soon a Samwers clone ;) ) film production costs are following the huge drop in distribution and reproduction that digital and the Internet had already brought.
Subscribe to:
Posts (Atom)