2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-02-02 11:58:25 +00:00

Replace need-appearances.pdf

Create a new need-appearances.pdf based on newer test files with more
modified fields.
This commit is contained in:
Jay Berkenbilt 2019-01-03 16:38:43 -05:00
parent e3144ac417
commit 1342612308
5 changed files with 6521 additions and 4090 deletions

View File

@ -1473,11 +1473,19 @@ $td->notify("--- Flatten Form/Annotations ---");
# form-filled-by-acrobat was filled in using the Acrobat Reader # form-filled-by-acrobat was filled in using the Acrobat Reader
# android app. One of its appearance streams is actually an image. # android app. One of its appearance streams is actually an image.
# #
# need-appearances is based on sample-form with manual edits to # need-appearances.pdf is based on field-types.pdf with manual edits
# turn on NeedAppearances, change /V for a field, and add the comment # to turn on NeedAppearances, change /V for several fields, and add
# annotation from comment-annotation.pdf. The test output includes a # the comment annotation from comment-annotation.pdf. The test output
# flattened version of the comment annotation but not of the form # includes a flattened version of the comment annotation but not of
# fields. # the form fields. Changes:
# - field-types.pdf has /NeedAppearances true
# - text1: blank -> abc
# - r1: 1 -> 2
# - list1: blank -> five
# - combolist1: blank -> pi
# - drop1: blank -> elephant
# - combodrop1: blank -> delta
my @annotation_files = ( my @annotation_files = (
'manual-appearances', 'manual-appearances',
'form-filled-by-acrobat', 'form-filled-by-acrobat',

View File

@ -2,455 +2,384 @@
"acroform": { "acroform": {
"fields": [ "fields": [
{ {
"alternativename": "First name", "alternativename": "text",
"annotation": { "annotation": {
"annotationflags": 4, "annotationflags": 4,
"appearancestate": "", "appearancestate": "",
"object": "5 0 R" "object": "4 0 R"
}, },
"choices": [], "choices": [],
"defaultvalue": "", "defaultvalue": "",
"fieldflags": 0, "fieldflags": 0,
"fieldtype": "/Tx", "fieldtype": "/Tx",
"fullname": "Given Name Text Box", "fullname": "text",
"ischeckbox": false, "ischeckbox": false,
"ischoice": false, "ischoice": false,
"isradiobutton": false, "isradiobutton": false,
"istext": true, "istext": true,
"mappingname": "First name", "mappingname": "text",
"object": "5 0 R", "object": "4 0 R",
"pageposfrom1": 1, "pageposfrom1": 1,
"parent": null, "parent": null,
"partialname": "Given Name Text Box", "partialname": "text",
"quadding": 0, "quadding": 0,
"value": "ABC mod" "value": "abc"
}, },
{ {
"alternativename": "Last name", "alternativename": "r1",
"annotation": { "annotation": {
"annotationflags": 4, "annotationflags": 4,
"appearancestate": "", "appearancestate": "/1",
"object": "21 0 R"
},
"choices": [],
"defaultvalue": "/1",
"fieldflags": 49152,
"fieldtype": "/Btn",
"fullname": "r1",
"ischeckbox": false,
"ischoice": false,
"isradiobutton": true,
"istext": false,
"mappingname": "r1",
"object": "21 0 R",
"pageposfrom1": 1,
"parent": "5 0 R",
"partialname": "",
"quadding": 0,
"value": "/2"
},
{
"alternativename": "r1",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Off",
"object": "22 0 R"
},
"choices": [],
"defaultvalue": "/1",
"fieldflags": 49152,
"fieldtype": "/Btn",
"fullname": "r1",
"ischeckbox": false,
"ischoice": false,
"isradiobutton": true,
"istext": false,
"mappingname": "r1",
"object": "22 0 R",
"pageposfrom1": 1,
"parent": "5 0 R",
"partialname": "",
"quadding": 0,
"value": "/2"
},
{
"alternativename": "r1",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Off",
"object": "23 0 R"
},
"choices": [],
"defaultvalue": "/1",
"fieldflags": 49152,
"fieldtype": "/Btn",
"fullname": "r1",
"ischeckbox": false,
"ischoice": false,
"isradiobutton": true,
"istext": false,
"mappingname": "r1",
"object": "23 0 R",
"pageposfrom1": 1,
"parent": "5 0 R",
"partialname": "",
"quadding": 0,
"value": "/2"
},
{
"alternativename": "checkbox1",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Off",
"object": "6 0 R" "object": "6 0 R"
}, },
"choices": [], "choices": [],
"defaultvalue": "", "defaultvalue": "/Off",
"fieldflags": 0, "fieldflags": 0,
"fieldtype": "/Tx", "fieldtype": "/Btn",
"fullname": "Family Name Text Box", "fullname": "checkbox1",
"ischeckbox": false, "ischeckbox": true,
"ischoice": false, "ischoice": false,
"isradiobutton": false, "isradiobutton": false,
"istext": true, "istext": false,
"mappingname": "Last name", "mappingname": "checkbox1",
"object": "6 0 R", "object": "6 0 R",
"pageposfrom1": 1, "pageposfrom1": 1,
"parent": null, "parent": null,
"partialname": "Family Name Text Box", "partialname": "checkbox1",
"quadding": 0, "quadding": 0,
"value": "DEF" "value": "/Off"
}, },
{ {
"alternativename": "Address 1 Text Box", "alternativename": "checkbox2",
"annotation": { "annotation": {
"annotationflags": 4, "annotationflags": 4,
"appearancestate": "", "appearancestate": "/Yes",
"object": "7 0 R" "object": "7 0 R"
}, },
"choices": [], "choices": [],
"defaultvalue": "", "defaultvalue": "/Yes",
"fieldflags": 0, "fieldflags": 0,
"fieldtype": "/Tx", "fieldtype": "/Btn",
"fullname": "Address 1 Text Box", "fullname": "checkbox2",
"ischeckbox": false, "ischeckbox": true,
"ischoice": false, "ischoice": false,
"isradiobutton": false, "isradiobutton": false,
"istext": true, "istext": false,
"mappingname": "Address 1 Text Box", "mappingname": "checkbox2",
"object": "7 0 R", "object": "7 0 R",
"pageposfrom1": 1, "pageposfrom1": 1,
"parent": null, "parent": null,
"partialname": "Address 1 Text Box", "partialname": "checkbox2",
"quadding": 0, "quadding": 0,
"value": "" "value": "/Yes"
}, },
{ {
"alternativename": "House and floor", "alternativename": "checkbox3",
"annotation": { "annotation": {
"annotationflags": 4, "annotationflags": 4,
"appearancestate": "", "appearancestate": "/Off",
"object": "8 0 R" "object": "8 0 R"
}, },
"choices": [], "choices": [],
"defaultvalue": "", "defaultvalue": "/Off",
"fieldflags": 0, "fieldflags": 0,
"fieldtype": "/Tx", "fieldtype": "/Btn",
"fullname": "House nr Text Box", "fullname": "checkbox3",
"ischeckbox": false, "ischeckbox": true,
"ischoice": false, "ischoice": false,
"isradiobutton": false, "isradiobutton": false,
"istext": true, "istext": false,
"mappingname": "House and floor", "mappingname": "checkbox3",
"object": "8 0 R", "object": "8 0 R",
"pageposfrom1": 1, "pageposfrom1": 1,
"parent": null, "parent": null,
"partialname": "House nr Text Box", "partialname": "checkbox3",
"quadding": 0, "quadding": 0,
"value": "" "value": "/Off"
}, },
{ {
"alternativename": "Address 2 Text Box", "alternativename": "r2",
"annotation": { "annotation": {
"annotationflags": 4, "annotationflags": 4,
"appearancestate": "", "appearancestate": "/Off",
"object": "9 0 R" "object": "37 0 R"
}, },
"choices": [], "choices": [],
"defaultvalue": "", "defaultvalue": "/2",
"fieldflags": 0, "fieldflags": 49152,
"fieldtype": "/Tx", "fieldtype": "/Btn",
"fullname": "Address 2 Text Box", "fullname": "r2",
"ischeckbox": false, "ischeckbox": false,
"ischoice": false, "ischoice": false,
"isradiobutton": false, "isradiobutton": true,
"istext": true, "istext": false,
"mappingname": "Address 2 Text Box", "mappingname": "r2",
"object": "9 0 R", "object": "37 0 R",
"pageposfrom1": 1, "pageposfrom1": 1,
"parent": null, "parent": "9 0 R",
"partialname": "Address 2 Text Box", "partialname": "",
"quadding": 0, "quadding": 0,
"value": "" "value": "/2"
}, },
{ {
"alternativename": "Postcode Text Box", "alternativename": "r2",
"annotation": {
"annotationflags": 4,
"appearancestate": "/2",
"object": "38 0 R"
},
"choices": [],
"defaultvalue": "/2",
"fieldflags": 49152,
"fieldtype": "/Btn",
"fullname": "r2",
"ischeckbox": false,
"ischoice": false,
"isradiobutton": true,
"istext": false,
"mappingname": "r2",
"object": "38 0 R",
"pageposfrom1": 1,
"parent": "9 0 R",
"partialname": "",
"quadding": 0,
"value": "/2"
},
{
"alternativename": "r2",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Off",
"object": "39 0 R"
},
"choices": [],
"defaultvalue": "/2",
"fieldflags": 49152,
"fieldtype": "/Btn",
"fullname": "r2",
"ischeckbox": false,
"ischoice": false,
"isradiobutton": true,
"istext": false,
"mappingname": "r2",
"object": "39 0 R",
"pageposfrom1": 1,
"parent": "9 0 R",
"partialname": "",
"quadding": 0,
"value": "/2"
},
{
"alternativename": "text2",
"annotation": { "annotation": {
"annotationflags": 4, "annotationflags": 4,
"appearancestate": "", "appearancestate": "",
"object": "10 0 R" "object": "10 0 R"
}, },
"choices": [], "choices": [],
"defaultvalue": "", "defaultvalue": "salad πʬ",
"fieldflags": 0, "fieldflags": 0,
"fieldtype": "/Tx", "fieldtype": "/Tx",
"fullname": "Postcode Text Box", "fullname": "text2",
"ischeckbox": false, "ischeckbox": false,
"ischoice": false, "ischoice": false,
"isradiobutton": false, "isradiobutton": false,
"istext": true, "istext": true,
"mappingname": "Postcode Text Box", "mappingname": "text2",
"object": "10 0 R", "object": "10 0 R",
"pageposfrom1": 1, "pageposfrom1": 1,
"parent": null, "parent": null,
"partialname": "Postcode Text Box", "partialname": "text2",
"quadding": 0, "quadding": 0,
"value": "" "value": "salad πʬ"
}, },
{ {
"alternativename": "City Text Box", "alternativename": "combolist1",
"annotation": {
"annotationflags": 4,
"appearancestate": "",
"object": "11 0 R"
},
"choices": [],
"defaultvalue": "",
"fieldflags": 0,
"fieldtype": "/Tx",
"fullname": "City Text Box",
"ischeckbox": false,
"ischoice": false,
"isradiobutton": false,
"istext": true,
"mappingname": "City Text Box",
"object": "11 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "City Text Box",
"quadding": 0,
"value": ""
},
{
"alternativename": "Use selection or write country name",
"annotation": {
"annotationflags": 4,
"appearancestate": "",
"object": "12 0 R"
},
"choices": [
"Austria",
"Belgium",
"Britain",
"Bulgaria",
"Croatia",
"Cyprus",
"Czech-Republic",
"Denmark",
"Estonia",
"Finland",
"France",
"Germany",
"Greece",
"Hungary",
"Ireland",
"Italy",
"Latvia",
"Lithuania",
"Luxembourg",
"Malta",
"Netherlands",
"Poland",
"Portugal",
"Romania",
"Slovakia",
"Slovenia",
"Spain",
"Sweden"
],
"defaultvalue": "",
"fieldflags": 393216,
"fieldtype": "/Ch",
"fullname": "Country Combo Box",
"ischeckbox": false,
"ischoice": true,
"isradiobutton": false,
"istext": false,
"mappingname": "Use selection or write country name",
"object": "12 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "Country Combo Box",
"quadding": 0,
"value": ""
},
{
"alternativename": "Select from list",
"annotation": { "annotation": {
"annotationflags": 4, "annotationflags": 4,
"appearancestate": "", "appearancestate": "",
"object": "13 0 R" "object": "13 0 R"
}, },
"choices": [ "choices": [
"Man", "one",
"Woman" "two",
"pi",
"four"
], ],
"defaultvalue": "Man", "defaultvalue": "",
"fieldflags": 131072, "fieldflags": 393216,
"fieldtype": "/Ch", "fieldtype": "/Ch",
"fullname": "Gender List Box", "fullname": "combolist1",
"ischeckbox": false, "ischeckbox": false,
"ischoice": true, "ischoice": true,
"isradiobutton": false, "isradiobutton": false,
"istext": false, "istext": false,
"mappingname": "Select from list", "mappingname": "combolist1",
"object": "13 0 R", "object": "13 0 R",
"pageposfrom1": 1, "pageposfrom1": 1,
"parent": null, "parent": null,
"partialname": "Gender List Box", "partialname": "combolist1",
"quadding": 0, "quadding": 0,
"value": "Man" "value": "pi"
}, },
{ {
"alternativename": "Value from 40 to 250 cm", "alternativename": "list1",
"annotation": {
"annotationflags": 4,
"appearancestate": "",
"object": "11 0 R"
},
"choices": [
"five",
"six",
"seven",
"eight"
],
"defaultvalue": "",
"fieldflags": 0,
"fieldtype": "/Ch",
"fullname": "list1",
"ischeckbox": false,
"ischoice": true,
"isradiobutton": false,
"istext": false,
"mappingname": "list1",
"object": "11 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "list1",
"quadding": 0,
"value": "five"
},
{
"alternativename": "drop1",
"annotation": {
"annotationflags": 4,
"appearancestate": "",
"object": "12 0 R"
},
"choices": [
"nine",
"ten",
"elephant",
"twelve"
],
"defaultvalue": "",
"fieldflags": 131072,
"fieldtype": "/Ch",
"fullname": "drop1",
"ischeckbox": false,
"ischoice": true,
"isradiobutton": false,
"istext": false,
"mappingname": "drop1",
"object": "12 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "drop1",
"quadding": 0,
"value": "elephant"
},
{
"alternativename": "combodrop1",
"annotation": { "annotation": {
"annotationflags": 4, "annotationflags": 4,
"appearancestate": "", "appearancestate": "",
"object": "14 0 R" "object": "14 0 R"
}, },
"choices": [],
"defaultvalue": "150",
"fieldflags": 0,
"fieldtype": "/Tx",
"fullname": "Height Formatted Field",
"ischeckbox": false,
"ischoice": false,
"isradiobutton": false,
"istext": true,
"mappingname": "Value from 40 to 250 cm",
"object": "14 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "Height Formatted Field",
"quadding": 0,
"value": ""
},
{
"alternativename": "Car driving license",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Yes",
"object": "15 0 R"
},
"choices": [],
"defaultvalue": "/Off",
"fieldflags": 0,
"fieldtype": "/Btn",
"fullname": "Driving License Check Box",
"ischeckbox": true,
"ischoice": false,
"isradiobutton": false,
"istext": false,
"mappingname": "Car driving license",
"object": "15 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "Driving License Check Box",
"quadding": 0,
"value": "/Yes"
},
{
"alternativename": "Language 1 Check Box",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Off",
"object": "16 0 R"
},
"choices": [],
"defaultvalue": "/Off",
"fieldflags": 0,
"fieldtype": "/Btn",
"fullname": "Language 1 Check Box",
"ischeckbox": true,
"ischoice": false,
"isradiobutton": false,
"istext": false,
"mappingname": "Language 1 Check Box",
"object": "16 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "Language 1 Check Box",
"quadding": 0,
"value": "/Off"
},
{
"alternativename": "Language 2 Check Box",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Yes",
"object": "17 0 R"
},
"choices": [],
"defaultvalue": "/Yes",
"fieldflags": 0,
"fieldtype": "/Btn",
"fullname": "Language 2 Check Box",
"ischeckbox": true,
"ischoice": false,
"isradiobutton": false,
"istext": false,
"mappingname": "Language 2 Check Box",
"object": "17 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "Language 2 Check Box",
"quadding": 0,
"value": "/Yes"
},
{
"alternativename": "Language 3 Check Box",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Off",
"object": "18 0 R"
},
"choices": [],
"defaultvalue": "/Off",
"fieldflags": 0,
"fieldtype": "/Btn",
"fullname": "Language 3 Check Box",
"ischeckbox": true,
"ischoice": false,
"isradiobutton": false,
"istext": false,
"mappingname": "Language 3 Check Box",
"object": "18 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "Language 3 Check Box",
"quadding": 0,
"value": "/Off"
},
{
"alternativename": "Language 4 Check Box",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Off",
"object": "19 0 R"
},
"choices": [],
"defaultvalue": "/Off",
"fieldflags": 0,
"fieldtype": "/Btn",
"fullname": "Language 4 Check Box",
"ischeckbox": true,
"ischoice": false,
"isradiobutton": false,
"istext": false,
"mappingname": "Language 4 Check Box",
"object": "19 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "Language 4 Check Box",
"quadding": 0,
"value": "/Off"
},
{
"alternativename": "Language 5 Check Box",
"annotation": {
"annotationflags": 4,
"appearancestate": "/Off",
"object": "20 0 R"
},
"choices": [],
"defaultvalue": "/Off",
"fieldflags": 0,
"fieldtype": "/Btn",
"fullname": "Language 5 Check Box",
"ischeckbox": true,
"ischoice": false,
"isradiobutton": false,
"istext": false,
"mappingname": "Language 5 Check Box",
"object": "20 0 R",
"pageposfrom1": 1,
"parent": null,
"partialname": "Language 5 Check Box",
"quadding": 0,
"value": "/Off"
},
{
"alternativename": "Select from colour spectrum",
"annotation": {
"annotationflags": 4,
"appearancestate": "",
"object": "21 0 R"
},
"choices": [ "choices": [
"Black", "alpha",
"Brown", "beta",
"Red", "gamma",
"Orange", "delta"
"Yellow",
"Green",
"Blue",
"Violet",
"Grey",
"White"
], ],
"defaultvalue": "Red", "defaultvalue": "",
"fieldflags": 131072, "fieldflags": 393216,
"fieldtype": "/Ch", "fieldtype": "/Ch",
"fullname": "Favourite Colour List Box", "fullname": "combodrop1",
"ischeckbox": false, "ischeckbox": false,
"ischoice": true, "ischoice": true,
"isradiobutton": false, "isradiobutton": false,
"istext": false, "istext": false,
"mappingname": "Select from colour spectrum", "mappingname": "combodrop1",
"object": "21 0 R", "object": "14 0 R",
"pageposfrom1": 1, "pageposfrom1": 1,
"parent": null, "parent": null,
"partialname": "Favourite Colour List Box", "partialname": "combodrop1",
"quadding": 0, "quadding": 0,
"value": "Blue" "value": "delta"
} }
], ],
"hasacroform": true, "hasacroform": true,

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,2 @@
WARNING: need-appearances.pdf object stream 1, object 2 0 at offset 438: document does not have updated appearance streams, so form fields will not be flattened WARNING: need-appearances.pdf, object 1 0 at offset 50: document does not have updated appearance streams, so form fields will not be flattened
qpdf: operation succeeded with warnings; resulting file may have some problems qpdf: operation succeeded with warnings; resulting file may have some problems

File diff suppressed because it is too large Load Diff