2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-16 17:02:22 +00:00

QPDFJob json: make bare arguments expect the empty string

Changing from bool requiring true to string requiring the empty string
is more consistent with the CLI and makes it possible to add an
optional parameter or choices later without breaking compatibility.
This commit is contained in:
Jay Berkenbilt 2022-01-31 18:15:10 -05:00
parent ea96330bb6
commit 21b9290785
21 changed files with 89 additions and 77 deletions

View File

@ -465,14 +465,19 @@ class Main:
self.json_init.append( self.json_init.append(
f'addBare([this]() {{ {config}->{flag_key}(); }});') f'addBare([this]() {{ {config}->{flag_key}(); }});')
elif kind == 'optional_parameter' or kind == 'required_parameter': elif kind == 'optional_parameter' or kind == 'required_parameter':
# No optional parameters in json # Optional parameters end up just being the empty string,
# so the handler has to deal with it. The empty string is
# also allowed for non-optional.
self.json_init.append( self.json_init.append(
f'addParameter([this](char const* p)' f'addParameter([this](char const* p)'
f' {{ {config}->{flag_key}(p); }});') f' {{ {config}->{flag_key}(p); }});')
elif kind == 'optional_choices' or kind == 'required_choices': elif kind == 'optional_choices':
# No optional choices in json
self.json_init.append( self.json_init.append(
f'addChoices({v}_choices,' f'addChoices({v}_choices, false,'
f' [this](char const* p) {{ {config}->{flag_key}(p); }});')
elif kind == 'required_choices':
self.json_init.append(
f'addChoices({v}_choices, true,'
f' [this](char const* p) {{ {config}->{flag_key}(p); }});') f' [this](char const* p) {{ {config}->{flag_key}(p); }});')
def handle_json_manual(self, path): def handle_json_manual(self, path):

View File

@ -1,5 +1,5 @@
# Generated by generate_auto_job # Generated by generate_auto_job
generate_auto_job 905fed38c06d258af617ac909bed78a7888a5eaba3f14cf143168665f6e90a86 generate_auto_job 8b3cc47eb96bfd003954d16d51c482e0e015544fdcdc1cbc89b6dcd964f8a2cb
include/qpdf/auto_job_c_att.hh 7ad43bb374c1370ef32ebdcdcb7b73a61d281f7f4e3f12755585872ab30fb60e include/qpdf/auto_job_c_att.hh 7ad43bb374c1370ef32ebdcdcb7b73a61d281f7f4e3f12755585872ab30fb60e
include/qpdf/auto_job_c_copy_att.hh 32275d03cdc69b703dd7e02ba0bbe15756e714e9ad185484773a6178dc09e1ee include/qpdf/auto_job_c_copy_att.hh 32275d03cdc69b703dd7e02ba0bbe15756e714e9ad185484773a6178dc09e1ee
include/qpdf/auto_job_c_enc.hh 72e138c7b96ed5aacdce78c1dec04b1c20d361faec4f8faf52f64c1d6be99265 include/qpdf/auto_job_c_enc.hh 72e138c7b96ed5aacdce78c1dec04b1c20d361faec4f8faf52f64c1d6be99265
@ -11,7 +11,7 @@ libqpdf/qpdf/auto_job_decl.hh 9f79396ec459f191be4c5fe34cf88c265cf47355a1a945fa39
libqpdf/qpdf/auto_job_help.hh a0ab6ab4dde2ad3d3f17ecae3ea274919119329e075061f3a3973535f5e367de libqpdf/qpdf/auto_job_help.hh a0ab6ab4dde2ad3d3f17ecae3ea274919119329e075061f3a3973535f5e367de
libqpdf/qpdf/auto_job_init.hh c244e03e8b83ed7db732920f40aff0134e5f2e78a6edb9473ea4dd1934a8953e libqpdf/qpdf/auto_job_init.hh c244e03e8b83ed7db732920f40aff0134e5f2e78a6edb9473ea4dd1934a8953e
libqpdf/qpdf/auto_job_json_decl.hh c5e3fd38a3b0c569eb0c6b4c60953a09cd6bc7d3361a357a81f64fe36af2b0cf libqpdf/qpdf/auto_job_json_decl.hh c5e3fd38a3b0c569eb0c6b4c60953a09cd6bc7d3361a357a81f64fe36af2b0cf
libqpdf/qpdf/auto_job_json_init.hh bfaf88ad1461e1157e7a0eb6e8c90669eba6d03b5b1ffd2e7e7041250c5f0523 libqpdf/qpdf/auto_job_json_init.hh 3f86ce40931ca8f417d050fcd49104d73c1fa4e977ad19d54b372831a8ea17ed
libqpdf/qpdf/auto_job_schema.hh 2ec70dffdd15974d74102b4d7ada9f97449bc28c98be119efee5e15507ed22a8 libqpdf/qpdf/auto_job_schema.hh 2ec70dffdd15974d74102b4d7ada9f97449bc28c98be119efee5e15507ed22a8
manual/_ext/qpdf.py e9ac9d6c70642a3d29281ee5ad92ae2422dee8be9306fb8a0bc9dba0ed5e28f3 manual/_ext/qpdf.py e9ac9d6c70642a3d29281ee5ad92ae2422dee8be9306fb8a0bc9dba0ed5e28f3
manual/cli.rst a75a7e34aa9aba4f06e9c88cae9a2d9a2aa4e55a08521dde1478e8f2d80aadab manual/cli.rst a75a7e34aa9aba4f06e9c88cae9a2d9a2aa4e55a08521dde1478e8f2d80aadab

View File

@ -108,7 +108,7 @@ QPDFJob::Config::coalesceContents()
QPDFJob::Config* QPDFJob::Config*
QPDFJob::Config::collate(char const* parameter) QPDFJob::Config::collate(char const* parameter)
{ {
auto n = ((parameter == 0) ? 1 : auto n = (((parameter == 0) || (strlen(parameter) == 0)) ? 1 :
QUtil::string_to_uint(parameter)); QUtil::string_to_uint(parameter));
o.m->collate = QIntC::to_size(n); o.m->collate = QIntC::to_size(n);
return this; return this;
@ -519,7 +519,7 @@ QPDFJob::Config::showXref()
QPDFJob::Config* QPDFJob::Config*
QPDFJob::Config::splitPages(char const* parameter) QPDFJob::Config::splitPages(char const* parameter)
{ {
int n = ((parameter == 0) ? 1 : int n = (((parameter == 0) || (strlen(parameter) == 0)) ? 1 :
QUtil::string_to_int(parameter)); QUtil::string_to_int(parameter));
o.m->split_pages = n; o.m->split_pages = n;
return this; return this;

View File

@ -31,7 +31,7 @@ namespace
void addBare(bare_handler_t); void addBare(bare_handler_t);
void addParameter(param_handler_t); void addParameter(param_handler_t);
void addChoices(char const** choices, param_handler_t); void addChoices(char const** choices, bool required, param_handler_t);
void pushKey(std::string const& key); void pushKey(std::string const& key);
void beginDict(json_handler_t start_fn, void beginDict(json_handler_t start_fn,
bare_handler_t end_fn); bare_handler_t end_fn);
@ -106,11 +106,12 @@ Handlers::initHandlers()
void void
Handlers::addBare(bare_handler_t fn) Handlers::addBare(bare_handler_t fn)
{ {
jh->addBoolHandler([this, fn](std::string const& path, bool v){ jh->addStringHandler(
if (! v) [this, fn](std::string const& path, std::string const& parameter){
if (! parameter.empty())
{ {
QTC::TC("qpdf", "QPDFJob json bare not true"); QTC::TC("qpdf", "QPDFJob json bare not empty");
usage(path + ": value must be true"); usage(path + ": value must be the empty string");
} }
else else
{ {
@ -129,22 +130,28 @@ Handlers::addParameter(param_handler_t fn)
} }
void void
Handlers::addChoices(char const** choices, Handlers::addChoices(char const** choices, bool required, param_handler_t fn)
param_handler_t fn)
{ {
jh->addStringHandler( jh->addStringHandler(
[fn, choices, this]( [fn, choices, required, this](
std::string const& path, std::string const& parameter){ std::string const& path, std::string const& parameter){
char const* p = parameter.c_str(); char const* p = parameter.c_str();
bool matches = false; bool matches = false;
for (char const** i = choices; *i; ++i) if ((! required) && (parameter.empty()))
{ {
if (strcmp(*i, p) == 0) matches = true;
}
if (! matches)
{
for (char const** i = choices; *i; ++i)
{ {
QTC::TC("qpdf", "QPDFJob json choice match"); if (strcmp(*i, p) == 0)
matches = true; {
break; QTC::TC("qpdf", "QPDFJob json choice match");
matches = true;
break;
}
} }
} }
if (! matches) if (! matches)

View File

@ -43,19 +43,19 @@ pushKey("newlineBeforeEndstream");
addBare([this]() { c_main->newlineBeforeEndstream(); }); addBare([this]() { c_main->newlineBeforeEndstream(); });
popHandler(); // key: newlineBeforeEndstream popHandler(); // key: newlineBeforeEndstream
pushKey("normalizeContent"); pushKey("normalizeContent");
addChoices(yn_choices, [this](char const* p) { c_main->normalizeContent(p); }); addChoices(yn_choices, true, [this](char const* p) { c_main->normalizeContent(p); });
popHandler(); // key: normalizeContent popHandler(); // key: normalizeContent
pushKey("streamData"); pushKey("streamData");
addChoices(stream_data_choices, [this](char const* p) { c_main->streamData(p); }); addChoices(stream_data_choices, true, [this](char const* p) { c_main->streamData(p); });
popHandler(); // key: streamData popHandler(); // key: streamData
pushKey("compressStreams"); pushKey("compressStreams");
addChoices(yn_choices, [this](char const* p) { c_main->compressStreams(p); }); addChoices(yn_choices, true, [this](char const* p) { c_main->compressStreams(p); });
popHandler(); // key: compressStreams popHandler(); // key: compressStreams
pushKey("recompressFlate"); pushKey("recompressFlate");
addBare([this]() { c_main->recompressFlate(); }); addBare([this]() { c_main->recompressFlate(); });
popHandler(); // key: recompressFlate popHandler(); // key: recompressFlate
pushKey("decodeLevel"); pushKey("decodeLevel");
addChoices(decode_level_choices, [this](char const* p) { c_main->decodeLevel(p); }); addChoices(decode_level_choices, true, [this](char const* p) { c_main->decodeLevel(p); });
popHandler(); // key: decodeLevel popHandler(); // key: decodeLevel
pushKey("decrypt"); pushKey("decrypt");
addBare([this]() { c_main->decrypt(); }); addBare([this]() { c_main->decrypt(); });
@ -85,7 +85,7 @@ pushKey("linearizePass1");
addParameter([this](char const* p) { c_main->linearizePass1(p); }); addParameter([this](char const* p) { c_main->linearizePass1(p); });
popHandler(); // key: linearizePass1 popHandler(); // key: linearizePass1
pushKey("objectStreams"); pushKey("objectStreams");
addChoices(object_streams_choices, [this](char const* p) { c_main->objectStreams(p); }); addChoices(object_streams_choices, true, [this](char const* p) { c_main->objectStreams(p); });
popHandler(); // key: objectStreams popHandler(); // key: objectStreams
pushKey("minVersion"); pushKey("minVersion");
addParameter([this](char const* p) { c_main->minVersion(p); }); addParameter([this](char const* p) { c_main->minVersion(p); });
@ -110,82 +110,82 @@ popHandler(); // key: ownerPassword
pushKey("40bit"); pushKey("40bit");
beginDict(bindJSON(&Handlers::beginEncrypt40bit), bindBare(&Handlers::endEncrypt40bit)); // .encrypt.40bit beginDict(bindJSON(&Handlers::beginEncrypt40bit), bindBare(&Handlers::endEncrypt40bit)); // .encrypt.40bit
pushKey("annotate"); pushKey("annotate");
addChoices(yn_choices, [this](char const* p) { c_enc->annotate(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->annotate(p); });
popHandler(); // key: annotate popHandler(); // key: annotate
pushKey("extract"); pushKey("extract");
addChoices(yn_choices, [this](char const* p) { c_enc->extract(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->extract(p); });
popHandler(); // key: extract popHandler(); // key: extract
pushKey("modify"); pushKey("modify");
addChoices(modify128_choices, [this](char const* p) { c_enc->modify(p); }); addChoices(modify128_choices, true, [this](char const* p) { c_enc->modify(p); });
popHandler(); // key: modify popHandler(); // key: modify
pushKey("print"); pushKey("print");
addChoices(print128_choices, [this](char const* p) { c_enc->print(p); }); addChoices(print128_choices, true, [this](char const* p) { c_enc->print(p); });
popHandler(); // key: print popHandler(); // key: print
popHandler(); // key: 40bit popHandler(); // key: 40bit
pushKey("128bit"); pushKey("128bit");
beginDict(bindJSON(&Handlers::beginEncrypt128bit), bindBare(&Handlers::endEncrypt128bit)); // .encrypt.128bit beginDict(bindJSON(&Handlers::beginEncrypt128bit), bindBare(&Handlers::endEncrypt128bit)); // .encrypt.128bit
pushKey("accessibility"); pushKey("accessibility");
addChoices(yn_choices, [this](char const* p) { c_enc->accessibility(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->accessibility(p); });
popHandler(); // key: accessibility popHandler(); // key: accessibility
pushKey("annotate"); pushKey("annotate");
addChoices(yn_choices, [this](char const* p) { c_enc->annotate(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->annotate(p); });
popHandler(); // key: annotate popHandler(); // key: annotate
pushKey("assemble"); pushKey("assemble");
addChoices(yn_choices, [this](char const* p) { c_enc->assemble(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->assemble(p); });
popHandler(); // key: assemble popHandler(); // key: assemble
pushKey("cleartextMetadata"); pushKey("cleartextMetadata");
addBare([this]() { c_enc->cleartextMetadata(); }); addBare([this]() { c_enc->cleartextMetadata(); });
popHandler(); // key: cleartextMetadata popHandler(); // key: cleartextMetadata
pushKey("extract"); pushKey("extract");
addChoices(yn_choices, [this](char const* p) { c_enc->extract(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->extract(p); });
popHandler(); // key: extract popHandler(); // key: extract
pushKey("form"); pushKey("form");
addChoices(yn_choices, [this](char const* p) { c_enc->form(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->form(p); });
popHandler(); // key: form popHandler(); // key: form
pushKey("modifyOther"); pushKey("modifyOther");
addChoices(yn_choices, [this](char const* p) { c_enc->modifyOther(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->modifyOther(p); });
popHandler(); // key: modifyOther popHandler(); // key: modifyOther
pushKey("modify"); pushKey("modify");
addChoices(modify128_choices, [this](char const* p) { c_enc->modify(p); }); addChoices(modify128_choices, true, [this](char const* p) { c_enc->modify(p); });
popHandler(); // key: modify popHandler(); // key: modify
pushKey("print"); pushKey("print");
addChoices(print128_choices, [this](char const* p) { c_enc->print(p); }); addChoices(print128_choices, true, [this](char const* p) { c_enc->print(p); });
popHandler(); // key: print popHandler(); // key: print
pushKey("forceV4"); pushKey("forceV4");
addBare([this]() { c_enc->forceV4(); }); addBare([this]() { c_enc->forceV4(); });
popHandler(); // key: forceV4 popHandler(); // key: forceV4
pushKey("useAes"); pushKey("useAes");
addChoices(yn_choices, [this](char const* p) { c_enc->useAes(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->useAes(p); });
popHandler(); // key: useAes popHandler(); // key: useAes
popHandler(); // key: 128bit popHandler(); // key: 128bit
pushKey("256bit"); pushKey("256bit");
beginDict(bindJSON(&Handlers::beginEncrypt256bit), bindBare(&Handlers::endEncrypt256bit)); // .encrypt.256bit beginDict(bindJSON(&Handlers::beginEncrypt256bit), bindBare(&Handlers::endEncrypt256bit)); // .encrypt.256bit
pushKey("accessibility"); pushKey("accessibility");
addChoices(yn_choices, [this](char const* p) { c_enc->accessibility(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->accessibility(p); });
popHandler(); // key: accessibility popHandler(); // key: accessibility
pushKey("annotate"); pushKey("annotate");
addChoices(yn_choices, [this](char const* p) { c_enc->annotate(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->annotate(p); });
popHandler(); // key: annotate popHandler(); // key: annotate
pushKey("assemble"); pushKey("assemble");
addChoices(yn_choices, [this](char const* p) { c_enc->assemble(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->assemble(p); });
popHandler(); // key: assemble popHandler(); // key: assemble
pushKey("cleartextMetadata"); pushKey("cleartextMetadata");
addBare([this]() { c_enc->cleartextMetadata(); }); addBare([this]() { c_enc->cleartextMetadata(); });
popHandler(); // key: cleartextMetadata popHandler(); // key: cleartextMetadata
pushKey("extract"); pushKey("extract");
addChoices(yn_choices, [this](char const* p) { c_enc->extract(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->extract(p); });
popHandler(); // key: extract popHandler(); // key: extract
pushKey("form"); pushKey("form");
addChoices(yn_choices, [this](char const* p) { c_enc->form(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->form(p); });
popHandler(); // key: form popHandler(); // key: form
pushKey("modifyOther"); pushKey("modifyOther");
addChoices(yn_choices, [this](char const* p) { c_enc->modifyOther(p); }); addChoices(yn_choices, true, [this](char const* p) { c_enc->modifyOther(p); });
popHandler(); // key: modifyOther popHandler(); // key: modifyOther
pushKey("modify"); pushKey("modify");
addChoices(modify128_choices, [this](char const* p) { c_enc->modify(p); }); addChoices(modify128_choices, true, [this](char const* p) { c_enc->modify(p); });
popHandler(); // key: modify popHandler(); // key: modify
pushKey("print"); pushKey("print");
addChoices(print128_choices, [this](char const* p) { c_enc->print(p); }); addChoices(print128_choices, true, [this](char const* p) { c_enc->print(p); });
popHandler(); // key: print popHandler(); // key: print
pushKey("allowInsecure"); pushKey("allowInsecure");
addBare([this]() { c_enc->allowInsecure(); }); addBare([this]() { c_enc->allowInsecure(); });
@ -238,11 +238,11 @@ pushKey("showAttachment");
addParameter([this](char const* p) { c_main->showAttachment(p); }); addParameter([this](char const* p) { c_main->showAttachment(p); });
popHandler(); // key: showAttachment popHandler(); // key: showAttachment
pushKey("json"); pushKey("json");
addChoices(json_version_choices, [this](char const* p) { c_main->json(p); }); addChoices(json_version_choices, false, [this](char const* p) { c_main->json(p); });
popHandler(); // key: json popHandler(); // key: json
pushKey("jsonKey"); pushKey("jsonKey");
beginArray(bindJSON(&Handlers::beginJsonKeyArray), bindBare(&Handlers::endJsonKeyArray)); // .jsonKey[] beginArray(bindJSON(&Handlers::beginJsonKeyArray), bindBare(&Handlers::endJsonKeyArray)); // .jsonKey[]
addChoices(json_key_choices, [this](char const* p) { c_main->jsonKey(p); }); addChoices(json_key_choices, true, [this](char const* p) { c_main->jsonKey(p); });
popHandler(); // array: .jsonKey[] popHandler(); // array: .jsonKey[]
popHandler(); // key: jsonKey popHandler(); // key: jsonKey
pushKey("jsonObject"); pushKey("jsonObject");
@ -254,7 +254,7 @@ pushKey("allowWeakCrypto");
addBare([this]() { c_main->allowWeakCrypto(); }); addBare([this]() { c_main->allowWeakCrypto(); });
popHandler(); // key: allowWeakCrypto popHandler(); // key: allowWeakCrypto
pushKey("keepFilesOpen"); pushKey("keepFilesOpen");
addChoices(yn_choices, [this](char const* p) { c_main->keepFilesOpen(p); }); addChoices(yn_choices, true, [this](char const* p) { c_main->keepFilesOpen(p); });
popHandler(); // key: keepFilesOpen popHandler(); // key: keepFilesOpen
pushKey("keepFilesOpenThreshold"); pushKey("keepFilesOpenThreshold");
addParameter([this](char const* p) { c_main->keepFilesOpenThreshold(p); }); addParameter([this](char const* p) { c_main->keepFilesOpenThreshold(p); });
@ -272,7 +272,7 @@ pushKey("passwordIsHexKey");
addBare([this]() { c_main->passwordIsHexKey(); }); addBare([this]() { c_main->passwordIsHexKey(); });
popHandler(); // key: passwordIsHexKey popHandler(); // key: passwordIsHexKey
pushKey("passwordMode"); pushKey("passwordMode");
addChoices(password_mode_choices, [this](char const* p) { c_main->passwordMode(p); }); addChoices(password_mode_choices, true, [this](char const* p) { c_main->passwordMode(p); });
popHandler(); // key: passwordMode popHandler(); // key: passwordMode
pushKey("suppressPasswordRecovery"); pushKey("suppressPasswordRecovery");
addBare([this]() { c_main->suppressPasswordRecovery(); }); addBare([this]() { c_main->suppressPasswordRecovery(); });
@ -293,7 +293,7 @@ pushKey("iiMinBytes");
addParameter([this](char const* p) { c_main->iiMinBytes(p); }); addParameter([this](char const* p) { c_main->iiMinBytes(p); });
popHandler(); // key: iiMinBytes popHandler(); // key: iiMinBytes
pushKey("removeUnreferencedResources"); pushKey("removeUnreferencedResources");
addChoices(remove_unref_choices, [this](char const* p) { c_main->removeUnreferencedResources(p); }); addChoices(remove_unref_choices, true, [this](char const* p) { c_main->removeUnreferencedResources(p); });
popHandler(); // key: removeUnreferencedResources popHandler(); // key: removeUnreferencedResources
pushKey("addAttachment"); pushKey("addAttachment");
beginArray(bindJSON(&Handlers::beginAddAttachmentArray), bindBare(&Handlers::endAddAttachmentArray)); // .addAttachment[] beginArray(bindJSON(&Handlers::beginAddAttachmentArray), bindBare(&Handlers::endAddAttachmentArray)); // .addAttachment[]
@ -345,7 +345,7 @@ pushKey("collate");
addParameter([this](char const* p) { c_main->collate(p); }); addParameter([this](char const* p) { c_main->collate(p); });
popHandler(); // key: collate popHandler(); // key: collate
pushKey("flattenAnnotations"); pushKey("flattenAnnotations");
addChoices(flatten_choices, [this](char const* p) { c_main->flattenAnnotations(p); }); addChoices(flatten_choices, true, [this](char const* p) { c_main->flattenAnnotations(p); });
popHandler(); // key: flattenAnnotations popHandler(); // key: flattenAnnotations
pushKey("flattenRotation"); pushKey("flattenRotation");
addBare([this]() { c_main->flattenRotation(); }); addBare([this]() { c_main->flattenRotation(); });

View File

@ -630,7 +630,7 @@ qpdf check password password correct 0
qpdf check password not encrypted 0 qpdf check password not encrypted 0
QPDFJob_config password file 0 QPDFJob_config password file 0
QPDFJob_config password stdin 0 QPDFJob_config password stdin 0
QPDFJob json bare not true 0 QPDFJob json bare not empty 0
QPDFJob json choice mismatch 0 QPDFJob json choice mismatch 0
QPDFJob json choice match 0 QPDFJob json choice match 0
QPDFJob json encrypt no key length 0 QPDFJob json encrypt no key length 0

View File

@ -1,5 +1,5 @@
qpdf: error with job-json file bad-json-bare-option-false.json: .qdf: value must be true qpdf: error with job-json file bad-json-bare-option-false.json: .qdf: value must be the empty string
Run qpdf--job-json-help for information on the file format. Run qpdf--job-json-help for information on the file format.
For help: For help:

View File

@ -1,3 +1,3 @@
{ {
"qdf": false "qdf": "not-empty"
} }

View File

@ -1,7 +1,7 @@
{ {
"inputFile": "minimal.pdf", "inputFile": "minimal.pdf",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"addAttachment": [ "addAttachment": [
{ {
"file": "auto-txt", "file": "auto-txt",

View File

@ -1,6 +1,6 @@
{ {
"inputFile": "minimal.pdf", "inputFile": "minimal.pdf",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"deterministicId": true, "deterministicId": "",
"objectStreams": "generate" "objectStreams": "generate"
} }

View File

@ -1,7 +1,7 @@
{ {
"inputFile": "minimal.pdf", "inputFile": "minimal.pdf",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"copyAttachmentsFrom": [ "copyAttachmentsFrom": [
{ {
"file": "job-json-add-attachments.pdf" "file": "job-json-add-attachments.pdf"

View File

@ -1,7 +1,7 @@
{ {
"empty": true, "empty": "",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"pages": [ "pages": [
{ {
"file": "minimal.pdf" "file": "minimal.pdf"

View File

@ -1,8 +1,8 @@
{ {
"inputFile": "fxo-blue.pdf", "inputFile": "fxo-blue.pdf",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"staticAesIv": true, "staticAesIv": "",
"encrypt": { "encrypt": {
"userPassword": "u", "userPassword": "u",
"ownerPassword": "o", "ownerPassword": "o",

View File

@ -1,8 +1,8 @@
{ {
"inputFile": "minimal.pdf", "inputFile": "minimal.pdf",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"staticAesIv": true, "staticAesIv": "",
"encrypt": { "encrypt": {
"userPassword": "u", "userPassword": "u",
"ownerPassword": "o", "ownerPassword": "o",

View File

@ -1,11 +1,11 @@
{ {
"inputFile": "minimal.pdf", "inputFile": "minimal.pdf",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"encrypt": { "encrypt": {
"userPassword": "u", "userPassword": "u",
"ownerPassword": "o", "ownerPassword": "o",
"40bit": {} "40bit": {}
}, },
"allowWeakCrypto": true "allowWeakCrypto": ""
} }

View File

@ -2,7 +2,7 @@
"inputFile": "20-pages.pdf", "inputFile": "20-pages.pdf",
"password": "user", "password": "user",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"staticAesIv": true, "staticAesIv": "",
"compressStreams": "n" "compressStreams": "n"
} }

View File

@ -1,7 +1,7 @@
{ {
"inputFile": "minimal.pdf", "inputFile": "minimal.pdf",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"linearize": true, "linearize": "",
"compressStreams": "n" "compressStreams": "n"
} }

View File

@ -1,6 +1,6 @@
{ {
"inputFile": "a.pdf", "inputFile": "a.pdf",
"replaceInput": true, "replaceInput": "",
"staticId": true, "staticId": "",
"objectStreams": "generate" "objectStreams": "generate"
} }

View File

@ -1,7 +1,7 @@
{ {
"inputFile": "minimal.pdf", "inputFile": "minimal.pdf",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"underlay": { "underlay": {
"file": "20-pages.pdf", "file": "20-pages.pdf",
"password": "user", "password": "user",

View File

@ -2,8 +2,8 @@
"inputFile": "20-pages.pdf", "inputFile": "20-pages.pdf",
"password": "owner", "password": "owner",
"outputFile": "a.pdf", "outputFile": "a.pdf",
"staticId": true, "staticId": "",
"decrypt": true, "decrypt": "",
"underlay": { "underlay": {
"file": "fxo-green.pdf" "file": "fxo-green.pdf"
}, },

View File

@ -1,3 +1,3 @@
{ {
"showEncryption": true "showEncryption": ""
} }