pdftk-2.02-1.el6.x86_64.rpmIt needs something called "libgcj" and there is no such thing in the Fedora package set. Apparently "gcj" is the Gnu compiler for Java. This seems strange if pdftk is coded in C++. As I do some searching, I learn that GCJ was abandoned around 2017.
I take the easy route, delete this RPM, and do:
dnf install pdftk-java (1/2): pdftk-java-3.3.3-1.fc37.noarch.rpm 1.0 MB/s | 977 kB 00:00 (2/2): bouncycastle-1.70-6.fc37.noarch.rpm 3.1 MB/s | 4.4 MB 00:01It pulls in a cute dependency "bouncycastle", which is apparently a cryptography API.
mkdir Clean cd Clean cp ../datasheet.pdf . pdftk datasheet.pdf output xyz.pdf uncompressThe file "xyz.pdf" is another PDF file, but much bigger (41M instead of 7M). And, by golly, I can just open it using "vim". The fellow (Tyler Davis) says that it is now sort of a trial and error process of finding and deleting PDF "obj" objects that contain the watermark.
I search for "confid" and find it in many places. Also interesting to search for is the string "atermark". As an example I find and delete this block of stuff:
1044 0 obj << /LastModified (D:20150528172744+08'00') /OC 2532 0 R /Subtype /Form /Matrix [1.0 0.0 0.0 1.0 0.0 0.0] /PieceInfo << /ADBE_CompoundType << /LastModified (D:20150528172744+08'00') /DocSettings 2533 0 R /Private /Watermark >> >> /Resources 2534 0 R /BBox [0.0 -24.0 115.958 2.40015] /Length 119 >> stream 0 g 0 G 0 i 0 J []0 d 0 j 1 w 10 M 0 Tc 0 Tw 100 Tz 0 TL 0 Tr 0 Ts BT /Calibri 24 Tf 0 g 0 -18 Td (confidential) Tj ET endstream endobjI merrily delete it and save the result at new.pdf. Interestingly, this removes the watermark from chapters 1,2,3, but not the rest of the chapters, and not the table of contents.
I continue searching for the string "onfiden" and deleting the entire "obj" block that encloses it. (The block runs from the line with "obj" to the line with "endobj". There seem to be dozens of these, but I delete all that I can find.
And voila! I seem to have a clean document!! It is still big (41M) bug perhaps I can use pdftk to compress as well as uncompress. I try:
pdftk new.pdf output clean.pdf compressI takes quite a while (almost a minute) but it works!! I see:
-rw-r--r-- 1 tom tom 17525531 Jan 9 13:27 clean.pdf -rw-r--r-- 1 tom tom 7408830 Jan 9 12:58 datasheet.pdf -rw-r--r-- 1 tom tom 41047374 Jan 9 13:22 new.pdf -rw-r--r-- 1 tom tom 41065029 Jan 9 13:02 xyz.pdfSo the cleaned up document is 17M (as compared to the original 7M), but 10M is a small price to pay not to be endlessly annoyed by the doggone watermark.
Tom's electronics pages / [email protected]