aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryzrh <yzrh@noema.org>2021-01-12 03:13:07 +0000
committeryzrh <yzrh@noema.org>2021-01-12 03:13:07 +0000
commit057a7acc514d9c2cdb7be303b5cbfd345427f9cb (patch)
treec145512131b8fba2650cb398579d85224a0b2d70
parentf685e91d351ffafd40a11c10d3b88ef78634f015 (diff)
downloadmelon-057a7acc514d9c2cdb7be303b5cbfd345427f9cb.tar.gz
melon-057a7acc514d9c2cdb7be303b5cbfd345427f9cb.tar.zst
Fix transformation matrix.
-rw-r--r--src/cnki_pdf.c11
1 files changed, 8 insertions, 3 deletions
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]);