Git Product home page Git Product logo

Comments (5)

springmeyer avatar springmeyer commented on May 31, 2024

okay, wscript has now been fixed up to auto-detect if mapnik has cairo support and then builds node-mapnik with cairo support for the map.render_to_file() function.

Call it like:

map.render_to_file('map.pdf',{format:'pdf'})

or just:

map.render_to_file('map.pdf') // should also work

from node-mapnik.

yhahn avatar yhahn commented on May 31, 2024

Works great. Next step here would be to allow async rendering to PDF as well but this is a lower priority.

from node-mapnik.

springmeyer avatar springmeyer commented on May 31, 2024

glad it works. Are you checking if mapnik.supports.cairo == true ?

regarding async, I could expose a async render_to_file, but an async render() (e.g to buffer) would be tough since mapnik does not properly expose writing cairo surfaces to streams (in fact not sure if cairo supports this). I assume either would be fine? e.g. do you think you specifically need a PDF as a buffer or just need to push to the filesystem?

from node-mapnik.

yhahn avatar yhahn commented on May 31, 2024

Yep, I am using mapnik.supports which is pretty awesome.

In this case (and I imagine most others) I don't need PDF as a buffer, it will definitely just be written to disk when all is said and done.

from node-mapnik.

springmeyer avatar springmeyer commented on May 31, 2024

closing this, tracking remaining asyc issue here: https://github.com/mapnik/node-mapnik/issues#issue/17

from node-mapnik.

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.