-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Having trouble with blanking out costs with format 12.00 or 12345.98 or 123.76
The problem is it blanks out whole numbers in pdfs too although not all whole numbers which makes it really weird to me.
What I suspect is if pdfs "encode" whole numbers with decimals too? Meaning something displayed in a pdf as 12 for example is actually 12.00. Below is the code which is from example.py and i run it in console.
red.py:
#;encoding=utf-8
from pdf_redactor import redactor, RedactorOptions
import re
#set options.
redactor_options = RedactorOptions()
redactor_options.content_filters = [
(re.compile(u"Cost Price"), lambda m : ""),
(re.compile(u"Cost"), lambda m : ""),
(re.compile(u"[0-9](.)[0-9]{2}"), lambda m : ""), #this is my regex for costs with 2 decimals
(re.compile(u"Value Price"),lambda m : ""),
]
redactor_options.content_replacement_glyphs = ['#', '', '/', '-']
redactor(redactor_options)
python red.py < a.pdf > anew.pdf
python3 red.py < a.pdf > anew.pdf does not work for me.
Would appreciate if anyone can help.