Bug 132597 - snapshot saved to pdf is not a vector
Summary: snapshot saved to pdf is not a vector
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-05 20:51 PDT by p3e226p+xj6ojed
Modified: 2017-03-11 11:01 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description p3e226p+xj6ojed 2014-05-05 20:51:09 PDT
Similar to: https://bugs.webkit.org/show_bug.cgi?id=93740

Consider this webkit2gtk snippet:

// get a snapshot
cairo_surface_t *surface = webkit_web_view_get_snapshot_finish(web_view, result, &error);
int width = cairo_image_surface_get_width(surface);
int height = cairo_image_surface_get_height(surface);

// copy the snapshot to an pdf file
cairo_surface_t *pdf_surface = cairo_pdf_surface_create(PDFFILE, (double) width, (double) height);
cairo_t *cr = cairo_create(pdf_surface);
cairo_set_source_surface(cr, surface, 0, 0);
cairo_paint(cr);
cairo_surface_flush(pdf_surface);
cairo_surface_finish(pdf_surface);

The resulting PDF is not a vector, but instead just contains a bitmap image. The same is true when saving to SVG.

How can we save a WebView snapshot as a true vector PDF/SVG?