Comments (7)
@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.
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.
FWIW I like the RGBA solution, as Go already allows for easy image conversion using std libraries.
from go-webkit2.
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.
@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.
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.
Moving discussion to @bryansum's pull request #5
from go-webkit2.
Related Issues (20)
- example_test.go fails while all other tests before succeed
- go-webkit2 with webkitgtk-2.8.3 issues
- Can't install HOT 4
- getting response headers
- run test failed HOT 8
- Mac OS X install difficulties and TestWebView_LoadURI crash HOT 2
- Error installing on Mac OS X 10.11 HOT 2
- Constant Javascript errors HOT 1
- Ubuntu initial install failed to build webkit-eval-js HOT 1
- libwebkit2gtk-4.0 support? HOT 6
- cgo blows up with runtime error: `cgo argument has Go pointer to Go pointer` HOT 5
- Webkit Settings?
- Test Failed
- How to set the size of a snapshot in GetSnapshot? HOT 1
- msys2 support ?
- How can I try go-webkit2 on macos
- no way to convert gtk.Widget to WebView? HOT 1
- Tests Fail on Boolean Format
- can i let javascript call native function?
- How to support flash player
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-webkit2.