One line of code, automatically add the watermark content you specify to the PDF file, fast and free.
1. Function introduction
Last time we introduced one of the functions of the python-office library: to realize batch Word to PDF, today we introduce the second function of this library:
“One line of code, automatically add your specified watermark content to PDF files, fast and free.
2. Code description
a. If you are using python-office for the first time,
Just need the following command to automatically download and install python-office
pip install python-office
b. If you have read the previous articles and have downloaded and used python-office,
Then you need to run the following command to upgrade python-office to the latest version.
“The update of python-office is very frequent. It is recommended that you update it every time you use it~
pip install --upgrade python-office
After installing python-office, copy and paste directly and run the following code
import office # import python-office office.pdf.add_watermark() # No need to make any changes to the code, just run
After running, some prompt text will appear in the console. The python-office developed by the Chinese, of course, the prompt text is Chinese.
You can directly enter the corresponding content according to your own needs, and the program will automatically add a watermark. As shown below.
3. About python-office
python-office is an open source third-party library of pypi, designed for python automation office.
“You are also welcome to participate in the construction of the open source project python-office. The open source warehouse address:
- GitHub: CoderWanFeng/python-office
- Tesseract OCR text recognition using tess4j encapsulation
- [Solved] error in REfO setup command: use_2to3 is invalid.
- [Solved] Ubuntu18.04 Install pyqt5 error: Command “python setup.py egg_info“ failed with error code 1 in /tmp/pip-build-92
- Python: How to Solve error While importing windpy
- Mac Upgrade pip Error OSError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/pip-9.0.1-py2….
- [Solved] Pycharm Use pip to install package error: no such option –build-dir
- python: File Processing and Input and Output
- [Solved] cv2.xfeatures2d.SIFT_create() Error: module ‘cv2.cv2’ has no attribute ‘xfeatures2d’
- The matching result of Python XPath is null
- [Solved] Error: Please select a valid Python interpreter
- Import CV2 & Numpy report red Warning and Error [How to Solve]
- [Mac Pro M1] Python3.9 import cv2 Error: Reason: image not found
- [Solved] Pytorch-transformers Error: AttributeError: ‘str‘ object has no attribute ‘shape‘
- Pyyaml tutorial introduction to pyyaml library and YML writing and reading
- Linux Fatal Python error: Py_Initialize Unable to get the locale encoding
- [Solved] transformers Install Error: error can‘t find rust compiler
- The solution of no such file or directory and cannot load native module running error of python3 pyinstaller after packaging
- How to Solve Turtle_tf Error in ROS
- [Solved] From pip._internal import cmdoptions ImportError: cannot import name SourceDistribution
- [Solved] PyQt: RuntimeError: wrapped C/C++ object has been deleted & has no attribute of flush in python