Bug 707673 - Cleaning /Contents destroys appearance stream
Summary: Cleaning /Contents destroys appearance stream
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: master
Hardware: All All
: P1 major
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 10:49 UTC by Jorj
Modified: 2024-03-28 15:09 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorj 2024-03-19 10:49:54 UTC
PyMuPDf issue: https://github.com/pymupdf/PyMuPDF/issues/3278,
file "source.pdf" (https://github.com/pymupdf/PyMuPDF/files/14643860/source.pdf)

The page /Contents appearance stream will be destroyed if executing
mutool clean -c source.pdf
Comment 1 Jorj 2024-03-27 14:42:07 UTC
This error obviously has been introduced with MuPDF v1.23.9.
Comment 2 Tor Andersson 2024-03-27 15:03:33 UTC
Can replicate only with

mutool clean -s source.pdf
Comment 3 Robin Watts 2024-03-28 15:09:38 UTC
Fixed with:

commit 779b8234529cb82aa1e92826854c7bb98b19e44b
Author: Robin Watts <Robin.Watts@artifex.com>
Date:   Thu Mar 28 14:21:13 2024 +0000

    Bug 707673: Fix text movement on sanitisation.

    This is actually down to the same kind of issue as seen with
    bug 707448, in that an unholy combination of negative font
    height and negative font scale are combining to confuse our
    positioning code.

    Once again I've gone through the code attempting to simplify
    it, and I think I'm happier with this version now. Certainly
    it seems to get all the files from both bugs correct now.

Any further work in this area should check bug 707448 to make sure it still works.