Skip to content

Commit

Permalink
address #3100, fix for Document.get_xml_metadata().
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-smith-artifex-com committed Jan 29, 2024
1 parent 7959684 commit fc405f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4271,7 +4271,7 @@ def get_xml_metadata(self):
PDF_NAME('Root'),
PDF_NAME('Metadata'),
)
if xml and xml.internal:
if xml and xml.m_internal:
buff = mupdf.pdf_load_stream(xml)
rc = JM_UnicodeFromBuffer(buff)
else:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,3 +863,8 @@ def next_fd():
assert fd2 == fd1 + 1
assert fd3 == fd1
assert fd4 == fd1

def test_xml():
path = os.path.abspath(f'{__file__}/../../tests/resources/2.pdf')
with fitz.open(path) as document:
document.get_xml_metadata()

0 comments on commit fc405f7

Please sign in to comment.