Writing watermarks to PDF files
-
Guys, a friend just brought Pythonista. He wants to be able to add an image as a watermark to each page in a Pdf file. We got a lib called pdfrw which should be able to do it. But there was problems with the pdf header. I am not sure why, it's not something I normally do. We also created a pdf from within Pythonista, got the same error.
But I am assuming there is a mainstream lib or way to do this in Pythonista that's not obvious to me.
Any help appreciated
-
Thanks so much guys, works. I tried a longer file and it failed. But was a product manual. Could be many reasons why it failed I guess. Just hoping it helps my friend. Will save him a ton of work from what I understand. Also will mean, when he travels he will no longer need to take his laptop. This was the only component of his work he could not do on his ipad.
So thanks again, a very practical use application for Pythonista
-
I was so happy to find this reference to PyPDF2, and even happier to find it is included with Pythonista. Looks like just what I need.
But how, may I ask (and maybe it is just way too late at night and my brain is shot) did you all know that it was included? It's not listed in the Globule Module Index.
I did find the source in the included libraries. Is that the best place to be looking?
Thanks, all.
-
@MTcoder , as you can see I was told told about that lib. But you could look in the standard library dir or if you are just curious just try importing it.
There are a lot of libs included that are not documented.
If the lib you are after is not available as a batteries included or whatever you call it, if it's a pure Python lib, you can use Stash a community written tool to install it via pip.I am not sure if there is a easy way to have a script to list all these extra libs or not. Beyond my experience. I know it's not as simple as most listing the dir names in the standard library dir.
-
@MTcoder see in Modules& Templates/Standard Library (3.5)/sites-packages/PyPDF2
-
help('modules')
lists everything you can import.
-
@Phuket2 @cvp @omz Thank you all. I've never seen a community that is as willing to help as this one. Maybe it's because we have such a splendid tool in our hands!
-
@MTcoder , I just learnt something also 😁
-
The same for me. I knew where to search but I didn't know this list of modules.
-
This post is deleted!last edited by JonesSmith