Skip to content

1.24.2/1.24.3: spurious characters introduced when using subset_fonts and insert_pdf #3494

@cbm755

Description

@cbm755

Description of the bug

Maybe a duplicate or at least related to #3470. When I use insert_pdf to copy a page from one PDF to a new document, then use subset_fonts on the new document, I get spurious letters. In my example below, its an "E". But we've also seen "M".

How to reproduce the bug

MWE:

import fitz

doc_in = fitz.open("version1.pdf")

d = fitz.open()

d.insert_pdf(
    doc_in,
    from_page=0,
    to_page=0,
    start_at=-1,
)

d.subset_fonts()

d.save("output.pdf")

version1.pdf is: version1.pdf

PyMuPDF version

1.24.3

Operating system

Linux

Python version

3.12

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions