Giter VIP home page Giter VIP logo

Comments (7)

JorjMcKie avatar JorjMcKie commented on June 20, 2024 1

This is indeed related to #3470 and will thus be solved with the next PyMuPDF version containing this MuPDF fix.

from pymupdf.

cbm755 avatar cbm755 commented on June 20, 2024

I can also reproduce this with 1.24.2 but NOT with 1.24.1.

from pymupdf.

cbm755 avatar cbm755 commented on June 20, 2024

Downstream link: https://gitlab.com/plom/plom/-/issues/3374

from pymupdf.

cbm755 avatar cbm755 commented on June 20, 2024

In this image, the spurious letters can take fonts that come from a different page of the document.

image

from pymupdf.

JorjMcKie avatar JorjMcKie commented on June 20, 2024

Just in case you are not aware:
Creating font subsets has been implemented in MuPDF. While it still is officially an experimental feature, we as PyMuPDF are very interested in replacing the current solution - which is pure Python-based and creates an external dependency on another package (fontTools).
So we have a vital interest to deprecate this solution short to medium term.
There are also some secondary advantages:

  • The MuPDF solution is at least 15 times faster and it covers a larger set of font types compared to fontTools (which is restricted to TTF and OTF formats).
  • Being a MuPDF solution, not only MuPDF itself, but all its language bindings will immediately benefit from it. These are currently Java, JavaScript and the new C# bindings, MuPDF.net, which is on the verge to be published this or early next week.

Given this background, we will not continue fixing any issues around the fontTools-based solution.

from pymupdf.

cbm755 avatar cbm755 commented on June 20, 2024

Thanks sounds very promising! Is there a timeline or issue I can follow?

I the meantime, perhaps I'll try to scale back our use of subset_fonts() to only those cases where we used PyMuPDF to add non-ASCII text.

from pymupdf.

JorjMcKie avatar JorjMcKie commented on June 20, 2024

We are testing this feature for a considerable time now. That new fix should actually be it.
To elevate it from the "experimental" label, I mean.
We nonetheless will provide the fallback option for some more time of course.

For my own purposes, I am using the new version all the time.
Especially if you use Page.insert_htmlbox or other Story-based code, MuPDF is likely to pull in needed fonts all over the place. Here, subset fonts can be a life saver. Have a look at this (certainly extreme) example. Not using font subsets lets you save a 2 MB file, subsets reduce it to 80 KB.

MuPDF just recently has introduced rich text support for FreeText annotations (not yet supported in PyMuPDF). And the technique used is ... again the Story class!

from pymupdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.