Add convert.py/.to_json/.to_csv & improve testcov

Moves most of the logic previously in cli.py to convert.py, for usage by
other submodules. Adds Container.to_json and Container.to_csv. Makes
adjustments/fixes to other parts of the library, based on edge-cases
encountered (such as infinite recursion in anntations).
This commit is contained in:
Jeremy Singer-Vine
2020-08-13 08:24:41 -04:00
parent 3f4b4b24b3
commit cbc91c67d0
11 changed files with 296 additions and 108 deletions
+1
View File
@@ -41,6 +41,7 @@ class Test(unittest.TestCase):
annot = self.pdf.annots[0]
annot_ad0 = utils.resolve(annot["data"]["A"]["D"][0])
assert annot_ad0["MediaBox"] == [0, 0, 612, 792]
assert utils.resolve(1) == 1
def test_resolve_all(self):
info = self.pdf.doc.xrefs[0].trailer["Info"]