parsing pdf page leafs
This commit is contained in:
1 parent
ffb7b843ea
commit
b48d635ec7
8 files changed
+371
-23
No files matched your search
@@ -2,9 +2,11 @@ from decimal import Decimal
|
||||
from typing import List
|
||||
from unittest import TestCase
|
||||
|
||||
from pdfmajor.document.parsers.root import get_catalog, get_info
|
||||
from pdfmajor.document.exceptions import BrokenFilePDF, TooManyRectField
|
||||
from pdfmajor.document.pages import PDFPageTreeNode
|
||||
from pdfmajor.document.parsers.pages import get_all_page_leafs
|
||||
from pdfmajor.document.parsers.root import get_catalog, get_info
|
||||
from pdfmajor.document.PDFDocument import PDFDocument
|
||||
from pdfmajor.document.PDFDocumentCatalog import PDFDocumentCatalog
|
||||
from pdfmajor.document.PDFParsingContext import PDFParsingContext
|
||||
from pdfmajor.document.structures import PDFRectangle
|
||||
@@ -128,9 +130,14 @@ class ParsingState(TestCase):
|
||||
for file_path, buffer in all_pdf_files.items():
|
||||
with self.subTest(file_path), buffer.get_window():
|
||||
parser = PDFParsingContext(buffer)
|
||||
get_catalog(parser)
|
||||
catalog = get_catalog(parser)
|
||||
self.assertEqual(len(parser.health_report), 0)
|
||||
get_info(parser)
|
||||
get_all_page_leafs(parser, catalog.pages)
|
||||
|
||||
def test_doc(self):
|
||||
with all_pdf_files["bad-unicode.pdf"].get_window() as buffer:
|
||||
parser = PDFDocument(buffer)
|
||||
|
||||
|
||||
class Structures(TestCase):
|
||||
|
||||
Reference in new issue
Block a user