Commit e06648830693e44855652d31a762607357442beb
1 parent
8ddca96e
Comment use of static ID in examples
Make sure people know that static ID should be used only for testing.
Showing
4 changed files
with
7 additions
and
4 deletions
examples/pdf-double-page-size.cc
| @@ -101,7 +101,7 @@ int main(int argc, char* argv[]) | @@ -101,7 +101,7 @@ int main(int argc, char* argv[]) | ||
| 101 | { | 101 | { |
| 102 | // For the test suite, uncompress streams and use static | 102 | // For the test suite, uncompress streams and use static |
| 103 | // IDs. | 103 | // IDs. |
| 104 | - w.setStaticID(true); | 104 | + w.setStaticID(true); // for testing only |
| 105 | w.setStreamDataMode(qpdf_s_uncompress); | 105 | w.setStreamDataMode(qpdf_s_uncompress); |
| 106 | } | 106 | } |
| 107 | w.write(); | 107 | w.write(); |
examples/pdf-invert-images.cc
| @@ -162,7 +162,7 @@ int main(int argc, char* argv[]) | @@ -162,7 +162,7 @@ int main(int argc, char* argv[]) | ||
| 162 | { | 162 | { |
| 163 | // For the test suite, uncompress streams and use static | 163 | // For the test suite, uncompress streams and use static |
| 164 | // IDs. | 164 | // IDs. |
| 165 | - w.setStaticID(true); | 165 | + w.setStaticID(true); // for testing only |
| 166 | } | 166 | } |
| 167 | w.write(); | 167 | w.write(); |
| 168 | std::cout << whoami << ": new file written to " << outfilename | 168 | std::cout << whoami << ": new file written to " << outfilename |
examples/pdf-linearize.c
| @@ -50,7 +50,10 @@ int main(int argc, char* argv[]) | @@ -50,7 +50,10 @@ int main(int argc, char* argv[]) | ||
| 50 | if (((qpdf_read(qpdf, infile, password) & QPDF_ERRORS) == 0) && | 50 | if (((qpdf_read(qpdf, infile, password) & QPDF_ERRORS) == 0) && |
| 51 | ((qpdf_init_write(qpdf, outfile) & QPDF_ERRORS) == 0)) | 51 | ((qpdf_init_write(qpdf, outfile) & QPDF_ERRORS) == 0)) |
| 52 | { | 52 | { |
| 53 | - qpdf_set_static_ID(qpdf, QPDF_TRUE); | 53 | + /* Use static ID for testing only. For production, a |
| 54 | + * non-static ID is used. See also | ||
| 55 | + * qpdf_set_deterministic_ID. */ | ||
| 56 | + qpdf_set_static_ID(qpdf, QPDF_TRUE); /* for testing only */ | ||
| 54 | qpdf_set_linearization(qpdf, QPDF_TRUE); | 57 | qpdf_set_linearization(qpdf, QPDF_TRUE); |
| 55 | qpdf_write(qpdf); | 58 | qpdf_write(qpdf); |
| 56 | } | 59 | } |
examples/pdf-split-pages.cc
| @@ -36,7 +36,7 @@ static void process(char const* whoami, | @@ -36,7 +36,7 @@ static void process(char const* whoami, | ||
| 36 | { | 36 | { |
| 37 | // For the test suite, uncompress streams and use static | 37 | // For the test suite, uncompress streams and use static |
| 38 | // IDs. | 38 | // IDs. |
| 39 | - outpdfw.setStaticID(true); | 39 | + outpdfw.setStaticID(true); // for testing only |
| 40 | outpdfw.setStreamDataMode(qpdf_s_uncompress); | 40 | outpdfw.setStreamDataMode(qpdf_s_uncompress); |
| 41 | } | 41 | } |
| 42 | outpdfw.write(); | 42 | outpdfw.write(); |