<jupyter_start><jupyter_text>The XREF table of objects and their locations is available as a dictionary.<jupyter_code>list(pdf.object_lookup.items())[:5]<jupyter_output><empty_output><jupyter_text>Check that for each object is either a single object, or a pair of objects where the second object is a placeholder for a PDF Stream.  If a stream, then load it.<jupyter_code>for key, loc in pdf.object_lookup.items():
    items = pdf.object_at(loc)
    if len(items) == 1:
        continue
    if len(items) == 2 and isinstance(items[1], pdfimage.pdf_read.PDFStreamIndicator):
        obj = pdf.full_object_at(loc)
        continue
    raise AssertionError()<jupyter_output><empty_output><jupyter_text>Example of a simple object<jupyter_code>pdf.object_at(15)<jupyter_output><empty_output><jupyter_text>Example of an object with stream.  The `full_object_at` method attempts to recursingly read all the objects which are references.  We do not attempt to deal with cyclic references, so this can lead to a recursion error<jupyter_code>obj = pdf.full_object_at(791)
obj
obj.stream_contents[:10]<jupyter_output><empty_output><jupyter_text>Trying to load all of the following object would lead to a recursion error.<jupyter_code>pdf.object_at(670)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08575924468922108, 'fraction_numerical': 0.011014948859166011, 'mean_word_length': 5.838709677419355, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '529109', 'license': 'MIT', 'n_tokens_mistral': 412, 'n_tokens_neox': 399, 'n_words': 120, 'path': 'notebooks/Low level parsing example.ipynb', 'repo_name': 'MatthewDaws/PDFImage', 'size': '1271'}