Git Product home page Git Product logo

Comments (6)

SimonSapin avatar SimonSapin commented on June 2, 2024

This is one of the reason I think WeasyPrint and CairoSVG really should be the same code base, but @liZe hasn’t been convinced so far :)

from flask-weasyprint.

grahambell avatar grahambell commented on June 2, 2024

It looks like this isn't a problem with CairoSVG 2.0.0. (Since commit fa3a5ed10db0e99d5f18b6d7a848d1cfa01ff883.)

from flask-weasyprint.

liZe avatar liZe commented on June 2, 2024

CairoSVG's tree can use WeasyPrint's url_fetcher, that could help to fix the problem.

from flask-weasyprint.

ptink avatar ptink commented on June 2, 2024

@liZe could you elaborate on how to get CairoSVG to use the url_fetcher I pass to WeasyPrint? I have set base_url to "file://" because I need to serve the files straight from the filesystem, I have a custom url_fetcher function that converts media url to the absolute path on the filesystem to the file but when trying to display an SVG with included links like the one in this issue thread, it tries to fetch the media url and fails.

from flask-weasyprint.

liZe avatar liZe commented on June 2, 2024

@ptink I've just added the code needed in WeasyPrint, it should fix this issue. Could you please try WeasyPrint's current master branch and tell me if it works for you? Note that it will only work with CairoSVG >= 2.0.0 (and thus won't work with Python 2.x).

from flask-weasyprint.

liZe avatar liZe commented on June 2, 2024

it should fix this issue.

It does fix the issue.

from flask-weasyprint.

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.