Bug 702715

Summary: mutool clean -s spoils layout
Product: MuPDF Reporter: pulsarpietro <pietro.paolini>
Component: mupdfAssignee: MuPDF bugs <mupdf-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: marja-e, pietro.paolini, robin.watts
Priority: P4    
Version: unspecified   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: Files
in_4.pdf

Description pulsarpietro 2020-08-11 14:32:05 UTC
Created attachment 19634 [details]
Files

The use of the command 'mutool clean -s' causes some text of the given PDF document to be moved elsewhere, in the given example the string 'BUT' is moved on the top of an already present piece of text. This results in a ruined document.

mutool was compiled from source, version '1.17.0'

The tar file contains two files:

in_1.pdf file
out.pdf

The following should be enough to replicate the problem: mutool clean -s in_1.pdf out.pdf

Thanks,
Pietro
Comment 1 MarjaE 2020-09-04 02:57:56 UTC
I haven't tested these files, but have encountered similar behavior on MacOS Mojave.
Comment 2 Robin Watts 2020-09-24 15:52:58 UTC
Created attachment 19868 [details]
in_4.pdf

Simplified file showing the problem.
Comment 3 Robin Watts 2020-09-24 16:42:40 UTC
Fixed in:

commit b0b04441e91daccfb4287c5947c3cb48dfa7a54e
Author: Robin Watts <Robin.Watts@artifex.com>
Date:   Thu Sep 24 16:57:37 2020 +0100

    Bug 702715: Fix layout problems with mutool -s.

    We weren't flushing text on a T*. Do so.

Thanks for the report.
Comment 4 pulsarpietro 2020-09-24 18:14:15 UTC
Thank you very much for fixing it.