pdf xmp: pdfextrametafix: add method which takes the xml elt as arg instead of the text content

This commit is contained in:
Jean-Francois Dockes
2019-11-14 18:19:33 +01:00
parent 3b82aa7927
commit b43d1b3287
2 changed files with 34 additions and 12 deletions
+6 -1
View File
@@ -1,12 +1,17 @@
import sys
import re
import lxml.etree as ET
class MetaFixer(object):
def __init__(self):
pass
# def metafixelt(self, nm, xml):
# print("MetaFixer: metafixelt: %s" % ET.tostring(xml), file=sys.stderr)
# return "hello"
def metafix(self, nm, txt):
#print("Metafixer: mfix: nm [%s] txt [%s]" % (nm, txt), file=sys.stderr)
print("Metafixer: mfix: nm [%s] txt [%s]" % (nm, txt), file=sys.stderr)
if nm == 'pdf:Producer':
txt += " metafixerunique"
elif nm == 'someothername':