summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2018-01-29 00:03:50 +0000
committerVincent Sanders <vince@kyllikki.org>2020-12-11 16:17:27 +0000
commita453f3131792ba4c790f135e8b60e314509b770f (patch)
tree4093303ac7d88d52f34b23c3c22e7d2f09939ecf /content
parent04c890e5e051ac2d0ccc0d862b4b8020b90c1665 (diff)
downloadnetsurf-a453f3131792ba4c790f135e8b60e314509b770f.tar.gz
netsurf-a453f3131792ba4c790f135e8b60e314509b770f.tar.bz2
call page render interface
Diffstat (limited to 'content')
-rw-r--r--content/handlers/pdf/pdf.c27
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;
}