I made a program to watermark pdfs.
Worked great! (Past tense)
Yesterday, I also made a program to wipe out watermarks. It uses PIL. It just inspects every pixel. If the pixel is in a grey range, it paints the pixel white.
Works great!
I installed pdf2image to crack the pdf into jpgs, then look for grey colours in each jpg.
However, I noticed that, when I used pip3 to install pdf2image, it also installed pillow.
I think this must be a custom version of pillow.
Now, my beautiful watermarking program crashes with the error below. Until yesterday, it worked great!
I tried using a jpg as the watermark and that works fine, but jpg has no transparency, it covers all the text!!!
If I reinstall pillow, I think my watermarking program will work again, but maybe not my de-watermarking program.
At the moment, I am trying to install idle on and old laptop and try out my watermarking program there.
Any tips please??
Worked great! (Past tense)
Yesterday, I also made a program to wipe out watermarks. It uses PIL. It just inspects every pixel. If the pixel is in a grey range, it paints the pixel white.
Works great!
I installed pdf2image to crack the pdf into jpgs, then look for grey colours in each jpg.
However, I noticed that, when I used pip3 to install pdf2image, it also installed pillow.
I think this must be a custom version of pillow.
Now, my beautiful watermarking program crashes with the error below. Until yesterday, it worked great!
I tried using a jpg as the watermark and that works fine, but jpg has no transparency, it covers all the text!!!
If I reinstall pillow, I think my watermarking program will work again, but maybe not my de-watermarking program.
At the moment, I am trying to install idle on and old laptop and try out my watermarking program there.
Any tips please??
Error:enter something like purplerectangle.png or whiterectangle.png or watermark3.png
this should be a .png
wm16.png
Traceback (most recent call last):
File "./WatermarkAllpages+AllfilesV1.py", line 57, in <module>
c.drawImage(pathToMergedFiles + wmfileName, x, y, width=w, height=h, mask='auto')
File "/usr/lib/python3/dist-packages/reportlab/pdfgen/canvas.py", line 946, in drawImage
imgObj = pdfdoc.PDFImageXObject(name, image, mask=mask)
File "/usr/lib/python3/dist-packages/reportlab/pdfbase/pdfdoc.py", line 2100, in __init__
self.loadImageFromA85(src)
File "/usr/lib/python3/dist-packages/reportlab/pdfbase/pdfdoc.py", line 2108, in loadImageFromA85
imagedata = pdfutils.makeA85Image(source,IMG=IMG,detectJpeg=True)
File "/usr/lib/python3/dist-packages/reportlab/pdfbase/pdfutils.py", line 38, in makeA85Image
raw = img.getRGBData()
File "/usr/lib/python3/dist-packages/reportlab/lib/utils.py", line 886, in getRGBData
annotateException('\nidentity=%s'%self.identity())
File "/usr/lib/python3/dist-packages/reportlab/lib/utils.py", line 1390, in annotateException
rl_reraise(t,v,b)
File "/usr/lib/python3/dist-packages/reportlab/lib/utils.py", line 144, in rl_reraise
raise v
File "/usr/lib/python3/dist-packages/reportlab/lib/utils.py", line 871, in getRGBData
if Image.VERSION.startswith('1.1.7'): im.load()
AttributeError: module 'PIL.Image' has no attribute 'VERSION'
identity=[ImageReader@0x7f30b18f0e80 filename='/home/pedro/babystuff/mergedPdf/wm16.png']
pedro@pedro-512ssd:~/pdfs$