pymupdf / PyMuPDF

PyMuPDF is a high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents.
https://pymupdf.readthedocs.io
GNU Affero General Public License v3.0
5.78k stars 534 forks source link

fullcopypage bug #4043

Closed cole-dda closed 1 week ago

cole-dda commented 2 weeks ago

Description of the bug

screenshot_6579

res may be bytes type ,so no "m_internal" attribute

How to reproduce the bug

x.pdf

import fitz doc = fitz.open('x.pdf') doc.fullcopy_page(0)

PyMuPDF version

1.24.13

Operating system

MacOS

Python version

3.12

JorjMcKie commented 2 weeks ago

Cannot confirm: Works for me on Linux and Windows, PyMuPDF 1.24.13 and 1.24.11.

JorjMcKie commented 2 weeks ago

You did not even mention what error happened by the way.

cole-dda commented 2 weeks ago

I'am sorry

    import fitz
    doc = fitz.open('x.pdf')
    doc.fullcopy_page(1)
screenshot_6582
JorjMcKie commented 2 weeks ago

This time yes. This happens only if the duplicated page is empty (has no /Contents objects). Easy fix.

julian-smith-artifex-com commented 1 week ago

Fixed in PyMuPDF-1.24.14.