From 057a7acc514d9c2cdb7be303b5cbfd345427f9cb Mon Sep 17 00:00:00 2001 From: yzrh Date: Tue, 12 Jan 2021 03:13:07 +0000 Subject: Fix transformation matrix. --- src/cnki_pdf.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/cnki_pdf.c') diff --git a/src/cnki_pdf.c b/src/cnki_pdf.c index ac4e34a..13dd524 100644 --- a/src/cnki_pdf.c +++ b/src/cnki_pdf.c @@ -692,15 +692,20 @@ cnki_pdf_hn(cnki_t **param) strcat(dictionary, "q\n"); - strcat(dictionary, "0.120000 0 0 0.120000 0 0 cm\n"); + strcat(dictionary, "0.25 0 0 0.25 0 0 cm\n"); for (int i = 0; i < ptr->image_length; i++) { if (dim[i * 2] <= 0 || dim[i * 2 + 1] <= 0) continue; /* Apply transformation matrix */ - if (ptr->image_data[i].format == DCT_1) - strcat(dictionary, "-1 0 0 -1 0 0 cm\n"); + if (ptr->image_data[i].format == DCT_1) { + snprintf(buf, 64, "1 0 0 1 0 %d cm\n", + dim[i * 2 + 1]); + strcat(dictionary, buf); + + strcat(dictionary, "1 0 0 -1 0 0 cm\n"); + } snprintf(buf, 64, "%d 0 0 %d 0 0 cm\n", dim[i * 2], dim[i * 2 + 1]); -- cgit v1.2.3