Copying text to new PDF resulting in file size increase by x33 #4678
-
I have a reasonable suspicion it's because I'm calling Page.show_pdf_page 33 times but was wondering if there was a way to clean up some of the unnecessarily copied data. So I am repositioning text on a new Doc after redacting some bullets points from the original Document Page. I'm doing this by going through each text block in get_text("blocks") (which is run x33), calculating the new positioning, then adding it to a temporary document where I redact everything around it (to prevent duplicate text) and then clean_contents() before copying it onto my new Doc with Page.show_pdf_page. Originally the file size was going from 100kb to 3.3MB. After running clean_contents() on each temporary page, I am able to get that down to 2.1MB. Any recommendations for dropping it further? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @maxmir20 Could you post this again on our forum at https://forum.pymupdf.com , we are trying to move all discussions there! |
Beta Was this translation helpful? Give feedback.
Hi @maxmir20 Could you post this again on our forum at https://forum.pymupdf.com , we are trying to move all discussions there!