Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF text rendering modes (Tr operator) that clip do not work #16302

Open
petervwyatt opened this issue Apr 17, 2023 · 2 comments
Open

PDF text rendering modes (Tr operator) that clip do not work #16302

petervwyatt opened this issue Apr 17, 2023 · 2 comments

Comments

@petervwyatt
Copy link

PDF text rendering modes (Tr operator with values 4-7) that clip don't work as per PDF spec section 9.3.6 Text rendering mode.
See this very minimal PDF with Tr 7 - changing to Tr 5 also does not work (but then you can see the stroked outline of where the text clip should be). The image of the cat has a black border so you can see where the text clipping should be happening:

CatImageTextClip.pdf

Fails in NPM pdfjs-dist@3.1.81 as well as latest Firefox browser (and prior versions).

What is the expected behavior? (screenshot from Acrobat)
For Tr 7:
image

What went wrong? (add screenshot)
image

@Snuffleupagus
Copy link
Collaborator

This is a known issue, and it actually works with disableFontFace=true set.
The problem is that we don't unconditionally load the standard fonts, since that would be slower in general and that the standard fonts that we ship aren't "complete" enough; please see the discussion in PR #12726.

Fails in NPM pdfjs-dist@3.1.81

That version is no longer supported, please find the latest releases at https://mozilla.github.io/pdf.js/getting_started/#download
(Also, for future reference, please remember to fill out the Configuration:-section of the ISSUE_TEMPLATE since that very often matters.)

@calixteman
Copy link
Contributor

calixteman commented Apr 17, 2023

Maybe we could to fix this bug in using the css property clip-path with a value set to url(...) where the element pointed by the url could be a svg clipPath containing a text node using the font where we don't have the glyph paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants