summaryrefslogtreecommitdiff
path: root/test/parsepdf.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2018-01-31 00:03:38 +0000
committerVincent Sanders <vince@kyllikki.org>2018-01-31 00:03:38 +0000
commit1ca90f384d4f2311cbf0abd44d8e4e5b7a4abb37 (patch)
tree35a931f40ed6ca1a1e2420ab1f63230f05349ca1 /test/parsepdf.c
parent6b16f2446bb381be3de54d9edfe9088a8363df70 (diff)
downloadlibnspdf-1ca90f384d4f2311cbf0abd44d8e4e5b7a4abb37.tar.gz
libnspdf-1ca90f384d4f2311cbf0abd44d8e4e5b7a4abb37.tar.bz2
start actual page rendering
Diffstat (limited to 'test/parsepdf.c')
-rw-r--r--test/parsepdf.c18
1 files changed, 18 insertions, 0 deletions
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) {