diff options
author | Vincent Sanders <vince@kyllikki.org> | 2018-01-29 00:03:50 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-09-30 15:32:34 +0100 |
commit | 2b6659f4adc97bbcfc4488c3ce65da36a195712a (patch) | |
tree | 362f2cf72486c7810a33258127ed306c25887ce3 | |
parent | f7e377dc5383097fd301d67858c2b9f0a95defdf (diff) | |
download | netsurf-2b6659f4adc97bbcfc4488c3ce65da36a195712a.tar.gz netsurf-2b6659f4adc97bbcfc4488c3ce65da36a195712a.tar.bz2 |
call page render interface
-rw-r--r-- | content/handlers/pdf/pdf.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/content/handlers/pdf/pdf.c b/content/handlers/pdf/pdf.c index 288aa5892..d62f1ffbb 100644 --- a/content/handlers/pdf/pdf.c +++ b/content/handlers/pdf/pdf.c @@ -29,6 +29,7 @@ #include <nspdf/document.h> #include <nspdf/meta.h> +#include <nspdf/page.h> #include "utils/utils.h" #include "content/llcache.h" @@ -142,6 +143,16 @@ static bool pdf_convert(struct content *c) return true; } +static nspdferror +pdf_path(const struct nspdf_style *style, + const float *p, + unsigned int n, + const float transform[6], + const void *ctx) +{ + return NSPDFERROR_OK; +} + /* exported interface documented in image_cache.h */ static bool pdf_redraw(struct content *c, @@ -149,6 +160,22 @@ pdf_redraw(struct content *c, const struct rect *clip, const struct redraw_context *ctx) { + struct pdf_content *pdfc = (struct pdf_content *)c; + nspdferror pdfres; + struct nspdf_render_ctx render_ctx; + + render_ctx.ctx = ctx; + render_ctx.device_space[0] = 1; + render_ctx.device_space[1] = 0; + render_ctx.device_space[2] = 0; + render_ctx.device_space[3] = 1; + render_ctx.device_space[4] = 0; /* x offset */ + render_ctx.device_space[5] = -200; /* y offset */ + render_ctx.path = pdf_path; + + pdfres = nspdf_page_render(pdfc->doc, 0, &render_ctx); + + return true; } |