Skip to content

Commit c52c00c

Browse files
committed
PDFBOX-6131: add test case for "Seq ..." and "Bag ..."
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930880 13f79535-47bb-0310-9956-ffa450edef68
1 parent b40cbef commit c52c00c

File tree

2 files changed

+228
-0
lines changed

2 files changed

+228
-0
lines changed

xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,4 +1447,18 @@ void testWrongType() throws XmpParsingException
14471447
// non existant properties are treated as text, one might want to change this in the future.
14481448
assertEquals("[headline=TextType:]", photoshopSchema.getProperty("headline").toString());
14491449
}
1450+
1451+
@Test
1452+
void testPDFBox6131_2() throws IOException, XmpParsingException, BadFieldValueException
1453+
{
1454+
// Contains "Seq Text" instead of "seq Text" and "Bag Text" instead of "bag Text"
1455+
// from file RMR6DEEUWZO6IM3A7WKRPX33SZMBTTQZ
1456+
// Fairfax County Office of Community Revitalization
1457+
try (InputStream is = DomXmpParser.class.getResourceAsStream("/org/apache/xmpbox/xml/PDFBOX-6131-RMR6DEEUWZO6IM3A7WKRPX33SZMBTTQZ.xml"))
1458+
{
1459+
DomXmpParser xmpParser = new DomXmpParser();
1460+
XMPMetadata xmp = xmpParser.parse(is);
1461+
assertEquals(1, xmp.getPDFAIdentificationSchema().getPart());
1462+
}
1463+
}
14501464
}
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
2+
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.4-c005 78.147326, 2012/08/23-13:03:03 ">
3+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4+
<rdf:Description rdf:about=""
5+
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
6+
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
7+
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
8+
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
9+
xmlns:dc="http://purl.org/dc/elements/1.1/"
10+
xmlns:pdf="http://ns.adobe.com/pdf/1.3/"
11+
xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/"
12+
xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"
13+
xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#"
14+
xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#"
15+
xmlns:pdfaType="http://www.aiim.org/pdfa/ns/type#">
16+
<xmp:CreateDate>2018-08-20T11:45:47-04:00</xmp:CreateDate>
17+
<xmp:CreatorTool>Adobe InDesign CS6 (Windows)</xmp:CreatorTool>
18+
<xmp:ModifyDate>2018-08-21T11:31:57-04:00</xmp:ModifyDate>
19+
<xmp:MetadataDate>2018-08-21T11:31:57-04:00</xmp:MetadataDate>
20+
<xmpMM:InstanceID>uuid:1a2539c6-3bdb-4b04-b610-c173cf00ba20</xmpMM:InstanceID>
21+
<xmpMM:OriginalDocumentID>xmp.did:9C5C3DDF4670E611A317E9DADFEEA537</xmpMM:OriginalDocumentID>
22+
<xmpMM:DocumentID>xmp.id:9776551B90A4E811B442A672B361405C</xmpMM:DocumentID>
23+
<xmpMM:RenditionClass>proof:pdf</xmpMM:RenditionClass>
24+
<xmpMM:VersionID>1</xmpMM:VersionID>
25+
<xmpMM:DerivedFrom rdf:parseType="Resource">
26+
<stRef:instanceID>xmp.iid:A068E61B2F9FE811B200FB60011BADCF</stRef:instanceID>
27+
<stRef:documentID>xmp.did:689889CA0465E81193A9AB2BA9DD46BB</stRef:documentID>
28+
<stRef:renditionClass>default</stRef:renditionClass>
29+
</xmpMM:DerivedFrom>
30+
<xmpMM:History>
31+
<rdf:Seq>
32+
<rdf:li rdf:parseType="Resource">
33+
<stEvt:action>converted</stEvt:action>
34+
<stEvt:parameters>from application/x-indesign to application/pdf</stEvt:parameters>
35+
<stEvt:softwareAgent>Adobe InDesign CS6 (Windows)</stEvt:softwareAgent>
36+
<stEvt:when>2018-08-20T11:45:47-04:00</stEvt:when>
37+
</rdf:li>
38+
<rdf:li rdf:parseType="Resource">
39+
<stEvt:action>converted</stEvt:action>
40+
<stEvt:instanceID>uuid:34585cb1-a12c-4961-a53a-628153fa0513</stEvt:instanceID>
41+
<stEvt:parameters>converted to PDF/A-1a</stEvt:parameters>
42+
<stEvt:softwareAgent>pdfEngine</stEvt:softwareAgent>
43+
<stEvt:when>2018-08-20T12:56:47-04:00</stEvt:when>
44+
</rdf:li>
45+
</rdf:Seq>
46+
</xmpMM:History>
47+
<dc:format>application/pdf</dc:format>
48+
<dc:title>
49+
<rdf:Alt>
50+
<rdf:li xml:lang="x-default">Summary of Guidelines for Development in Reston TSAs</rdf:li>
51+
</rdf:Alt>
52+
</dc:title>
53+
<dc:description>
54+
<rdf:Alt>
55+
<rdf:li xml:lang="x-default"/>
56+
</rdf:Alt>
57+
</dc:description>
58+
<dc:subject>
59+
<rdf:Bag/>
60+
</dc:subject>
61+
<dc:creator>
62+
<rdf:Seq>
63+
<rdf:li/>
64+
</rdf:Seq>
65+
</dc:creator>
66+
<pdf:Producer>Adobe PDF Library 10.0.1</pdf:Producer>
67+
<pdf:Trapped>False</pdf:Trapped>
68+
<pdf:Keywords/>
69+
<pdfaid:part>1</pdfaid:part>
70+
<pdfaid:conformance>A</pdfaid:conformance>
71+
<pdfaExtension:schemas>
72+
<rdf:Bag>
73+
<rdf:li rdf:parseType="Resource">
74+
<pdfaSchema:namespaceURI>http://ns.adobe.com/xap/1.0/mm/</pdfaSchema:namespaceURI>
75+
<pdfaSchema:prefix>xmpMM</pdfaSchema:prefix>
76+
<pdfaSchema:schema>XMP Media Management</pdfaSchema:schema>
77+
<pdfaSchema:property>
78+
<rdf:Seq>
79+
<rdf:li rdf:parseType="Resource">
80+
<pdfaProperty:category>internal</pdfaProperty:category>
81+
<pdfaProperty:description>UUID based identifier for specific incarnation of a document</pdfaProperty:description>
82+
<pdfaProperty:name>InstanceID</pdfaProperty:name>
83+
<pdfaProperty:valueType>URI</pdfaProperty:valueType>
84+
</rdf:li>
85+
<rdf:li rdf:parseType="Resource">
86+
<pdfaProperty:category>internal</pdfaProperty:category>
87+
<pdfaProperty:description>The common identifier for all versions and renditions of a document.</pdfaProperty:description>
88+
<pdfaProperty:name>OriginalDocumentID</pdfaProperty:name>
89+
<pdfaProperty:valueType>URI</pdfaProperty:valueType>
90+
</rdf:li>
91+
<rdf:li rdf:parseType="Resource">
92+
<pdfaProperty:category>internal</pdfaProperty:category>
93+
<pdfaProperty:description>A reference to the original document from which this one is derived. It is a minimal reference; missing components can be assumed to be unchanged. For example, a new version might only need to specify the instance ID and version number of the previous version, or a rendition might only need to specify the instance ID and rendition class of the original.</pdfaProperty:description>
94+
<pdfaProperty:name>DerivedFrom</pdfaProperty:name>
95+
<pdfaProperty:valueType>ResourceRef</pdfaProperty:valueType>
96+
</rdf:li>
97+
</rdf:Seq>
98+
</pdfaSchema:property>
99+
<pdfaSchema:valueType>
100+
<rdf:Seq>
101+
<rdf:li rdf:parseType="Resource">
102+
<pdfaType:description>Identifies a portion of a document. This can be a position at which the document has been changed since the most recent event history (stEvt:changed). For a resource within an xmpMM:Ingredients list, the ResourceRef uses this type to identify both the portion of the containing document that refers to the resource, and the portion of the referenced resource that is referenced.</pdfaType:description>
103+
<pdfaType:namespaceURI>http://ns.adobe.com/xap/1.0/sType/Part#</pdfaType:namespaceURI>
104+
<pdfaType:prefix>stPart</pdfaType:prefix>
105+
<pdfaType:type>Part</pdfaType:type>
106+
</rdf:li>
107+
</rdf:Seq>
108+
</pdfaSchema:valueType>
109+
</rdf:li>
110+
<rdf:li rdf:parseType="Resource">
111+
<pdfaSchema:namespaceURI>http://ns.adobe.com/exif/1.0/</pdfaSchema:namespaceURI>
112+
<pdfaSchema:prefix>exif</pdfaSchema:prefix>
113+
<pdfaSchema:schema>EXIF for EXIF-specific Properties</pdfaSchema:schema>
114+
<pdfaSchema:property>
115+
<rdf:Seq>
116+
<rdf:li rdf:parseType="Resource">
117+
<pdfaProperty:category>internal</pdfaProperty:category>
118+
<pdfaProperty:description>EXIF tag 37121, 0x9101. Configuration of components in data: 4 5 6 0 (if RGB compressed data), 1 2 3 0 (other cases). 0 = does not exist; 1 = Y; 2 = Cb; 3 = Cr; 4 = R; 5 = G; 6 = B</pdfaProperty:description>
119+
<pdfaProperty:name>ComponentsConfiguration</pdfaProperty:name>
120+
<pdfaProperty:valueType>Seq Integer</pdfaProperty:valueType>
121+
</rdf:li>
122+
</rdf:Seq>
123+
</pdfaSchema:property>
124+
</rdf:li>
125+
<rdf:li rdf:parseType="Resource">
126+
<pdfaSchema:namespaceURI>http://ns.adobe.com/exif/1.0/aux/</pdfaSchema:namespaceURI>
127+
<pdfaSchema:prefix>aux</pdfaSchema:prefix>
128+
<pdfaSchema:schema>EXIF schema for additional EXIF properties</pdfaSchema:schema>
129+
<pdfaSchema:property>
130+
<rdf:Seq>
131+
<rdf:li rdf:parseType="Resource">
132+
<pdfaProperty:category>internal</pdfaProperty:category>
133+
<pdfaProperty:description>A description of the lens used to take the photograph. For example, "70-200 mm f/2.8-4.0".</pdfaProperty:description>
134+
<pdfaProperty:name>Lens</pdfaProperty:name>
135+
<pdfaProperty:valueType>Bag Text</pdfaProperty:valueType>
136+
</rdf:li>
137+
<rdf:li rdf:parseType="Resource">
138+
<pdfaProperty:category>internal</pdfaProperty:category>
139+
<pdfaProperty:description>The serial number of the camera or camera body used to take the photograph.</pdfaProperty:description>
140+
<pdfaProperty:name>SerialNumber</pdfaProperty:name>
141+
<pdfaProperty:valueType>Bag Text</pdfaProperty:valueType>
142+
</rdf:li>
143+
</rdf:Seq>
144+
</pdfaSchema:property>
145+
</rdf:li>
146+
<rdf:li rdf:parseType="Resource">
147+
<pdfaSchema:namespaceURI>http://ns.adobe.com/pdf/1.3/</pdfaSchema:namespaceURI>
148+
<pdfaSchema:prefix>pdf</pdfaSchema:prefix>
149+
<pdfaSchema:schema>Adobe PDF</pdfaSchema:schema>
150+
<pdfaSchema:property>
151+
<rdf:Seq>
152+
<rdf:li rdf:parseType="Resource">
153+
<pdfaProperty:category>internal</pdfaProperty:category>
154+
<pdfaProperty:description>A name object indicating whether the document has been modified to include trapping information</pdfaProperty:description>
155+
<pdfaProperty:name>Trapped</pdfaProperty:name>
156+
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
157+
</rdf:li>
158+
</rdf:Seq>
159+
</pdfaSchema:property>
160+
</rdf:li>
161+
<rdf:li rdf:parseType="Resource">
162+
<pdfaSchema:namespaceURI>http://www.aiim.org/pdfa/ns/id/</pdfaSchema:namespaceURI>
163+
<pdfaSchema:prefix>pdfaid</pdfaSchema:prefix>
164+
<pdfaSchema:schema>PDF/A ID Schema</pdfaSchema:schema>
165+
<pdfaSchema:property>
166+
<rdf:Seq>
167+
<rdf:li rdf:parseType="Resource">
168+
<pdfaProperty:category>internal</pdfaProperty:category>
169+
<pdfaProperty:description>Part of PDF/A standard</pdfaProperty:description>
170+
<pdfaProperty:name>part</pdfaProperty:name>
171+
<pdfaProperty:valueType>Integer</pdfaProperty:valueType>
172+
</rdf:li>
173+
<rdf:li rdf:parseType="Resource">
174+
<pdfaProperty:category>internal</pdfaProperty:category>
175+
<pdfaProperty:description>Amendment of PDF/A standard</pdfaProperty:description>
176+
<pdfaProperty:name>amd</pdfaProperty:name>
177+
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
178+
</rdf:li>
179+
<rdf:li rdf:parseType="Resource">
180+
<pdfaProperty:category>internal</pdfaProperty:category>
181+
<pdfaProperty:description>Conformance level of PDF/A standard</pdfaProperty:description>
182+
<pdfaProperty:name>conformance</pdfaProperty:name>
183+
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
184+
</rdf:li>
185+
</rdf:Seq>
186+
</pdfaSchema:property>
187+
</rdf:li>
188+
</rdf:Bag>
189+
</pdfaExtension:schemas>
190+
</rdf:Description>
191+
</rdf:RDF>
192+
</x:xmpmeta>
193+
194+
195+
196+
197+
198+
199+
200+
201+
202+
203+
204+
205+
206+
207+
208+
209+
210+
211+
212+
213+
214+
<?xpacket end="w"?>

0 commit comments

Comments
 (0)