9 ms·
Semi-related tip: I despise protected pdfs with a passion. Especially when you download a datasheet and you can't add annotations or highlights to it. So, how t
by retSava 9y ago
Semi-related tip: I despise protected pdfs with a passion. Especially when you download a datasheet and you can't add annotations or highlights to it. So, how to remove this protection? One way is to print to postscript and convert back to pdf, but then you can't copy text from it.
Here's how (on windows): download qpdf (http://qpdf.sourceforge.net/ http://qpdf.sourceforge.net/) and run
qpdf.exe -decrypt encrypted.pdf woho.pdf
I made a small batchfile since I never remembered that syntax,
# usage:
# decrypt.sh mypdf.pdf
# the decrypted file will be named mypdf.pdf, while the old encrypted is now mypdf.pdf-encrypted.pdf
#
echo pdf to de-secure: $1
read -n 1 -s -p "Press any key to continue"
mv "$1" "$1"-encrypted.pdf
qpdf.exe -decrypt "$1-encrypted.pdf" "$1"
echo encrypted file is now named: $1-encrypted.pdf
echo decrypted file is: $1
- astockwell 9y agoPut that in AWS Lambda and charge $1 each. Boom, Saas-retirement-fund.
- untog 9y ago$1 is going to struggle to beat free: https://online2pdf.com/remove-pdf-restrictions https://online2pdf.com/remove-pdf-restrictions
- diggan 9y agoJust make the UX really great. And be sure to have a really complicated-but-looking-nice UI for downgrading, and people will blog about it.
- jermaustin1 9y agoI always find it hard to trust free. Even with T&Cs/ToS/Privacy, if I'm not paying for it, I feel that its all lies. Combine that with a site that looks like that, and I'm assuming my PDF will have a virus attached to it.
- untog 9y agoSure, but you're thinking about that kind of stuff even slightly, you're not going to be uploading your documents anywhere. I suspect the Venn diagram overlap between "thinks about online security" and "uploads documents to random web sites, even if they cost money" is small.
- piracykills 9y agoIf it's anything I need to care about privacy with, I'm not uploading it to someone else's server even if I pay for it, I'm doing it locally. But if it's say, as a friend recently experienced, a handout from a teacher in Corel Draw format, you bet your ass I'm uploading it to whatever the top google result for "convert corel draw to pdf online" is.
- thephyber 9y agoI don't pay anything to use HackerNews. How much do you pay?
- uptown 9y agoIf time is still money ... way too much!
- jermaustin1 9y agoThat is a completely different beast. I was talking specifically about uploading and downloading files I intend to open.
- deleted 9y ago[deleted]
- zmk_ 9y agoOpen in Chrome and print the PDF as PDF; also removes any editing restrictions while maintaining ability to select text.
- raquo 9y agoOn a Mac I think printing to the built in PDF saver might work?
- dangero 9y agoYes, or universally just open the pdf in Chrome, print, choose to save as pdf.
- mtmail 9y agoDidn't work for me. But easy to remove with ghostscript https://www.cyberciti.biz/faq/removing-password-from-pdf-on-linux/ https://www.cyberciti.biz/faq/removing-password-from-pdf-on-... (bottom of article)
- raverbashing 9y agoYes this works
- tgb 9y agoWindows also has this now: "Microsoft print to PDF". Might be only Windows 10, not sure.
- jacquesm 9y agoIt's funny how this isn't even about encrypted pdfs but plain ones.
- LeonM 9y agoThey are actually encrypted, but with an empty string as the (read) password. Since this is a common 'technique' to 'protect' PDF documents, as some PDF viewers (such as Adobe reader) won't allow selecting text on these 'protected' PDF's. It's so common that most PDF tools assume an empty string if no password is explicitly supplied. Source: I run a SaaS that converts PDF invoices to structured data, so I've examined quite a few PDF files the last couple of years.
- mwfunk 9y agoAlso, the current PDF permissions model is comically obtuse IMO. Acrobat doesn't even expose the permissions bits directly, rather each permission exposed in Adobe's UI represents various permutations of those permissions bits rather than a 1:1 mapping. It has to, because the design of that bitfield is nuts. The semantics of the bits are described in ways that are very open to interpretation, and can be used to specify combinations of permissions that just don't make sense (example: allow content extraction for copy/paste, but don't allow content extraction for accessibility purposes, like screen readers for the blind). I suspect there are no two PDF parsers that handle that bitfield in the same way, and that it may not even be possible to implement support for it without baking in contradictions and unexpected behaviors (from a user's perspective at least). I'd be surprised if even Adobe's implementation handled it in its entirety.
- Pxtl 9y agoIsn't this ultimately what Dmitry Sklyarov got busted for?
- JumpCrisscross 9y ago> I despise protected pdfs with a passion When I want to "protect" a PDF, I print it as a TIFF and then PDF that document. It's less "protecting" than "making it difficult to alter or copy-paste from," but it works. (Also good for ensuring your redaction blobs can't be moved.)
- TurningCanadian 9y agoWhy use TIFF? It supports layers, so I'm not sure it'd guarantee that redaction blobs are effective.
- deleted 9y ago[deleted]
- ateesdalejr 9y agoOnly way to be sure is to print with redaction blobs and then scan back into PDF.
- paulie_a 9y agoOut of curiosity, why would you ever need/want to do that?
- captaincrowbar 9y agoIf you're on a Mac, just open the PDF in Preview and then Save As to a different file name. This gives you a PDF visually identical to the original (with TOC, selectable text, etc) but with no protection.
- applecrazy 9y agoPreview is the unsung hero of macOS. It does so much that Adobe Reader charges for: signatures, annotations, page rearrangement, plus it has the added bonus of being able to open obj and stl files.
- vsl 9y agoIt doesn’t do actual (cryptographic) signatures that Adobe charges for. It only does pretty pictures of handwritten signatures as an inserted object, a trivially falsifiable things.
- applecrazy 9y agoThat’s true, although you might want to use something like docusign for that.
- arthurfm 9y ago> One way is to print to postscript and convert back to pdf, but then you can't copy text from it. If you use the following GhostScript command it's still possible to select the text in the unprotected PDF. "%ProgramFiles%\gs\gs9.22\bin\gswin64c.exe" -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sFONTPATH=%windir%/fonts;xfonts;. -sPDFPassword= -dPDFSETTINGS=/prepress -dPassThroughJPEGImages=true -sOutputFile=Unprotected.pdf Protected.pdf