You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Jochen Staerk <js...@usegroup.de> on 2014/04/09 13:47:39 UTC

Re: how to add pdfa extension schemas?/Jempbox vs XMPbox

Hi,

1) thanks
2) This seems to use xmpbox, I did not know there were two XMPMetadata
at all (org.apache.xmpbox.XMPMetadata and
org.apache.jempbox.xmp.XMPMetadata) and so far I used jempbox.

I read from
http://mail-archives.apache.org/mod_mbox/pdfbox-dev/201308.mbox/%3CJIRA.12534142.1323239234412.56576.1377812391819@arcas%3E
that jempbox seems to be deprecated and I should rather use XMPbox.

But somehow I can't find any clue how this should be done, more
precisely, how to  write xmpbox metadata to the document?

I so far use the jempbox way(?)

	PDDocumentCatalog cat = doc.getDocumentCatalog();
	PDMetadata metadata = new PDMetadata(doc);
	metadata.importXMPMetadata(xmp);

but importXMPMetadata does not seem to accept a XMPbox metadata, neither
can I cast it or see any way to convert.

Please advise,
thanks and kind regards,
Jochen

Am 09.04.2014 10:45, schrieb Maruan Sahyoun:
> Hi,
> 
> PDFAExtensionSchema is meant as a start for PDF/A-1 Extension Schema Container Schema.
> 
> BR 
> Maruan Sahyoun
> 
> Am 09.04.2014 um 10:20 schrieb Jochen Staerk <js...@usegroup.de>:
> 
> Hi,
> 
> I am trying to support a standard which adds information in the RDF
> metadata. This can relatively easily be implemented by subclassing
> XMPBasicSchema.
> 
> Now the standard is PDF/A3 based and therefore I have to describe the
> changed (as defined in 6.6.2.3.2 of the PDF/A standard) using
> PDFA3-Extension Schema which is hard:
> 
> So I have to add the following structure:
> +--bag
>   +--rdf:li
>      +--some text node (multiple)
>      +--property node
>         +--rdf:Seq
>            +--rdf:li (multiple) attribute node
>               +--some text node (multiple)
> 
> Which base class should I use? Which functions can I use? I tried
> XMPSchemaBasic again but this time I need
> not only sequences with attributes (which would work because
> addSequenceValue accepts "Elementable") but I need a bag with a
> sequences with attributes and addBagValue seems to support only String?
> 
> This is an example of a pdfa Extension schema:
> 
> 
> <rdf:Description rdf:about=""
>            xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"
>            xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#"
>            xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#">
>         <pdfaExtension:schemas>
>            <rdf:Bag>
>               <rdf:li rdf:parseType="Resource">
>                  <pdfaSchema:schema> Schema name</pdfaSchema:schema>
> 
> <pdfaSchema:namespaceURI>urn:xxxx:pdfa:xxxxx:yy#</pdfaSchema:namespaceURI>
>                  <pdfaSchema:prefix>xy</pdfaSchema:prefix>
>                  <pdfaSchema:property>
>                     <rdf:Seq>
>                        <rdf:li rdf:parseType="Resource">
> 
> <pdfaProperty:name>AttributeName</pdfaProperty:name>
> 
> <pdfaProperty:valueType>Text</pdfaProperty:valueType>
> 
> <pdfaProperty:category>external</pdfaProperty:category>
>                           <pdfaProperty:description>description of
> name</pdfaProperty:description>
>                        </rdf:li>
>                        <rdf:li rdf:parseType="Resource">
>                           <pdfaProperty:name>Type</pdfaProperty:name>
> 
> <pdfaProperty:valueType>Text</pdfaProperty:valueType>
> 
> <pdfaProperty:category>external</pdfaProperty:category>
> 
> <pdfaProperty:description>sometype</pdfaProperty:description>
>                        </rdf:li>
>                     </rdf:Seq>
>                  </pdfaSchema:property>
>               </rdf:li>
>            </rdf:Bag>
>         </pdfaExtension:schemas>
> 
> 
> Thanks and kind regards
> Jochen
> 

-- 
mit freundlichen Grüßen
Jochen Stärk

www.usegroup.de      (home office)
Albigerstr. 22       Huswertstraße 14
55232 Alzey          60435 Frankfurt
Tel: (069)569940-20  Fax: (069)569940-19
Mobil: (0177)4512645

How to write XMPbox XMPMetadata?

Posted by Jochen Staerk <js...@usegroup.de>.
Hi,

I can create jempbox XMPMetadata for my PDDocument doc using

	PDDocumentCatalog cat = doc.getDocumentCatalog();
	PDMetadata metadata = new PDMetadata(doc);
	org.apache.jempbox.xmp.XMPMetadata xmp=new
org.apache.jempbox.xmp.XMPMetadata()
	metadata.importXMPMetadata(xmp);

and apparently I'm supposed to create xmpbox XMPMetadata using a
factory (	org.apache.xmpbox.XMPMetadata
xmpMeta=XMPMetadata.createXMPMetadata() ;
		PDFAExtensionSchema
pdfaext=xmpMeta.createAndAddPDFAExtensionSchemaWithDefaultNS();).

Now: how can I write the xmpbox.XMPMetadata into my document, i.e. what
is the equivalent to jempbox' PDMetadata importXMPMetadata(xmp)?


Thanks and kind regards
Jochen

-- 
mit freundlichen Grüßen
Jochen Stärk

www.usegroup.de      (home office)
Albigerstr. 22       Huswertstraße 14
55232 Alzey          60435 Frankfurt
Tel: (069)569940-20  Fax: (069)569940-19
Mobil: (0177)4512645

Re: how to add pdfa extension schemas?/Jempbox vs XMPbox

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi Jochen,

I asked if there is a decision for xmpbox vs. jempbox being made on the developed mailing list. As you found there is no direct way to interchange XMP metadata between both libs although at the end both generate similar XMP metadata.  

BR
Maruan

Am 09.04.2014 um 13:47 schrieb Jochen Staerk <js...@usegroup.de>:

> Hi,
> 
> 1) thanks
> 2) This seems to use xmpbox, I did not know there were two XMPMetadata
> at all (org.apache.xmpbox.XMPMetadata and
> org.apache.jempbox.xmp.XMPMetadata) and so far I used jempbox.
> 
> I read from
> http://mail-archives.apache.org/mod_mbox/pdfbox-dev/201308.mbox/%3CJIRA.12534142.1323239234412.56576.1377812391819@arcas%3E
> that jempbox seems to be deprecated and I should rather use XMPbox.
> 
> But somehow I can't find any clue how this should be done, more
> precisely, how to  write xmpbox metadata to the document?
> 
> I so far use the jempbox way(?)
> 
> 	PDDocumentCatalog cat = doc.getDocumentCatalog();
> 	PDMetadata metadata = new PDMetadata(doc);
> 	metadata.importXMPMetadata(xmp);
> 
> but importXMPMetadata does not seem to accept a XMPbox metadata, neither
> can I cast it or see any way to convert.
> 
> Please advise,
> thanks and kind regards,
> Jochen
> 
> Am 09.04.2014 10:45, schrieb Maruan Sahyoun:
>> Hi,
>> 
>> PDFAExtensionSchema is meant as a start for PDF/A-1 Extension Schema Container Schema.
>> 
>> BR 
>> Maruan Sahyoun
>> 
>> Am 09.04.2014 um 10:20 schrieb Jochen Staerk <js...@usegroup.de>:
>> 
>> Hi,
>> 
>> I am trying to support a standard which adds information in the RDF
>> metadata. This can relatively easily be implemented by subclassing
>> XMPBasicSchema.
>> 
>> Now the standard is PDF/A3 based and therefore I have to describe the
>> changed (as defined in 6.6.2.3.2 of the PDF/A standard) using
>> PDFA3-Extension Schema which is hard:
>> 
>> So I have to add the following structure:
>> +--bag
>>  +--rdf:li
>>     +--some text node (multiple)
>>     +--property node
>>        +--rdf:Seq
>>           +--rdf:li (multiple) attribute node
>>              +--some text node (multiple)
>> 
>> Which base class should I use? Which functions can I use? I tried
>> XMPSchemaBasic again but this time I need
>> not only sequences with attributes (which would work because
>> addSequenceValue accepts "Elementable") but I need a bag with a
>> sequences with attributes and addBagValue seems to support only String?
>> 
>> This is an example of a pdfa Extension schema:
>> 
>> 
>> <rdf:Description rdf:about=""
>>           xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"
>>           xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#"
>>           xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#">
>>        <pdfaExtension:schemas>
>>           <rdf:Bag>
>>              <rdf:li rdf:parseType="Resource">
>>                 <pdfaSchema:schema> Schema name</pdfaSchema:schema>
>> 
>> <pdfaSchema:namespaceURI>urn:xxxx:pdfa:xxxxx:yy#</pdfaSchema:namespaceURI>
>>                 <pdfaSchema:prefix>xy</pdfaSchema:prefix>
>>                 <pdfaSchema:property>
>>                    <rdf:Seq>
>>                       <rdf:li rdf:parseType="Resource">
>> 
>> <pdfaProperty:name>AttributeName</pdfaProperty:name>
>> 
>> <pdfaProperty:valueType>Text</pdfaProperty:valueType>
>> 
>> <pdfaProperty:category>external</pdfaProperty:category>
>>                          <pdfaProperty:description>description of
>> name</pdfaProperty:description>
>>                       </rdf:li>
>>                       <rdf:li rdf:parseType="Resource">
>>                          <pdfaProperty:name>Type</pdfaProperty:name>
>> 
>> <pdfaProperty:valueType>Text</pdfaProperty:valueType>
>> 
>> <pdfaProperty:category>external</pdfaProperty:category>
>> 
>> <pdfaProperty:description>sometype</pdfaProperty:description>
>>                       </rdf:li>
>>                    </rdf:Seq>
>>                 </pdfaSchema:property>
>>              </rdf:li>
>>           </rdf:Bag>
>>        </pdfaExtension:schemas>
>> 
>> 
>> Thanks and kind regards
>> Jochen
>> 
> 
> -- 
> mit freundlichen Grüßen
> Jochen Stärk
> 
> www.usegroup.de      (home office)
> Albigerstr. 22       Huswertstraße 14
> 55232 Alzey          60435 Frankfurt
> Tel: (069)569940-20  Fax: (069)569940-19
> Mobil: (0177)4512645