aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2023-12-20 19:37:21 +0100
committerJay Berkenbilt <ejb@ql.org>2023-12-20 21:46:20 +0100
commit4ee393d1fa5424bc25952580b177f572e58920db (patch)
tree00ee9eb00ec6225dbbb1869f0a5ee41eb563f317 /examples
parent7e679ab8b68a38aae8374ef28f999afd94bf5124 (diff)
downloadqpdf-4ee393d1fa5424bc25952580b177f572e58920db.tar.zst
Remove compression from linearization tests where possible
By combining --linearize with --compress-streams=n, we ensure that no new compressed data will appear in linearized output, which makes the output independent of zlib's output. There are other tests to ensure that linearization works correctly with compression. This commit involves changing some test outputs and test code as well just updating test suites.
Diffstat (limited to 'examples')
-rw-r--r--examples/qpdf-job.cc3
-rw-r--r--examples/qpdfjob-c.c5
-rw-r--r--examples/qtest/qpdf-job/out.pdfbin1300 -> 1278 bytes
3 files changed, 6 insertions, 2 deletions
diff --git a/examples/qpdf-job.cc b/examples/qpdf-job.cc
index be868a17..99b853ea 100644
--- a/examples/qpdf-job.cc
+++ b/examples/qpdf-job.cc
@@ -44,6 +44,7 @@ main(int argc, char* argv[])
->endPages()
->linearize()
->staticId() // for testing only
+ ->compressStreams("n") // avoid dependency on zlib output
->checkConfiguration();
j.run();
std::cout << "out1 status: " << j.getExitCode() << std::endl;
@@ -63,6 +64,7 @@ main(int argc, char* argv[])
"1",
"--",
"--static-id",
+ "--compress-streams=n", // avoid dependency on zlib output
nullptr};
QPDFJob j;
j.initializeFromArgv(new_argv);
@@ -81,6 +83,7 @@ main(int argc, char* argv[])
"outputFile": "out3.pdf",
"staticId": "",
"linearize": "",
+ "compressStreams": "n",
"pages": [
{
"file": ".",
diff --git a/examples/qpdfjob-c.c b/examples/qpdfjob-c.c
index 62528392..6dd68283 100644
--- a/examples/qpdfjob-c.c
+++ b/examples/qpdfjob-c.c
@@ -19,7 +19,7 @@ main(int argc, char* argv[])
{
char* infile = NULL;
char* outfile = NULL;
- char const* new_argv[6];
+ char const* new_argv[7];
int r = 0;
char* p = 0;
@@ -43,7 +43,8 @@ main(int argc, char* argv[])
new_argv[2] = outfile;
new_argv[3] = "--linearize";
new_argv[4] = "--static-id"; /* for testing only */
- new_argv[5] = NULL;
+ new_argv[5] = "--compress-streams=n"; /* avoid dependency on zlib output */
+ new_argv[6] = NULL;
/* See qpdf-job.cc for a C++ example of using the json interface. To use that from C just like
* the argv one, call qpdfjob_run_from_json instead and pass the json string as a single char
diff --git a/examples/qtest/qpdf-job/out.pdf b/examples/qtest/qpdf-job/out.pdf
index c432ac59..d8ac1509 100644
--- a/examples/qtest/qpdf-job/out.pdf
+++ b/examples/qtest/qpdf-job/out.pdf
Binary files differ