GithubHelp home page GithubHelp logo

Comments (7)

sqs avatar sqs commented on August 20, 2024

@dansouza, are you interested in submitting a patch for this? I will code review it and help out if so. A few other folks had expressed an interest in this, so it'd be a great feature.

from go-webkit2.

bryansum avatar bryansum commented on August 20, 2024

I was halfway through an implementation myself. WebKit2 returns a Cairo surface. I can see a few different implementations for this: either we consume a cgo Cairo lib (e.g., go-cairo) and return a Go Cairo type; we return some kind of Go image type (image.RGBA?); or we do something similar to PhantomJS and take in a file path and render directly as a PNG or similar. Thoughts?

from go-webkit2.

bryansum avatar bryansum commented on August 20, 2024

FWIW I like the RGBA solution, as Go already allows for easy image conversion using std libraries.

from go-webkit2.

sqs avatar sqs commented on August 20, 2024

Awesome.

I would personally prefer one of the first 2 options (a Go Cairo type, or a Go image type), or a 3rd option of returning a typedef'd pointer that another lib could cast to get a C Cairo type (e.g., type RawCairoSurface *C.cairo_surface_t) if they really wanted (but that doesn't require go-webkit2 to pull in go-cairo). But whichever one you find simplest is good with me.

from go-webkit2.

dansouza avatar dansouza commented on August 20, 2024

@sqs, @bryansum alright guys, go ahead and implement this, since I can't promise a date to implement this due to my current work load. I agree that returning at a Go image type would be preferred. BTW, how does PhantomJS generate PDFs?

from go-webkit2.

bryansum avatar bryansum commented on August 20, 2024

Slight update: Good and bad news. Good news is that Saucy snapshotting works! Bad news is that I spent an inordinate amount of time debugging the Raring version, which fails reliably. Should hopefully have a PR today.

@dansouza It looks like the current webkit2 snapshot implementation returns bitmap data. I imagine PhantomJS is hooking more deeply into the rendering layer, allowing for vector output.

from go-webkit2.

sqs avatar sqs commented on August 20, 2024

Moving discussion to @bryansum's pull request #5

from go-webkit2.

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.