diff options
Diffstat (limited to 'qpdf')
-rw-r--r-- | qpdf/qtest/qpdf.test | 21 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/remove-multiple-attachments-json.out | 3 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/remove-multiple-attachments.json | 10 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/remove-multiple-attachments.out | 3 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/remove-multiple-attachments.pdf | bin | 0 -> 1341 bytes |
5 files changed, 36 insertions, 1 deletions
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test index 5bf6be76..8878aa31 100644 --- a/qpdf/qtest/qpdf.test +++ b/qpdf/qtest/qpdf.test @@ -723,7 +723,7 @@ $td->runtest("check overlay with no resources output", show_ntests(); # ---------- $td->notify("--- File Attachments ---"); -$n_tests += 33; +$n_tests += 37; open(F, ">auto-txt") or die; print F "from file"; @@ -907,6 +907,25 @@ $td->runtest("check dates", {$td->REGEXP => ".*CreationDate \\(D:\\d+.*ModDate \\(D:\\d+.*", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); +$td->runtest("remove multiple attachments", + {$td->COMMAND => + "qpdf --verbose --static-id add-attachments-1.pdf a.pdf" . + " --remove-attachment=auto-1 --remove-attachment=auto-Two"}, + {$td->FILE => "remove-multiple-attachments.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "remove-multiple-attachments.pdf"}); +$td->runtest("remove multiple attachments (json)", + {$td->COMMAND => + "qpdf --job-json-file=remove-multiple-attachments.json"}, + {$td->FILE => "remove-multiple-attachments-json.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "b.pdf"}, + {$td->FILE => "remove-multiple-attachments.pdf"}); show_ntests(); # ---------- diff --git a/qpdf/qtest/qpdf/remove-multiple-attachments-json.out b/qpdf/qtest/qpdf/remove-multiple-attachments-json.out new file mode 100644 index 00000000..3563f1f8 --- /dev/null +++ b/qpdf/qtest/qpdf/remove-multiple-attachments-json.out @@ -0,0 +1,3 @@ +qpdf: removed attachment auto-1 +qpdf: removed attachment auto-Two +qpdf: wrote file b.pdf diff --git a/qpdf/qtest/qpdf/remove-multiple-attachments.json b/qpdf/qtest/qpdf/remove-multiple-attachments.json new file mode 100644 index 00000000..ea79cdf5 --- /dev/null +++ b/qpdf/qtest/qpdf/remove-multiple-attachments.json @@ -0,0 +1,10 @@ +{ + "verbose": "", + "staticId": "", + "inputFile": "add-attachments-1.pdf", + "outputFile": "b.pdf", + "removeAttachment": [ + "auto-1", + "auto-Two" + ] +} diff --git a/qpdf/qtest/qpdf/remove-multiple-attachments.out b/qpdf/qtest/qpdf/remove-multiple-attachments.out new file mode 100644 index 00000000..e114eff5 --- /dev/null +++ b/qpdf/qtest/qpdf/remove-multiple-attachments.out @@ -0,0 +1,3 @@ +qpdf: removed attachment auto-1 +qpdf: removed attachment auto-Two +qpdf: wrote file a.pdf diff --git a/qpdf/qtest/qpdf/remove-multiple-attachments.pdf b/qpdf/qtest/qpdf/remove-multiple-attachments.pdf Binary files differnew file mode 100644 index 00000000..c480af1c --- /dev/null +++ b/qpdf/qtest/qpdf/remove-multiple-attachments.pdf |