(
self,
parser: "pdf_parser",
key: str,
boundary_type: PdfPageBoundaryType = PdfPageBoundaryType.CROP_BOX,
decode_config: DecodeConfig | None = None,
content_config: ContentConfig | None = None,
)
| 669 | |
| 670 | class PdfDocument: |
| 671 | def __init__( |
| 672 | self, |
| 673 | parser: "pdf_parser", |
| 674 | key: str, |
| 675 | boundary_type: PdfPageBoundaryType = PdfPageBoundaryType.CROP_BOX, |
| 676 | decode_config: DecodeConfig | None = None, |
| 677 | content_config: ContentConfig | None = None, |
| 678 | ): |
| 679 | self._parser: pdf_parser = parser |
| 680 | self._key = key |
| 681 | self._boundary_type = boundary_type |
| 682 | self._decode_config = (decode_config or DecodeConfig()).model_copy() |
| 683 | self._content_config = (content_config or ContentConfig()).model_copy() |
| 684 | self._pages: Dict[ |
| 685 | tuple[int, tuple[int, int, int, int, int, bool]], SegmentedPdfPage |
| 686 | ] = {} |
| 687 | # Per page: the content config the cached page-decoder satisfies. |
| 688 | self._decoded_content_configs: Dict[int, ContentConfig] = {} |
| 689 | self._toc: PdfTableOfContents | None = None |
| 690 | self._meta: PdfMetaData | None = None |
| 691 | self._annotations: PdfAnnotations | None = None |
| 692 | |
| 693 | def _ensure_page_decoder( |
| 694 | self, page_no: int, content_config: ContentConfig |
nothing calls this directly
no test coverage detected