Simple Python tool to embed JavaScript code in different types of files (pdf and svg for now)
- PyPDF2
- re
- argparse
$ git clone https://github.com/mathis2001/JSembed
$ cd JSembed
$ python3 jsembed.py
$ python3 jsembed.py [--pdf path/to/input.pdf] [--svg path/to/input.svg] [--js path/to/input.js] [--output output.pdf or output.svg]
options:
-h, --help show this help message and exit
-p PDF, --pdf PDF Path to the original PDF file
-s SVG, --svg SVG Path to the original SVG file
-j JS, --js JS Path to the JavaScript file to embed
-o OUTPUT, --output OUTPUT Output file name (.pdf or .svg)