Commit e01bbccb40d4714f8fd1551d7f7cca694d607091

Authored by Jay Berkenbilt
1 parent ce3406e9

QPDFJob: incorporate change to JSONHandler for dict start function

generate_auto_job
@@ -516,11 +516,11 @@ class Main: @@ -516,11 +516,11 @@ class Main:
516 def build_schema(j, s, flag, path): 516 def build_schema(j, s, flag, path):
517 if flag: 517 if flag:
518 identifier = self.to_identifier(path, '', False) 518 identifier = self.to_identifier(path, '', False)
519 - self.json_decls.append(f'void begin{identifier}();') 519 + self.json_decls.append(f'void begin{identifier}(JSON);')
520 self.json_decls.append(f'void end{identifier}();') 520 self.json_decls.append(f'void end{identifier}();')
521 self.json_init.append( 521 self.json_init.append(
522 f'beginDict("{flag}",' 522 f'beginDict("{flag}",'
523 - f' bindBare(&Handlers::begin{identifier}),' 523 + f' bindJSON(&Handlers::begin{identifier}),'
524 f' bindBare(&Handlers::end{identifier})); // {path}') 524 f' bindBare(&Handlers::end{identifier})); // {path}')
525 for k, v in j.items(): 525 for k, v in j.items():
526 is_trivial = False 526 is_trivial = False
job.sums
1 # Generated by generate_auto_job 1 # Generated by generate_auto_job
2 -generate_auto_job 53b2b81e8cb38f1bfa0053f351f37fe9e9437eb2cef808ff0c01cfc56ca20946 2 +generate_auto_job e4a071599697cc0f4d985367735ac6ed6110575e2cbfa01406d048780466d546
3 include/qpdf/auto_job_c_att.hh 7ad43bb374c1370ef32ebdcdcb7b73a61d281f7f4e3f12755585872ab30fb60e 3 include/qpdf/auto_job_c_att.hh 7ad43bb374c1370ef32ebdcdcb7b73a61d281f7f4e3f12755585872ab30fb60e
4 include/qpdf/auto_job_c_copy_att.hh 32275d03cdc69b703dd7e02ba0bbe15756e714e9ad185484773a6178dc09e1ee 4 include/qpdf/auto_job_c_copy_att.hh 32275d03cdc69b703dd7e02ba0bbe15756e714e9ad185484773a6178dc09e1ee
5 include/qpdf/auto_job_c_enc.hh 72e138c7b96ed5aacdce78c1dec04b1c20d361faec4f8faf52f64c1d6be99265 5 include/qpdf/auto_job_c_enc.hh 72e138c7b96ed5aacdce78c1dec04b1c20d361faec4f8faf52f64c1d6be99265
6 include/qpdf/auto_job_c_main.hh 516adb23cc7e44e614e436880be870d0574e4ebbc706cd855a1360000eed31bb 6 include/qpdf/auto_job_c_main.hh 516adb23cc7e44e614e436880be870d0574e4ebbc706cd855a1360000eed31bb
7 include/qpdf/auto_job_c_pages.hh 931840b329a36ca0e41401190e04537b47f2867671a6643bfd8da74014202671 7 include/qpdf/auto_job_c_pages.hh 931840b329a36ca0e41401190e04537b47f2867671a6643bfd8da74014202671
8 include/qpdf/auto_job_c_uo.hh 0585b7de459fa479d9e51a45fa92de0ff6dee748efc9ec1cedd0dde6cee1ad50 8 include/qpdf/auto_job_c_uo.hh 0585b7de459fa479d9e51a45fa92de0ff6dee748efc9ec1cedd0dde6cee1ad50
9 -job.yml d9be74c397e1f272ac6a81981a528c332f8bd7b98d58ae6ba6f60875391567e8 9 +job.yml 7433861fa281197aa275d624a334aa324ec63839c5e56a24448ab64d0b75587c
10 libqpdf/qpdf/auto_job_decl.hh 9f79396ec459f191be4c5fe34cf88c265cf47355a1a945fa39169d1c94cf04f6 10 libqpdf/qpdf/auto_job_decl.hh 9f79396ec459f191be4c5fe34cf88c265cf47355a1a945fa39169d1c94cf04f6
11 libqpdf/qpdf/auto_job_help.hh 23c79f1d2c02bda28f64aace17f69487205c797e7ae2234892cbbabab49d6d47 11 libqpdf/qpdf/auto_job_help.hh 23c79f1d2c02bda28f64aace17f69487205c797e7ae2234892cbbabab49d6d47
12 libqpdf/qpdf/auto_job_init.hh 8e9e31b6099a662497339b27f6e2d7f779f35011e88a834bee8811c33405a0fe 12 libqpdf/qpdf/auto_job_init.hh 8e9e31b6099a662497339b27f6e2d7f779f35011e88a834bee8811c33405a0fe
13 -libqpdf/qpdf/auto_job_json_decl.hh d729213332b92ee0da89d1cad0318ab96aec443f37d208fbbc8d56e9d1398ac2  
14 -libqpdf/qpdf/auto_job_json_init.hh a28c2c2b83d1c0036d3d07172dffb1eac1b75ce3d6a615a87111e9f3bd3dad58  
15 -libqpdf/qpdf/auto_job_schema.hh 9962f09f3260c01d4165a6ddf2814a0621395dcb5d80a3d310f580a1b7d3baba 13 +libqpdf/qpdf/auto_job_json_decl.hh d315f920a32d7a5a2272807e6813d463c3e1877a9d735e44e8417b5f1461b87a
  14 +libqpdf/qpdf/auto_job_json_init.hh 08e6ee8a509bc592e3aa6f7a1d3a6d18cdf4803e6220147855caf675e0a299ce
  15 +libqpdf/qpdf/auto_job_schema.hh 6ec5b9dd3b4709b49fb3b928c4d9cde8b35ad938a0945f81c9a3da6c3bf9a3c1
16 manual/_ext/qpdf.py e9ac9d6c70642a3d29281ee5ad92ae2422dee8be9306fb8a0bc9dba0ed5e28f3 16 manual/_ext/qpdf.py e9ac9d6c70642a3d29281ee5ad92ae2422dee8be9306fb8a0bc9dba0ed5e28f3
17 manual/cli.rst 79140e023faa0cb77afe0b1dc512dd120ee5617f4db82f842596e4f239f93882 17 manual/cli.rst 79140e023faa0cb77afe0b1dc512dd120ee5617f4db82f842596e4f239f93882
@@ -249,16 +249,20 @@ json: @@ -249,16 +249,20 @@ json:
249 # QPDFJob looks like. If a key starts with underscore or has a value 249 # QPDFJob looks like. If a key starts with underscore or has a value
250 # that is a string, it does not map to a command-line argument. If 250 # that is a string, it does not map to a command-line argument. If
251 # value is null, its properties and help come from other information 251 # value is null, its properties and help come from other information
252 - # known by generate_auto_job. This information is used to construct  
253 - # a "schema" (as in JSON.hh) for the json input to QPDFJob. The  
254 - # leading underscore is removed. 252 + # known by generate_auto_job. Otherwise, it has to match a
  253 + # command-line option. This information is used to construct a
  254 + # "schema" (as in JSON.hh) for the json input to QPDFJob. The
  255 + # leading underscore is removed. *NOTE*: all keys are converted to
  256 + # camelCase for the schema and must be appear that way in the
  257 + # user-supplied json. This makes it more convenient to populate JSON
  258 + # objects in some languages.
255 _input: 259 _input:
256 - _fileName: "input filename" 260 + _filename: "input filename"
257 main.password: 261 main.password:
258 password-file: 262 password-file:
259 empty: 263 empty:
260 _output: 264 _output:
261 - _fileName: "output filename" 265 + _filename: "output filename"
262 _replace-input: "set to true to replace input" 266 _replace-input: "set to true to replace input"
263 _options: 267 _options:
264 qdf: 268 qdf:
@@ -283,15 +287,14 @@ json: @@ -283,15 +287,14 @@ json:
283 progress: 287 progress:
284 split-pages: 288 split-pages:
285 encrypt: 289 encrypt:
286 - key-length: "key length: 48, 128, 256"  
287 user-password: "user password" 290 user-password: "user password"
288 owner-password: "owner password" 291 owner-password: "owner password"
289 - _40-bit: 292 + _40bit:
290 Enc40.annotate: 293 Enc40.annotate:
291 Enc40.extract: 294 Enc40.extract:
292 Enc40.modify: 295 Enc40.modify:
293 Enc40.print: 296 Enc40.print:
294 - _128-bit: 297 + _128bit:
295 Enc128.accessibility: 298 Enc128.accessibility:
296 Enc128.annotate: 299 Enc128.annotate:
297 Enc128.assemble: 300 Enc128.assemble:
@@ -303,7 +306,7 @@ json: @@ -303,7 +306,7 @@ json:
303 Enc128.print: 306 Enc128.print:
304 force-V4: 307 force-V4:
305 use-aes: 308 use-aes:
306 - _256-bit: 309 + _256bit:
307 Enc256.accessibility: 310 Enc256.accessibility:
308 Enc256.annotate: 311 Enc256.annotate:
309 Enc256.assemble: 312 Enc256.assemble:
libqpdf/QPDFJob_json.cc
1 #include <qpdf/QPDFJob.hh> 1 #include <qpdf/QPDFJob.hh>
2 #include <qpdf/JSONHandler.hh> 2 #include <qpdf/JSONHandler.hh>
3 #include <qpdf/QPDFUsage.hh> 3 #include <qpdf/QPDFUsage.hh>
  4 +#include <qpdf/QUtil.hh>
4 5
5 #include <memory> 6 #include <memory>
6 #include <stdexcept> 7 #include <stdexcept>
@@ -25,6 +26,7 @@ namespace @@ -25,6 +26,7 @@ namespace
25 26
26 typedef std::function<void()> bare_handler_t; 27 typedef std::function<void()> bare_handler_t;
27 typedef std::function<void(char const*)> param_handler_t; 28 typedef std::function<void(char const*)> param_handler_t;
  29 + typedef std::function<void(JSON)> json_handler_t;
28 typedef std::function<void(std::string const& key)> setup_handler_t; 30 typedef std::function<void(std::string const& key)> setup_handler_t;
29 31
30 void addBare(std::string const& key, bare_handler_t); 32 void addBare(std::string const& key, bare_handler_t);
@@ -33,11 +35,12 @@ namespace @@ -33,11 +35,12 @@ namespace
33 param_handler_t); 35 param_handler_t);
34 void doSetup(std::string const& key, setup_handler_t); 36 void doSetup(std::string const& key, setup_handler_t);
35 void beginDict(std::string const& key, 37 void beginDict(std::string const& key,
36 - bare_handler_t start_fn, 38 + json_handler_t start_fn,
37 bare_handler_t end_fn); 39 bare_handler_t end_fn);
38 void endDict(); 40 void endDict();
39 41
40 bare_handler_t bindBare(void (Handlers::*f)()); 42 bare_handler_t bindBare(void (Handlers::*f)());
  43 + json_handler_t bindJSON(void (Handlers::*f)(JSON));
41 setup_handler_t bindSetup(void (Handlers::*f)(std::string const&)); 44 setup_handler_t bindSetup(void (Handlers::*f)(std::string const&));
42 45
43 std::list<std::shared_ptr<JSONHandler>> json_handlers; 46 std::list<std::shared_ptr<JSONHandler>> json_handlers;
@@ -70,6 +73,12 @@ Handlers::bindBare(void (Handlers::*f)()) @@ -70,6 +73,12 @@ Handlers::bindBare(void (Handlers::*f)())
70 return std::bind(std::mem_fn(f), this); 73 return std::bind(std::mem_fn(f), this);
71 } 74 }
72 75
  76 +Handlers::json_handler_t
  77 +Handlers::bindJSON(void (Handlers::*f)(JSON))
  78 +{
  79 + return std::bind(std::mem_fn(f), this, std::placeholders::_1);
  80 +}
  81 +
73 Handlers::setup_handler_t 82 Handlers::setup_handler_t
74 Handlers::bindSetup(void (Handlers::*f)(std::string const&)) 83 Handlers::bindSetup(void (Handlers::*f)(std::string const&))
75 { 84 {
@@ -82,7 +91,7 @@ Handlers::initHandlers() @@ -82,7 +91,7 @@ Handlers::initHandlers()
82 this->json_handlers.push_back(std::make_shared<JSONHandler>()); 91 this->json_handlers.push_back(std::make_shared<JSONHandler>());
83 this->jh = this->json_handlers.back().get(); 92 this->jh = this->json_handlers.back().get();
84 jh->addDictHandlers( 93 jh->addDictHandlers(
85 - [](std::string const&){}, 94 + [](std::string const&, JSON){},
86 [this](std::string const&){c_main->checkConfiguration();}); 95 [this](std::string const&){c_main->checkConfiguration();});
87 96
88 # include <qpdf/auto_job_json_init.hh> 97 # include <qpdf/auto_job_json_init.hh>
@@ -172,12 +181,12 @@ Handlers::doSetup(std::string const&amp; key, setup_handler_t fn) @@ -172,12 +181,12 @@ Handlers::doSetup(std::string const&amp; key, setup_handler_t fn)
172 181
173 void 182 void
174 Handlers::beginDict(std::string const& key, 183 Handlers::beginDict(std::string const& key,
175 - bare_handler_t start_fn, 184 + json_handler_t start_fn,
176 bare_handler_t end_fn) 185 bare_handler_t end_fn)
177 { 186 {
178 auto new_jh = std::make_shared<JSONHandler>(); 187 auto new_jh = std::make_shared<JSONHandler>();
179 new_jh->addDictHandlers( 188 new_jh->addDictHandlers(
180 - [start_fn](std::string const&){ start_fn(); }, 189 + [start_fn](std::string const&, JSON j){ start_fn(j); },
181 [end_fn](std::string const&){ end_fn(); }); 190 [end_fn](std::string const&){ end_fn(); });
182 this->jh->addDictKeyHandler(key, new_jh); 191 this->jh->addDictKeyHandler(key, new_jh);
183 this->json_handlers.push_back(new_jh); 192 this->json_handlers.push_back(new_jh);
@@ -198,7 +207,7 @@ Handlers::handle(JSON&amp; j) @@ -198,7 +207,7 @@ Handlers::handle(JSON&amp; j)
198 } 207 }
199 208
200 void 209 void
201 -Handlers::beginInput() 210 +Handlers::beginInput(JSON)
202 { 211 {
203 // nothing needed 212 // nothing needed
204 } 213 }
@@ -210,7 +219,7 @@ Handlers::endInput() @@ -210,7 +219,7 @@ Handlers::endInput()
210 } 219 }
211 220
212 void 221 void
213 -Handlers::setupInputFileName(std::string const& key) 222 +Handlers::setupInputFilename(std::string const& key)
214 { 223 {
215 addParameter(key, [this](char const* p) { 224 addParameter(key, [this](char const* p) {
216 c_main->inputFile(p); 225 c_main->inputFile(p);
@@ -232,7 +241,7 @@ Handlers::setupInputEmpty(std::string const&amp; key) @@ -232,7 +241,7 @@ Handlers::setupInputEmpty(std::string const&amp; key)
232 } 241 }
233 242
234 void 243 void
235 -Handlers::beginOutput() 244 +Handlers::beginOutput(JSON)
236 { 245 {
237 // nothing needed 246 // nothing needed
238 } 247 }
@@ -244,7 +253,7 @@ Handlers::endOutput() @@ -244,7 +253,7 @@ Handlers::endOutput()
244 } 253 }
245 254
246 void 255 void
247 -Handlers::setupOutputFileName(std::string const& key) 256 +Handlers::setupOutputFilename(std::string const& key)
248 { 257 {
249 addParameter(key, [this](char const* p) { 258 addParameter(key, [this](char const* p) {
250 c_main->outputFile(p); 259 c_main->outputFile(p);
@@ -260,7 +269,7 @@ Handlers::setupOutputReplaceInput(std::string const&amp; key) @@ -260,7 +269,7 @@ Handlers::setupOutputReplaceInput(std::string const&amp; key)
260 } 269 }
261 270
262 void 271 void
263 -Handlers::beginOutputOptions() 272 +Handlers::beginOutputOptions(JSON)
264 { 273 {
265 // nothing needed 274 // nothing needed
266 } 275 }
@@ -272,9 +281,15 @@ Handlers::endOutputOptions() @@ -272,9 +281,15 @@ Handlers::endOutputOptions()
272 } 281 }
273 282
274 void 283 void
275 -Handlers::beginOutputOptionsEncrypt() 284 +Handlers::beginOutputOptionsEncrypt(JSON)
276 { 285 {
277 // QXXXQ 286 // QXXXQ
  287 +// if (this->keylen_seen == 0)
  288 +// {
  289 +// usage("exactly one of 40bit, 128bit, or 256bit must be given;"
  290 +// " an empty dictionary may be supplied for one of them"
  291 +// " to set the key length without imposing any restrictions");
  292 +// }
278 } 293 }
279 294
280 void 295 void
@@ -284,61 +299,55 @@ Handlers::endOutputOptionsEncrypt() @@ -284,61 +299,55 @@ Handlers::endOutputOptionsEncrypt()
284 } 299 }
285 300
286 void 301 void
287 -Handlers::setupOutputOptionsEncryptKeyLength(std::string const& key)  
288 -{  
289 - // QXXXQ  
290 -}  
291 -  
292 -void  
293 Handlers::setupOutputOptionsEncryptUserPassword(std::string const& key) 302 Handlers::setupOutputOptionsEncryptUserPassword(std::string const& key)
294 { 303 {
295 - // QXXXQ 304 + // Key handled in beginOutputOptionsEncrypt
296 } 305 }
297 306
298 void 307 void
299 Handlers::setupOutputOptionsEncryptOwnerPassword(std::string const& key) 308 Handlers::setupOutputOptionsEncryptOwnerPassword(std::string const& key)
300 { 309 {
301 - // QXXXQ 310 + // Key handled in beginOutputOptionsEncrypt
302 } 311 }
303 312
304 void 313 void
305 -Handlers::beginOutputOptionsEncrypt40Bit() 314 +Handlers::beginOutputOptionsEncrypt40bit(JSON)
306 { 315 {
307 - // QXXXQ 316 + // nothing needed
308 } 317 }
309 318
310 void 319 void
311 -Handlers::endOutputOptionsEncrypt40Bit() 320 +Handlers::endOutputOptionsEncrypt40bit()
312 { 321 {
313 - // QXXXQ 322 + // nothing needed
314 } 323 }
315 324
316 void 325 void
317 -Handlers::beginOutputOptionsEncrypt128Bit() 326 +Handlers::beginOutputOptionsEncrypt128bit(JSON)
318 { 327 {
319 - // QXXXQ 328 + // nothing needed
320 } 329 }
321 330
322 void 331 void
323 -Handlers::endOutputOptionsEncrypt128Bit() 332 +Handlers::endOutputOptionsEncrypt128bit()
324 { 333 {
325 - // QXXXQ 334 + // nothing needed
326 } 335 }
327 336
328 void 337 void
329 -Handlers::beginOutputOptionsEncrypt256Bit() 338 +Handlers::beginOutputOptionsEncrypt256bit(JSON)
330 { 339 {
331 - // QXXXQ 340 + // nothing needed
332 } 341 }
333 342
334 void 343 void
335 -Handlers::endOutputOptionsEncrypt256Bit() 344 +Handlers::endOutputOptionsEncrypt256bit()
336 { 345 {
337 - // QXXXQ 346 + // nothing needed
338 } 347 }
339 348
340 void 349 void
341 -Handlers::beginOptions() 350 +Handlers::beginOptions(JSON)
342 { 351 {
343 // nothing needed 352 // nothing needed
344 } 353 }
@@ -350,7 +359,7 @@ Handlers::endOptions() @@ -350,7 +359,7 @@ Handlers::endOptions()
350 } 359 }
351 360
352 void 361 void
353 -Handlers::beginInspect() 362 +Handlers::beginInspect(JSON)
354 { 363 {
355 // nothing needed 364 // nothing needed
356 } 365 }
@@ -362,7 +371,7 @@ Handlers::endInspect() @@ -362,7 +371,7 @@ Handlers::endInspect()
362 } 371 }
363 372
364 void 373 void
365 -Handlers::beginTransform() 374 +Handlers::beginTransform(JSON)
366 { 375 {
367 // nothing needed 376 // nothing needed
368 } 377 }
@@ -374,7 +383,7 @@ Handlers::endTransform() @@ -374,7 +383,7 @@ Handlers::endTransform()
374 } 383 }
375 384
376 void 385 void
377 -Handlers::beginModify() 386 +Handlers::beginModify(JSON)
378 { 387 {
379 // nothing needed 388 // nothing needed
380 } 389 }
@@ -386,7 +395,7 @@ Handlers::endModify() @@ -386,7 +395,7 @@ Handlers::endModify()
386 } 395 }
387 396
388 void 397 void
389 -Handlers::beginModifyAddAttachment() 398 +Handlers::beginModifyAddAttachment(JSON)
390 { 399 {
391 // QXXXQ 400 // QXXXQ
392 } 401 }
@@ -400,11 +409,11 @@ Handlers::endModifyAddAttachment() @@ -400,11 +409,11 @@ Handlers::endModifyAddAttachment()
400 void 409 void
401 Handlers::setupModifyAddAttachmentPath(std::string const& key) 410 Handlers::setupModifyAddAttachmentPath(std::string const& key)
402 { 411 {
403 - // QXXXQ 412 + // QXXXQ setup
404 } 413 }
405 414
406 void 415 void
407 -Handlers::beginModifyCopyAttachmentsFrom() 416 +Handlers::beginModifyCopyAttachmentsFrom(JSON)
408 { 417 {
409 // QXXXQ 418 // QXXXQ
410 } 419 }
@@ -418,17 +427,17 @@ Handlers::endModifyCopyAttachmentsFrom() @@ -418,17 +427,17 @@ Handlers::endModifyCopyAttachmentsFrom()
418 void 427 void
419 Handlers::setupModifyCopyAttachmentsFromPath(std::string const& key) 428 Handlers::setupModifyCopyAttachmentsFromPath(std::string const& key)
420 { 429 {
421 - // QXXXQ 430 + // QXXXQ setup
422 } 431 }
423 432
424 void 433 void
425 Handlers::setupModifyCopyAttachmentsFromPassword(std::string const& key) 434 Handlers::setupModifyCopyAttachmentsFromPassword(std::string const& key)
426 { 435 {
427 - // QXXXQ 436 + // QXXXQ setup
428 } 437 }
429 438
430 void 439 void
431 -Handlers::beginModifyPages() 440 +Handlers::beginModifyPages(JSON)
432 { 441 {
433 // QXXXQ 442 // QXXXQ
434 } 443 }
@@ -442,23 +451,23 @@ Handlers::endModifyPages() @@ -442,23 +451,23 @@ Handlers::endModifyPages()
442 void 451 void
443 Handlers::setupModifyPagesFile(std::string const& key) 452 Handlers::setupModifyPagesFile(std::string const& key)
444 { 453 {
445 - // QXXXQ 454 + // QXXXQ setup
446 } 455 }
447 456
448 void 457 void
449 Handlers::setupModifyPagesPassword(std::string const& key) 458 Handlers::setupModifyPagesPassword(std::string const& key)
450 { 459 {
451 - // QXXXQ 460 + // QXXXQ setup
452 } 461 }
453 462
454 void 463 void
455 Handlers::setupModifyPagesRange(std::string const& key) 464 Handlers::setupModifyPagesRange(std::string const& key)
456 { 465 {
457 - // QXXXQ 466 + // QXXXQ setup
458 } 467 }
459 468
460 void 469 void
461 -Handlers::beginModifyOverlay() 470 +Handlers::beginModifyOverlay(JSON)
462 { 471 {
463 // QXXXQ 472 // QXXXQ
464 } 473 }
@@ -472,17 +481,17 @@ Handlers::endModifyOverlay() @@ -472,17 +481,17 @@ Handlers::endModifyOverlay()
472 void 481 void
473 Handlers::setupModifyOverlayFile(std::string const& key) 482 Handlers::setupModifyOverlayFile(std::string const& key)
474 { 483 {
475 - // QXXXQ 484 + // QXXXQ setup
476 } 485 }
477 486
478 void 487 void
479 Handlers::setupModifyOverlayPassword(std::string const& key) 488 Handlers::setupModifyOverlayPassword(std::string const& key)
480 { 489 {
481 - // QXXXQ 490 + // QXXXQ setup
482 } 491 }
483 492
484 void 493 void
485 -Handlers::beginModifyUnderlay() 494 +Handlers::beginModifyUnderlay(JSON)
486 { 495 {
487 // QXXXQ 496 // QXXXQ
488 } 497 }
@@ -496,13 +505,13 @@ Handlers::endModifyUnderlay() @@ -496,13 +505,13 @@ Handlers::endModifyUnderlay()
496 void 505 void
497 Handlers::setupModifyUnderlayFile(std::string const& key) 506 Handlers::setupModifyUnderlayFile(std::string const& key)
498 { 507 {
499 - // QXXXQ 508 + // QXXXQ setup
500 } 509 }
501 510
502 void 511 void
503 Handlers::setupModifyUnderlayPassword(std::string const& key) 512 Handlers::setupModifyUnderlayPassword(std::string const& key)
504 { 513 {
505 - // QXXXQ 514 + // QXXXQ setup
506 } 515 }
507 516
508 void 517 void
libqpdf/qpdf/auto_job_json_decl.hh
@@ -3,53 +3,52 @@ @@ -3,53 +3,52 @@
3 // Edits will be automatically overwritten if the build is 3 // Edits will be automatically overwritten if the build is
4 // run in maintainer mode. 4 // run in maintainer mode.
5 // 5 //
6 -void beginInput(); 6 +void beginInput(JSON);
7 void endInput(); 7 void endInput();
8 -void setupInputFileName(std::string const&); 8 +void setupInputFilename(std::string const&);
9 void setupInputPassword(std::string const&); 9 void setupInputPassword(std::string const&);
10 void setupInputEmpty(std::string const&); 10 void setupInputEmpty(std::string const&);
11 -void beginOutput(); 11 +void beginOutput(JSON);
12 void endOutput(); 12 void endOutput();
13 -void setupOutputFileName(std::string const&); 13 +void setupOutputFilename(std::string const&);
14 void setupOutputReplaceInput(std::string const&); 14 void setupOutputReplaceInput(std::string const&);
15 -void beginOutputOptions(); 15 +void beginOutputOptions(JSON);
16 void endOutputOptions(); 16 void endOutputOptions();
17 -void beginOutputOptionsEncrypt(); 17 +void beginOutputOptionsEncrypt(JSON);
18 void endOutputOptionsEncrypt(); 18 void endOutputOptionsEncrypt();
19 -void setupOutputOptionsEncryptKeyLength(std::string const&);  
20 void setupOutputOptionsEncryptUserPassword(std::string const&); 19 void setupOutputOptionsEncryptUserPassword(std::string const&);
21 void setupOutputOptionsEncryptOwnerPassword(std::string const&); 20 void setupOutputOptionsEncryptOwnerPassword(std::string const&);
22 -void beginOutputOptionsEncrypt40Bit();  
23 -void endOutputOptionsEncrypt40Bit();  
24 -void beginOutputOptionsEncrypt128Bit();  
25 -void endOutputOptionsEncrypt128Bit();  
26 -void beginOutputOptionsEncrypt256Bit();  
27 -void endOutputOptionsEncrypt256Bit();  
28 -void beginOptions(); 21 +void beginOutputOptionsEncrypt40bit(JSON);
  22 +void endOutputOptionsEncrypt40bit();
  23 +void beginOutputOptionsEncrypt128bit(JSON);
  24 +void endOutputOptionsEncrypt128bit();
  25 +void beginOutputOptionsEncrypt256bit(JSON);
  26 +void endOutputOptionsEncrypt256bit();
  27 +void beginOptions(JSON);
29 void endOptions(); 28 void endOptions();
30 -void beginInspect(); 29 +void beginInspect(JSON);
31 void endInspect(); 30 void endInspect();
32 -void beginTransform(); 31 +void beginTransform(JSON);
33 void endTransform(); 32 void endTransform();
34 -void beginModify(); 33 +void beginModify(JSON);
35 void endModify(); 34 void endModify();
36 -void beginModifyAddAttachment(); 35 +void beginModifyAddAttachment(JSON);
37 void endModifyAddAttachment(); 36 void endModifyAddAttachment();
38 void setupModifyAddAttachmentPath(std::string const&); 37 void setupModifyAddAttachmentPath(std::string const&);
39 -void beginModifyCopyAttachmentsFrom(); 38 +void beginModifyCopyAttachmentsFrom(JSON);
40 void endModifyCopyAttachmentsFrom(); 39 void endModifyCopyAttachmentsFrom();
41 void setupModifyCopyAttachmentsFromPath(std::string const&); 40 void setupModifyCopyAttachmentsFromPath(std::string const&);
42 void setupModifyCopyAttachmentsFromPassword(std::string const&); 41 void setupModifyCopyAttachmentsFromPassword(std::string const&);
43 -void beginModifyPages(); 42 +void beginModifyPages(JSON);
44 void endModifyPages(); 43 void endModifyPages();
45 void setupModifyPagesFile(std::string const&); 44 void setupModifyPagesFile(std::string const&);
46 void setupModifyPagesPassword(std::string const&); 45 void setupModifyPagesPassword(std::string const&);
47 void setupModifyPagesRange(std::string const&); 46 void setupModifyPagesRange(std::string const&);
48 -void beginModifyOverlay(); 47 +void beginModifyOverlay(JSON);
49 void endModifyOverlay(); 48 void endModifyOverlay();
50 void setupModifyOverlayFile(std::string const&); 49 void setupModifyOverlayFile(std::string const&);
51 void setupModifyOverlayPassword(std::string const&); 50 void setupModifyOverlayPassword(std::string const&);
52 -void beginModifyUnderlay(); 51 +void beginModifyUnderlay(JSON);
53 void endModifyUnderlay(); 52 void endModifyUnderlay();
54 void setupModifyUnderlayFile(std::string const&); 53 void setupModifyUnderlayFile(std::string const&);
55 void setupModifyUnderlayPassword(std::string const&); 54 void setupModifyUnderlayPassword(std::string const&);
libqpdf/qpdf/auto_job_json_init.hh
@@ -14,16 +14,16 @@ static char const* json_key_choices[] = {&quot;acroform&quot;, &quot;attachments&quot;, &quot;encrypt&quot;, &quot; @@ -14,16 +14,16 @@ static char const* json_key_choices[] = {&quot;acroform&quot;, &quot;attachments&quot;, &quot;encrypt&quot;, &quot;
14 static char const* print128_choices[] = {"full", "low", "none", 0}; 14 static char const* print128_choices[] = {"full", "low", "none", 0};
15 static char const* modify128_choices[] = {"all", "annotate", "form", "assembly", "none", 0}; 15 static char const* modify128_choices[] = {"all", "annotate", "form", "assembly", "none", 0};
16 16
17 -beginDict("input", bindBare(&Handlers::beginInput), bindBare(&Handlers::endInput)); // .input  
18 -doSetup("fileName", bindSetup(&Handlers::setupInputFileName)); 17 +beginDict("input", bindJSON(&Handlers::beginInput), bindBare(&Handlers::endInput)); // .input
  18 +doSetup("filename", bindSetup(&Handlers::setupInputFilename));
19 doSetup("password", bindSetup(&Handlers::setupInputPassword)); 19 doSetup("password", bindSetup(&Handlers::setupInputPassword));
20 addParameter("passwordFile", [this](char const* p) { c_main->passwordFile(p); }); 20 addParameter("passwordFile", [this](char const* p) { c_main->passwordFile(p); });
21 doSetup("empty", bindSetup(&Handlers::setupInputEmpty)); 21 doSetup("empty", bindSetup(&Handlers::setupInputEmpty));
22 endDict(); // .input 22 endDict(); // .input
23 -beginDict("output", bindBare(&Handlers::beginOutput), bindBare(&Handlers::endOutput)); // .output  
24 -doSetup("fileName", bindSetup(&Handlers::setupOutputFileName)); 23 +beginDict("output", bindJSON(&Handlers::beginOutput), bindBare(&Handlers::endOutput)); // .output
  24 +doSetup("filename", bindSetup(&Handlers::setupOutputFilename));
25 doSetup("replaceInput", bindSetup(&Handlers::setupOutputReplaceInput)); 25 doSetup("replaceInput", bindSetup(&Handlers::setupOutputReplaceInput));
26 -beginDict("options", bindBare(&Handlers::beginOutputOptions), bindBare(&Handlers::endOutputOptions)); // .output.options 26 +beginDict("options", bindJSON(&Handlers::beginOutputOptions), bindBare(&Handlers::endOutputOptions)); // .output.options
27 addBare("qdf", [this]() { c_main->qdf(); }); 27 addBare("qdf", [this]() { c_main->qdf(); });
28 addBare("preserveUnreferenced", [this]() { c_main->preserveUnreferenced(); }); 28 addBare("preserveUnreferenced", [this]() { c_main->preserveUnreferenced(); });
29 addBare("newlineBeforeEndstream", [this]() { c_main->newlineBeforeEndstream(); }); 29 addBare("newlineBeforeEndstream", [this]() { c_main->newlineBeforeEndstream(); });
@@ -45,17 +45,16 @@ addParameter(&quot;minVersion&quot;, [this](char const* p) { c_main-&gt;minVersion(p); }); @@ -45,17 +45,16 @@ addParameter(&quot;minVersion&quot;, [this](char const* p) { c_main-&gt;minVersion(p); });
45 addParameter("forceVersion", [this](char const* p) { c_main->forceVersion(p); }); 45 addParameter("forceVersion", [this](char const* p) { c_main->forceVersion(p); });
46 addBare("progress", [this]() { c_main->progress(); }); 46 addBare("progress", [this]() { c_main->progress(); });
47 addParameter("splitPages", [this](char const* p) { c_main->splitPages(p); }); 47 addParameter("splitPages", [this](char const* p) { c_main->splitPages(p); });
48 -beginDict("encrypt", bindBare(&Handlers::beginOutputOptionsEncrypt), bindBare(&Handlers::endOutputOptionsEncrypt)); // .output.options.encrypt  
49 -doSetup("keyLength", bindSetup(&Handlers::setupOutputOptionsEncryptKeyLength)); 48 +beginDict("encrypt", bindJSON(&Handlers::beginOutputOptionsEncrypt), bindBare(&Handlers::endOutputOptionsEncrypt)); // .output.options.encrypt
50 doSetup("userPassword", bindSetup(&Handlers::setupOutputOptionsEncryptUserPassword)); 49 doSetup("userPassword", bindSetup(&Handlers::setupOutputOptionsEncryptUserPassword));
51 doSetup("ownerPassword", bindSetup(&Handlers::setupOutputOptionsEncryptOwnerPassword)); 50 doSetup("ownerPassword", bindSetup(&Handlers::setupOutputOptionsEncryptOwnerPassword));
52 -beginDict("40Bit", bindBare(&Handlers::beginOutputOptionsEncrypt40Bit), bindBare(&Handlers::endOutputOptionsEncrypt40Bit)); // .output.options.encrypt.40Bit 51 +beginDict("40bit", bindJSON(&Handlers::beginOutputOptionsEncrypt40bit), bindBare(&Handlers::endOutputOptionsEncrypt40bit)); // .output.options.encrypt.40bit
53 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); }); 52 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); });
54 addChoices("extract", yn_choices, [this](char const* p) { c_enc->extract(p); }); 53 addChoices("extract", yn_choices, [this](char const* p) { c_enc->extract(p); });
55 addChoices("modify", modify128_choices, [this](char const* p) { c_enc->modify(p); }); 54 addChoices("modify", modify128_choices, [this](char const* p) { c_enc->modify(p); });
56 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); }); 55 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); });
57 -endDict(); // .output.options.encrypt.40Bit  
58 -beginDict("128Bit", bindBare(&Handlers::beginOutputOptionsEncrypt128Bit), bindBare(&Handlers::endOutputOptionsEncrypt128Bit)); // .output.options.encrypt.128Bit 56 +endDict(); // .output.options.encrypt.40bit
  57 +beginDict("128bit", bindJSON(&Handlers::beginOutputOptionsEncrypt128bit), bindBare(&Handlers::endOutputOptionsEncrypt128bit)); // .output.options.encrypt.128bit
59 addChoices("accessibility", yn_choices, [this](char const* p) { c_enc->accessibility(p); }); 58 addChoices("accessibility", yn_choices, [this](char const* p) { c_enc->accessibility(p); });
60 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); }); 59 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); });
61 addChoices("assemble", yn_choices, [this](char const* p) { c_enc->assemble(p); }); 60 addChoices("assemble", yn_choices, [this](char const* p) { c_enc->assemble(p); });
@@ -67,8 +66,8 @@ addChoices(&quot;modify&quot;, modify128_choices, [this](char const* p) { c_enc-&gt;modify(p) @@ -67,8 +66,8 @@ addChoices(&quot;modify&quot;, modify128_choices, [this](char const* p) { c_enc-&gt;modify(p)
67 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); }); 66 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); });
68 addBare("forceV4", [this]() { c_enc->forceV4(); }); 67 addBare("forceV4", [this]() { c_enc->forceV4(); });
69 addChoices("useAes", yn_choices, [this](char const* p) { c_enc->useAes(p); }); 68 addChoices("useAes", yn_choices, [this](char const* p) { c_enc->useAes(p); });
70 -endDict(); // .output.options.encrypt.128Bit  
71 -beginDict("256Bit", bindBare(&Handlers::beginOutputOptionsEncrypt256Bit), bindBare(&Handlers::endOutputOptionsEncrypt256Bit)); // .output.options.encrypt.256Bit 69 +endDict(); // .output.options.encrypt.128bit
  70 +beginDict("256bit", bindJSON(&Handlers::beginOutputOptionsEncrypt256bit), bindBare(&Handlers::endOutputOptionsEncrypt256bit)); // .output.options.encrypt.256bit
72 addChoices("accessibility", yn_choices, [this](char const* p) { c_enc->accessibility(p); }); 71 addChoices("accessibility", yn_choices, [this](char const* p) { c_enc->accessibility(p); });
73 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); }); 72 addChoices("annotate", yn_choices, [this](char const* p) { c_enc->annotate(p); });
74 addChoices("assemble", yn_choices, [this](char const* p) { c_enc->assemble(p); }); 73 addChoices("assemble", yn_choices, [this](char const* p) { c_enc->assemble(p); });
@@ -80,11 +79,11 @@ addChoices(&quot;modify&quot;, modify128_choices, [this](char const* p) { c_enc-&gt;modify(p) @@ -80,11 +79,11 @@ addChoices(&quot;modify&quot;, modify128_choices, [this](char const* p) { c_enc-&gt;modify(p)
80 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); }); 79 addChoices("print", print128_choices, [this](char const* p) { c_enc->print(p); });
81 addBare("allowInsecure", [this]() { c_enc->allowInsecure(); }); 80 addBare("allowInsecure", [this]() { c_enc->allowInsecure(); });
82 addBare("forceR5", [this]() { c_enc->forceR5(); }); 81 addBare("forceR5", [this]() { c_enc->forceR5(); });
83 -endDict(); // .output.options.encrypt.256Bit 82 +endDict(); // .output.options.encrypt.256bit
84 endDict(); // .output.options.encrypt 83 endDict(); // .output.options.encrypt
85 endDict(); // .output.options 84 endDict(); // .output.options
86 endDict(); // .output 85 endDict(); // .output
87 -beginDict("options", bindBare(&Handlers::beginOptions), bindBare(&Handlers::endOptions)); // .options 86 +beginDict("options", bindJSON(&Handlers::beginOptions), bindBare(&Handlers::endOptions)); // .options
88 addBare("allowWeakCrypto", [this]() { c_main->allowWeakCrypto(); }); 87 addBare("allowWeakCrypto", [this]() { c_main->allowWeakCrypto(); });
89 addBare("deterministicId", [this]() { c_main->deterministicId(); }); 88 addBare("deterministicId", [this]() { c_main->deterministicId(); });
90 addChoices("keepFilesOpen", yn_choices, [this](char const* p) { c_main->keepFilesOpen(p); }); 89 addChoices("keepFilesOpen", yn_choices, [this](char const* p) { c_main->keepFilesOpen(p); });
@@ -98,7 +97,7 @@ addChoices(&quot;passwordMode&quot;, password_mode_choices, [this](char const* p) { c_main @@ -98,7 +97,7 @@ addChoices(&quot;passwordMode&quot;, password_mode_choices, [this](char const* p) { c_main
98 addBare("suppressPasswordRecovery", [this]() { c_main->suppressPasswordRecovery(); }); 97 addBare("suppressPasswordRecovery", [this]() { c_main->suppressPasswordRecovery(); });
99 addBare("suppressRecovery", [this]() { c_main->suppressRecovery(); }); 98 addBare("suppressRecovery", [this]() { c_main->suppressRecovery(); });
100 endDict(); // .options 99 endDict(); // .options
101 -beginDict("inspect", bindBare(&Handlers::beginInspect), bindBare(&Handlers::endInspect)); // .inspect 100 +beginDict("inspect", bindJSON(&Handlers::beginInspect), bindBare(&Handlers::endInspect)); // .inspect
102 addBare("check", [this]() { c_main->check(); }); 101 addBare("check", [this]() { c_main->check(); });
103 addBare("checkLinearization", [this]() { c_main->checkLinearization(); }); 102 addBare("checkLinearization", [this]() { c_main->checkLinearization(); });
104 addBare("filteredStreamData", [this]() { c_main->filteredStreamData(); }); 103 addBare("filteredStreamData", [this]() { c_main->filteredStreamData(); });
@@ -119,15 +118,15 @@ addBare(&quot;json&quot;, [this]() { c_main-&gt;json(); }); @@ -119,15 +118,15 @@ addBare(&quot;json&quot;, [this]() { c_main-&gt;json(); });
119 addChoices("jsonKey", json_key_choices, [this](char const* p) { c_main->jsonKey(p); }); 118 addChoices("jsonKey", json_key_choices, [this](char const* p) { c_main->jsonKey(p); });
120 addParameter("jsonObject", [this](char const* p) { c_main->jsonObject(p); }); 119 addParameter("jsonObject", [this](char const* p) { c_main->jsonObject(p); });
121 endDict(); // .inspect 120 endDict(); // .inspect
122 -beginDict("transform", bindBare(&Handlers::beginTransform), bindBare(&Handlers::endTransform)); // .transform 121 +beginDict("transform", bindJSON(&Handlers::beginTransform), bindBare(&Handlers::endTransform)); // .transform
123 addBare("coalesceContents", [this]() { c_main->coalesceContents(); }); 122 addBare("coalesceContents", [this]() { c_main->coalesceContents(); });
124 addParameter("compressionLevel", [this](char const* p) { c_main->compressionLevel(p); }); 123 addParameter("compressionLevel", [this](char const* p) { c_main->compressionLevel(p); });
125 addBare("externalizeInlineImages", [this]() { c_main->externalizeInlineImages(); }); 124 addBare("externalizeInlineImages", [this]() { c_main->externalizeInlineImages(); });
126 addParameter("iiMinBytes", [this](char const* p) { c_main->iiMinBytes(p); }); 125 addParameter("iiMinBytes", [this](char const* p) { c_main->iiMinBytes(p); });
127 addChoices("removeUnreferencedResources", remove_unref_choices, [this](char const* p) { c_main->removeUnreferencedResources(p); }); 126 addChoices("removeUnreferencedResources", remove_unref_choices, [this](char const* p) { c_main->removeUnreferencedResources(p); });
128 endDict(); // .transform 127 endDict(); // .transform
129 -beginDict("modify", bindBare(&Handlers::beginModify), bindBare(&Handlers::endModify)); // .modify  
130 -beginDict("addAttachment", bindBare(&Handlers::beginModifyAddAttachment), bindBare(&Handlers::endModifyAddAttachment)); // .modify.addAttachment 128 +beginDict("modify", bindJSON(&Handlers::beginModify), bindBare(&Handlers::endModify)); // .modify
  129 +beginDict("addAttachment", bindJSON(&Handlers::beginModifyAddAttachment), bindBare(&Handlers::endModifyAddAttachment)); // .modify.addAttachment
131 doSetup("path", bindSetup(&Handlers::setupModifyAddAttachmentPath)); 130 doSetup("path", bindSetup(&Handlers::setupModifyAddAttachmentPath));
132 addParameter("creationdate", [this](char const* p) { c_att->creationdate(p); }); 131 addParameter("creationdate", [this](char const* p) { c_att->creationdate(p); });
133 addParameter("description", [this](char const* p) { c_att->description(p); }); 132 addParameter("description", [this](char const* p) { c_att->description(p); });
@@ -138,7 +137,7 @@ addParameter(&quot;moddate&quot;, [this](char const* p) { c_att-&gt;moddate(p); }); @@ -138,7 +137,7 @@ addParameter(&quot;moddate&quot;, [this](char const* p) { c_att-&gt;moddate(p); });
138 addBare("replace", [this]() { c_att->replace(); }); 137 addBare("replace", [this]() { c_att->replace(); });
139 endDict(); // .modify.addAttachment 138 endDict(); // .modify.addAttachment
140 addParameter("removeAttachment", [this](char const* p) { c_main->removeAttachment(p); }); 139 addParameter("removeAttachment", [this](char const* p) { c_main->removeAttachment(p); });
141 -beginDict("copyAttachmentsFrom", bindBare(&Handlers::beginModifyCopyAttachmentsFrom), bindBare(&Handlers::endModifyCopyAttachmentsFrom)); // .modify.copyAttachmentsFrom 140 +beginDict("copyAttachmentsFrom", bindJSON(&Handlers::beginModifyCopyAttachmentsFrom), bindBare(&Handlers::endModifyCopyAttachmentsFrom)); // .modify.copyAttachmentsFrom
142 doSetup("path", bindSetup(&Handlers::setupModifyCopyAttachmentsFromPath)); 141 doSetup("path", bindSetup(&Handlers::setupModifyCopyAttachmentsFromPath));
143 doSetup("password", bindSetup(&Handlers::setupModifyCopyAttachmentsFromPassword)); 142 doSetup("password", bindSetup(&Handlers::setupModifyCopyAttachmentsFromPassword));
144 addParameter("prefix", [this](char const* p) { c_copy_att->prefix(p); }); 143 addParameter("prefix", [this](char const* p) { c_copy_att->prefix(p); });
@@ -152,21 +151,21 @@ addParameter(&quot;oiMinArea&quot;, [this](char const* p) { c_main-&gt;oiMinArea(p); }); @@ -152,21 +151,21 @@ addParameter(&quot;oiMinArea&quot;, [this](char const* p) { c_main-&gt;oiMinArea(p); });
152 addParameter("oiMinHeight", [this](char const* p) { c_main->oiMinHeight(p); }); 151 addParameter("oiMinHeight", [this](char const* p) { c_main->oiMinHeight(p); });
153 addParameter("oiMinWidth", [this](char const* p) { c_main->oiMinWidth(p); }); 152 addParameter("oiMinWidth", [this](char const* p) { c_main->oiMinWidth(p); });
154 addBare("optimizeImages", [this]() { c_main->optimizeImages(); }); 153 addBare("optimizeImages", [this]() { c_main->optimizeImages(); });
155 -beginDict("pages", bindBare(&Handlers::beginModifyPages), bindBare(&Handlers::endModifyPages)); // .modify.pages 154 +beginDict("pages", bindJSON(&Handlers::beginModifyPages), bindBare(&Handlers::endModifyPages)); // .modify.pages
156 doSetup("file", bindSetup(&Handlers::setupModifyPagesFile)); 155 doSetup("file", bindSetup(&Handlers::setupModifyPagesFile));
157 doSetup("password", bindSetup(&Handlers::setupModifyPagesPassword)); 156 doSetup("password", bindSetup(&Handlers::setupModifyPagesPassword));
158 doSetup("range", bindSetup(&Handlers::setupModifyPagesRange)); 157 doSetup("range", bindSetup(&Handlers::setupModifyPagesRange));
159 endDict(); // .modify.pages 158 endDict(); // .modify.pages
160 addBare("removePageLabels", [this]() { c_main->removePageLabels(); }); 159 addBare("removePageLabels", [this]() { c_main->removePageLabels(); });
161 addParameter("rotate", [this](char const* p) { c_main->rotate(p); }); 160 addParameter("rotate", [this](char const* p) { c_main->rotate(p); });
162 -beginDict("overlay", bindBare(&Handlers::beginModifyOverlay), bindBare(&Handlers::endModifyOverlay)); // .modify.overlay 161 +beginDict("overlay", bindJSON(&Handlers::beginModifyOverlay), bindBare(&Handlers::endModifyOverlay)); // .modify.overlay
163 doSetup("file", bindSetup(&Handlers::setupModifyOverlayFile)); 162 doSetup("file", bindSetup(&Handlers::setupModifyOverlayFile));
164 doSetup("password", bindSetup(&Handlers::setupModifyOverlayPassword)); 163 doSetup("password", bindSetup(&Handlers::setupModifyOverlayPassword));
165 addParameter("from", [this](char const* p) { c_uo->from(p); }); 164 addParameter("from", [this](char const* p) { c_uo->from(p); });
166 addParameter("repeat", [this](char const* p) { c_uo->repeat(p); }); 165 addParameter("repeat", [this](char const* p) { c_uo->repeat(p); });
167 addParameter("to", [this](char const* p) { c_uo->to(p); }); 166 addParameter("to", [this](char const* p) { c_uo->to(p); });
168 endDict(); // .modify.overlay 167 endDict(); // .modify.overlay
169 -beginDict("underlay", bindBare(&Handlers::beginModifyUnderlay), bindBare(&Handlers::endModifyUnderlay)); // .modify.underlay 168 +beginDict("underlay", bindJSON(&Handlers::beginModifyUnderlay), bindBare(&Handlers::endModifyUnderlay)); // .modify.underlay
170 doSetup("file", bindSetup(&Handlers::setupModifyUnderlayFile)); 169 doSetup("file", bindSetup(&Handlers::setupModifyUnderlayFile));
171 doSetup("password", bindSetup(&Handlers::setupModifyUnderlayPassword)); 170 doSetup("password", bindSetup(&Handlers::setupModifyUnderlayPassword));
172 addParameter("from", [this](char const* p) { c_uo->from(p); }); 171 addParameter("from", [this](char const* p) { c_uo->from(p); });
libqpdf/qpdf/auto_job_schema.hh
1 static constexpr char const* JOB_SCHEMA_DATA = R"({ 1 static constexpr char const* JOB_SCHEMA_DATA = R"({
2 "input": { 2 "input": {
3 - "fileName": "input filename", 3 + "filename": "input filename",
4 "password": "specify password", 4 "password": "specify password",
5 "passwordFile": "read password from a file", 5 "passwordFile": "read password from a file",
6 "empty": "empty input file" 6 "empty": "empty input file"
7 }, 7 },
8 "output": { 8 "output": {
9 - "fileName": "output filename", 9 + "filename": "output filename",
10 "replaceInput": "set to true to replace input", 10 "replaceInput": "set to true to replace input",
11 "options": { 11 "options": {
12 "qdf": "enable viewing PDF code in a text editor", 12 "qdf": "enable viewing PDF code in a text editor",
@@ -31,16 +31,15 @@ static constexpr char const* JOB_SCHEMA_DATA = R&quot;({ @@ -31,16 +31,15 @@ static constexpr char const* JOB_SCHEMA_DATA = R&quot;({
31 "progress": "show progress when writing", 31 "progress": "show progress when writing",
32 "splitPages": "write pages to separate files", 32 "splitPages": "write pages to separate files",
33 "encrypt": { 33 "encrypt": {
34 - "keyLength": "key length: 48, 128, 256",  
35 "userPassword": "user password", 34 "userPassword": "user password",
36 "ownerPassword": "owner password", 35 "ownerPassword": "owner password",
37 - "40Bit": { 36 + "40bit": {
38 "annotate": "restrict document annotation", 37 "annotate": "restrict document annotation",
39 "extract": "restrict text/graphic extraction", 38 "extract": "restrict text/graphic extraction",
40 "modify": "restrict document modification", 39 "modify": "restrict document modification",
41 "print": "restrict printing" 40 "print": "restrict printing"
42 }, 41 },
43 - "128Bit": { 42 + "128bit": {
44 "accessibility": "restrict document accessibility", 43 "accessibility": "restrict document accessibility",
45 "annotate": "restrict document annotation", 44 "annotate": "restrict document annotation",
46 "assemble": "restrict document assembly", 45 "assemble": "restrict document assembly",
@@ -53,7 +52,7 @@ static constexpr char const* JOB_SCHEMA_DATA = R&quot;({ @@ -53,7 +52,7 @@ static constexpr char const* JOB_SCHEMA_DATA = R&quot;({
53 "forceV4": "force V=4 in encryption dictionary", 52 "forceV4": "force V=4 in encryption dictionary",
54 "useAes": "use AES with 128-bit encryption" 53 "useAes": "use AES with 128-bit encryption"
55 }, 54 },
56 - "256Bit": { 55 + "256bit": {
57 "accessibility": "restrict document accessibility", 56 "accessibility": "restrict document accessibility",
58 "annotate": "restrict document annotation", 57 "annotate": "restrict document annotation",
59 "assemble": "restrict document assembly", 58 "assemble": "restrict document assembly",