PyMuPDF icon indicating copy to clipboard operation
PyMuPDF copied to clipboard

Content was not written into target PDF file

Open highyield3011 opened this issue 1 year ago • 2 comments

Description of the bug

Hi Experts,

I'm using PyMuPDF to read content from original PDF and write new content into another target PDF after the content is translated. However, the translated content was not written into target PDF file at all. Could you please help look this issue?

Below is the whole coding file(translation is working fine): translate_pdf_document.py.txt

How to reproduce the bug

please refer to coding file

PyMuPDF version

1.25.1

Operating system

Windows

Python version

3.10

highyield3011 avatar Jan 03 '25 09:01 highyield3011

In your program you use page.insert_textbox but you do not check the return code of this method! As documented, insertion will be refused if the text won't fit into the rectangle. This situation is indicated by a negative return code.

JorjMcKie avatar Jan 03 '25 09:01 JorjMcKie

Your issue actually is "Discussions" item of category "looking for help". Transferring ...

JorjMcKie avatar Jan 03 '25 10:01 JorjMcKie