pdf-redactor | general purpose PDF text-layer redaction tool | Document Editor library
kandi X-RAY | pdf-redactor Summary
kandi X-RAY | pdf-redactor Summary
A general-purpose PDF text-layer redaction tool, in pure Python, by Joshua Tauberer and Antoine McGrath. pdf-redactor uses [pdfrw] under the hood to parse and write out the PDF.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Build a text layer .
- Initialize from a CMap object .
- Update text layer based on provided text layer .
- Update PDF metadata .
- Tokenize a PDF stream .
- Read image data .
- Redact the PDF .
- Update the XMP metadata .
- Convert a Unicode string to Unicode .
- Update an annotation .
pdf-redactor Key Features
pdf-redactor Examples and Code Snippets
Community Discussions
Trending Discussions on pdf-redactor
QUESTION
I'm using the python PDF redactor and it works great: https://github.com/JoshData/pdf-redactor
The syntax for masking content as specified in the github looks like this, where the regex is the pattern to find and the X's in the lambda expression is the string to replace the found patterns with:
...ANSWER
Answered 2020-Apr-15 at 21:12You may re-group the patterns to capture what you need to keep, and make use of the match data object, m
:
QUESTION
I'm trying to edit the metadata Title
field of PDFs, to include the ASCII equivalents when possible. I'm using Python3 and the module pdfrw
.
How can I do string operations that replace the metadata fields?
My test code is here:
...ANSWER
Answered 2019-May-21 at 07:42You have to use the .decode()
method on the metadata fields:
QUESTION
Using https://github.com/JoshData/pdf-redactor if I provide a PDF with multiple URL links and use the example code:
...ANSWER
Answered 2019-Feb-23 at 07:33Actually you can do a lot with that lambda
in that lib. In this specific case you gave us, anything you insert in that function will have https://www.google.com as and output.
But if you want to make something different from that you can use either the URL (href
) or the annotation
(or both!) as parameters to change the URLs in the document. I will present to you a way you can change multiple URLs at once:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pdf-redactor
You can use pdf-redactor like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page