diff options
author | yzrh <yzrh@noema.org> | 2021-01-12 03:13:07 +0000 |
---|---|---|
committer | yzrh <yzrh@noema.org> | 2021-01-12 03:13:07 +0000 |
commit | 057a7acc514d9c2cdb7be303b5cbfd345427f9cb (patch) | |
tree | c145512131b8fba2650cb398579d85224a0b2d70 /src | |
parent | f685e91d351ffafd40a11c10d3b88ef78634f015 (diff) | |
download | melon-057a7acc514d9c2cdb7be303b5cbfd345427f9cb.tar.gz melon-057a7acc514d9c2cdb7be303b5cbfd345427f9cb.tar.zst |
Fix transformation matrix.
Diffstat (limited to 'src')
-rw-r--r-- | src/cnki_pdf.c | 11 |
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]); |