Giter Site home page Giter Site logo

pdfwatermark's Introduction

Why?

I needed to "stamp" quite a bunch of PDF files with a large transparent text mark. The mark content depended on the PDF file name. I looked around and realised that I can't seem to be able to find anything that would help me get it done in Linux without major pain of some sort. So I decided to roll my own

What it does.

pdfwatermark allows you to add an arbitrary text line on the first page of a given PDF file. You can also make the text of the watermark depend on the file name.

Usage

$ python pdfwatermark.py [OPTIONS] FILENAME

Use --help to see the detailed list of options

Warning

By default, pdfwatermark watermarks the file in place. No way to 'unwatermark' it is provided.

Example

Example 1, "trivial"

python pdfwatermark.py -w "WATERMARK" file.pdf

Puts a large black text 'WATERMARK' somewhere on the first page of file.pdf

Example 2, "simple"

python pdfwatermark.py -w "WATERMARK" -c "#FF0000" -o 0.3 -x 200 -y 150 file.pdf

Puts a large transparent pink 'WATERMARK' at the given coordinates on the first page of file.pdf

Example 2, "pdfwatermark in full glory"

python pdfwatermark.py -c "#FF0000" -o 0.3 -x 200 -y 150 -w "({})" -r "^(\d+).+$" -d meaning.pdf 42-file.pdf

Puts a large transparent pink '(42)' at the given coordinates on the first page of the content of 42-file.pdf and saves the resulting content as meaning.pdf

Todo

  • add a possibility to add watermarks on pages other than first
  • make sure it works nicely with paper formats other than DIN A4
  • handle (at least some) errors

pdfwatermark's People

Contributors

mvartanyan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

hellyguo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.