From 1ca90f384d4f2311cbf0abd44d8e4e5b7a4abb37 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 31 Jan 2018 00:03:38 +0000 Subject: start actual page rendering --- test/parsepdf.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/parsepdf.c') diff --git a/test/parsepdf.c b/test/parsepdf.c index 054e96d..f569418 100644 --- a/test/parsepdf.c +++ b/test/parsepdf.c @@ -55,6 +55,16 @@ read_whole_pdf(const char *fname, uint8_t **buffer, uint64_t *buffer_length) return NSPDFERROR_OK; } +static nspdferror +pdf_path(const struct nspdf_style *style, + const float *path, + unsigned int path_length, + const float transform[6], + const void *ctxin) +{ + return NSPDFERROR_OK; +} + static nspdferror render_pages(struct nspdf_doc *doc, unsigned int page_count) { nspdferror res; @@ -62,6 +72,14 @@ static nspdferror render_pages(struct nspdf_doc *doc, unsigned int page_count) unsigned int page_render_list[4] = { 0, 1, 0, 1}; unsigned int page_index; + render_ctx.device_space[0] = 1; + render_ctx.device_space[1] = 0; + render_ctx.device_space[2] = 0; + render_ctx.device_space[3] = -1; /* y scale */ + render_ctx.device_space[4] = 0; /* x offset */ + render_ctx.device_space[5] = 800; /* y offset */ + render_ctx.path = pdf_path; + for (page_index = 0; page_index < page_count; page_index++) { res = nspdf_page_render(doc, page_index, &render_ctx); if (res != NSPDFERROR_OK) { -- cgit v1.2.3