Git Product home page Git Product logo

Comments (3)

Legonaftik avatar Legonaftik commented on August 10, 2024

mozilla/pdf.js#11473
It looks like tile-based rendering of PDF Patterns is tricky and other projects, including Mozilla, also facing (or at least faced) the same issue.

https://github.com/typst/svg2pdf/blob/main/src/render.rs#L427
Would it be a good alternative to avoid PDF Pattern syntax and replace SVG <pattern> with multiple instances of content that should be repeated/tiled directly (e.g. line/rect/path/...) assuming that at this stage of the pipeline all the dimensions are already absolute (thanks to usvg) so it's possible to calculate how many items/cells need to be repeated?

from svg2pdf.

LaurenzV avatar LaurenzV commented on August 10, 2024

Is it something that can be fixed by modifying the SVG2PDF conversion flow? Since I could only reproduce this issue with then maybe there is an alternative way of representing it before trying to create PDF? 🤔

You probably could in theory try to emulate the pattern behavior, but I would imagine this to be a nightmare to implement, especially because patterns can also have transforms themselves and this would be very hard to recreate. Given that PDFs support patterns natively, we should also use them for that. It also would be very bad for performance. The best thing to do here would be to report this issue to Apple directly and hope that they fix it, since this is an issue on their side.

from svg2pdf.

LaurenzV avatar LaurenzV commented on August 10, 2024

I'm closing this since there isn't much we can do about that from our side.

from svg2pdf.

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.