You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Andreas Lehmkuehler <an...@lehmi.de> on 2022/02/01 05:35:31 UTC
Re: How to set PDF/A to an existing PDF
Hi,
Am 31.01.22 um 22:03 schrieb Tommy Wu:
> The following cookbook is not long working for the new version. Do you have
> a way to do it now?
Which version are you referring to?
What exactly doesn't work?
Andreas
>
>
>
> Apache PDFBox | PDF/A Creation
> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
>
>
>
> Thanks
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to set PDF/A to an existing PDF
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Try the source from CreatePDFA.java
http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreatePDFA.java?revision=1824539&view=co
Am 01.02.22 um 21:17 schrieb Tommy Wu:
> I still cannot get it to compile
>
> <dependency>
> <groupId>org.apache.pdfbox</groupId>
> <artifactId>pdfbox</artifactId>
> <version>2.0.25</version>
> </dependency>
>
> <dependency>
> <groupId>org.apache.pdfbox</groupId>
> <artifactId>xmpbox</artifactId>
> <version>2.0.24</version>
> </dependency>
> <dependency>
> <groupId>org.apache.pdfbox</groupId>
> <artifactId>fontbox</artifactId>
> <version>2.0.25</version>
> </dependency>
> // jempbox version
> XMPMetadata xmp = new XMPMetadata();
> XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
> xmp.addSchema(pdfaid);
> pdfaid.setConformance("B");
> pdfaid.setPart(1);
> pdfaid.setAbout("");
> metadata.importXMPMetadata(xmp);
>
> *java: constructor XMPMetadata in class org.apache.xmpbox.XMPMetadata
> cannot be applied to given types;*
> * required: no arguments*
> * found: no arguments*
> * reason: XMPMetadata() has protected access in
> org.apache.xmpbox.XMPMetadata*
>
>
>
>
> *java: cannot find symbol symbol: class XMPSchemaPDFAId location: class
> com.example.pdfboxtest.CreatePDFAjava: cannot find symbol symbol: class
> XMPSchemaPDFAId location: class com.example.pdfboxtest.CreatePDFAjava:
> incompatible types: org.apache.xmpbox.XMPMetadata cannot be converted to
> byte[]*
>
> Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午3:03寫道:
>
>> Use xmpbox, not jempbox.
>>
>> Tilman
>>
>> Am 01.02.2022 um 20:19 schrieb Tommy Wu:
>>> Here's the dependency I used
>>>
>>> <dependency>
>>> <groupId>org.apache.pdfbox</groupId>
>>> <artifactId>pdfbox</artifactId>
>>> <version>2.0.25</version>
>>> </dependency>
>>> <!-- https://mvnrepository.com/artifact/org.apache.pdfbox/jempbox -->
>>> <dependency>
>>> <groupId>org.apache.pdfbox</groupId>
>>> <artifactId>jempbox</artifactId>
>>> <version>1.8.16</version>
>>> </dependency>
>>>
>>>
>>> pdfboxTest\src\main\java\com\example\pdfboxtest\CreatePDFA.java:101:40
>>> java: incompatible types: org.apache.jempbox.xmp.XMPMetadata cannot be
>>> converted to byte[]
>>>
>>> line 40 is
>>>
>>> metadata.importXMPMetadata(xmp);
>>>
>>>
>>> Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午1:56寫道:
>>>
>>>> Then please tell what errors you get, and what libraries you're using
>>>> (hopefully pdfbox, fontbox and xmpbox).
>>>>
>>>> Tilman
>>>>
>>>> Am 01.02.2022 um 19:42 schrieb Tommy Wu:
>>>>> I can't even get it to compile
>>>>>
>>>>> Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二 上午12:35寫道:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Am 31.01.22 um 22:03 schrieb Tommy Wu:
>>>>>>> The following cookbook is not long working for the new version. Do
>> you
>>>>>> have
>>>>>>> a way to do it now?
>>>>>> Which version are you referring to?
>>>>>>
>>>>>> What exactly doesn't work?
>>>>>>
>>>>>> Andreas
>>>>>>>
>>>>>>> Apache PDFBox | PDF/A Creation
>>>>>>> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>>
>>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to set PDF/A to an existing PDF
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 05.02.2022 um 01:13 schrieb Tommy Wu:
> Would you send over the icc file that you were using?
It is in the source code download, in the directory
examples\src\main\resources\org\apache\pdfbox\resources\pdfa
Tilman
>
> Tilman Hausherr <TH...@t-online.de> 於 2022年2月3日週四 下午10:45寫道:
>
>> I've also found out why the file produced with the trunk wasn't OK, this
>> is because my pom.xml had used Apache FOP for some reason.
>>
>> Tilman
>>
>> Am 04.02.2022 um 04:37 schrieb Tilman Hausherr:
>>> Am 04.02.2022 um 01:48 schrieb Tommy Wu:
>>>> Sorry I am bit confused. Do you mean you have a version that is
>>>> working and
>>>> can pass the validation? If so, would you please provide the link to the
>>>> source file?
>>> I used the ordinary 2.0.25 version that you can download at
>>> https://pdfbox.apache.org/download.html
>>>
>>> However it doesn't pass the "validation" at the site you mentioned (
>>> https://www.pdfen.com/pdf-a-validator ) that I have never heard about.
>>> It passes the validation with VeraPDF ( https://verapdf.org/software/
>>> ) and PDF-Tools ( https://www.pdf-online.com/osa/validate.aspx ).
>>>
>>> Tilman
>>>
>>>
>>>
>>>> Tilman Hausherr <TH...@t-online.de> 於 2022年2月3日週四
>>>> 下午1:29寫道:
>>>>
>>>>> I must correct myself. The file created by 2.0 is fine on both services
>>>>> that I mentioned. The problem is only in the trunk, and only in my
>>>>> local
>>>>> version.
>>>>>
>>>>> I never heard about "PDFen". The two other services I mentioned are
>>>>> well
>>>>> known in the industry.
>>>>>
>>>>> (For me:
>>>>>
>>>>> 2.0 xmp:
>>>>> <rdf:li xml:lang="x-default">target/test-output/PDFA.pdf</rdf:li>
>>>>>
>>>>> tilman trunk xmp:
>>>>> <rdf:li lang="x-default">target/test-output/PDFA.pdf</rdf:li> )
>>>>>
>>>>> Tilman
>>>>>
>>>>> Am 03.02.2022 um 11:15 schrieb Tommy Wu:
>>>>>> So how should we address this?
>>>>>>
>>>>>> Tilman Hausherr<TH...@t-online.de> 於 2022年2月2日週三
>>>>>> 下午11:42寫道:
>>>>>>
>>>>>>> OK, now we have a problem. I tried
>>>>>>> https://www.pdf-online.com/osa/validate.aspx
>>>>>>>
>>>>>>> Validating file "PDFA.pdf" for conformance level pdfa-1b
>>>>>>>
>>>>>>> dc:title/*[0] :: Missing language qualifier.
>>>>>>>
>>>>>>> The document does not conform to the requested standard.
>>>>>>>
>>>>>>> The document's meta data is either missing or inconsistent or
>>>>> corrupt.
>>>>>>> The document does not conform to the PDF/A-1b standard.
>>>>>>>
>>>>>>> Done.
>>>>>>>
>>>>>>> and veraPDF:
>>>>>>>
>>>>>>> *Rule* *Status*
>>>>>>> Specification: ISO 19005-1:2005, Clause: 6.7.11, Test number: 1
>>>>>>> <
>>>>>>>
>> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-6711-1
>>>>>>> The PDF/A version and conformance level of a file shall be specified
>>>>>>> using the PDF/A Identification extension schema. **Failed**
>>>>>>> 1 occurrences Show
>>>>>>>
>>>>>>>
>>>>>>> Specification: ISO 19005-1:2005, Clause: 6.7.9, Test number: 1
>>>>>>> <
>>>>>>>
>> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-679-1
>>>>>>> The metadata stream shall conform to XMP Specification and well
>>>>>>> formed
>>>>>>> PDFAExtension Schema for all extensions **Failed**
>>>>>>> 1 occurrences
>>>>>>>
>>>>>>>
>>>>>>> Tilman
>>>>>>>
>>>>>>> Am 02.02.2022 um 22:37 schrieb Tommy Wu:
>>>>>>>> I was using your CreatePDFA java code to create a PDF/A document but
>>>>> the
>>>>>>>> validator web site was saying it was not a true PDF/A
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>
>>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to set PDF/A to an existing PDF
Posted by Tommy Wu <to...@gmail.com>.
Would you send over the icc file that you were using?
Tilman Hausherr <TH...@t-online.de> 於 2022年2月3日週四 下午10:45寫道:
> I've also found out why the file produced with the trunk wasn't OK, this
> is because my pom.xml had used Apache FOP for some reason.
>
> Tilman
>
> Am 04.02.2022 um 04:37 schrieb Tilman Hausherr:
> > Am 04.02.2022 um 01:48 schrieb Tommy Wu:
> >> Sorry I am bit confused. Do you mean you have a version that is
> >> working and
> >> can pass the validation? If so, would you please provide the link to the
> >> source file?
> >
> > I used the ordinary 2.0.25 version that you can download at
> > https://pdfbox.apache.org/download.html
> >
> > However it doesn't pass the "validation" at the site you mentioned (
> > https://www.pdfen.com/pdf-a-validator ) that I have never heard about.
> > It passes the validation with VeraPDF ( https://verapdf.org/software/
> > ) and PDF-Tools ( https://www.pdf-online.com/osa/validate.aspx ).
> >
> > Tilman
> >
> >
> >
> >>
> >> Tilman Hausherr <TH...@t-online.de> 於 2022年2月3日週四
> >> 下午1:29寫道:
> >>
> >>> I must correct myself. The file created by 2.0 is fine on both services
> >>> that I mentioned. The problem is only in the trunk, and only in my
> >>> local
> >>> version.
> >>>
> >>> I never heard about "PDFen". The two other services I mentioned are
> >>> well
> >>> known in the industry.
> >>>
> >>> (For me:
> >>>
> >>> 2.0 xmp:
> >>> <rdf:li xml:lang="x-default">target/test-output/PDFA.pdf</rdf:li>
> >>>
> >>> tilman trunk xmp:
> >>> <rdf:li lang="x-default">target/test-output/PDFA.pdf</rdf:li> )
> >>>
> >>> Tilman
> >>>
> >>> Am 03.02.2022 um 11:15 schrieb Tommy Wu:
> >>>> So how should we address this?
> >>>>
> >>>> Tilman Hausherr<TH...@t-online.de> 於 2022年2月2日週三
> >>>> 下午11:42寫道:
> >>>>
> >>>>> OK, now we have a problem. I tried
> >>>>> https://www.pdf-online.com/osa/validate.aspx
> >>>>>
> >>>>> Validating file "PDFA.pdf" for conformance level pdfa-1b
> >>>>>
> >>>>> dc:title/*[0] :: Missing language qualifier.
> >>>>>
> >>>>> The document does not conform to the requested standard.
> >>>>>
> >>>>> The document's meta data is either missing or inconsistent or
> >>> corrupt.
> >>>>> The document does not conform to the PDF/A-1b standard.
> >>>>>
> >>>>> Done.
> >>>>>
> >>>>> and veraPDF:
> >>>>>
> >>>>> *Rule* *Status*
> >>>>> Specification: ISO 19005-1:2005, Clause: 6.7.11, Test number: 1
> >>>>> <
> >>>>>
> >>>
> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-6711-1
> >>>
> >>>>>
> >>>>> The PDF/A version and conformance level of a file shall be specified
> >>>>> using the PDF/A Identification extension schema. **Failed**
> >>>>> 1 occurrences Show
> >>>>>
> >>>>>
> >>>>> Specification: ISO 19005-1:2005, Clause: 6.7.9, Test number: 1
> >>>>> <
> >>>>>
> >>>
> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-679-1
> >>>
> >>>>>
> >>>>> The metadata stream shall conform to XMP Specification and well
> >>>>> formed
> >>>>> PDFAExtension Schema for all extensions **Failed**
> >>>>> 1 occurrences
> >>>>>
> >>>>>
> >>>>> Tilman
> >>>>>
> >>>>> Am 02.02.2022 um 22:37 schrieb Tommy Wu:
> >>>>>> I was using your CreatePDFA java code to create a PDF/A document but
> >>> the
> >>>>>> validator web site was saying it was not a true PDF/A
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >>> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>>
> >>>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> > For additional commands, e-mail: users-help@pdfbox.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
Re: How to set PDF/A to an existing PDF
Posted by Tilman Hausherr <TH...@t-online.de>.
I've also found out why the file produced with the trunk wasn't OK, this
is because my pom.xml had used Apache FOP for some reason.
Tilman
Am 04.02.2022 um 04:37 schrieb Tilman Hausherr:
> Am 04.02.2022 um 01:48 schrieb Tommy Wu:
>> Sorry I am bit confused. Do you mean you have a version that is
>> working and
>> can pass the validation? If so, would you please provide the link to the
>> source file?
>
> I used the ordinary 2.0.25 version that you can download at
> https://pdfbox.apache.org/download.html
>
> However it doesn't pass the "validation" at the site you mentioned (
> https://www.pdfen.com/pdf-a-validator ) that I have never heard about.
> It passes the validation with VeraPDF ( https://verapdf.org/software/
> ) and PDF-Tools ( https://www.pdf-online.com/osa/validate.aspx ).
>
> Tilman
>
>
>
>>
>> Tilman Hausherr <TH...@t-online.de> 於 2022年2月3日週四
>> 下午1:29寫道:
>>
>>> I must correct myself. The file created by 2.0 is fine on both services
>>> that I mentioned. The problem is only in the trunk, and only in my
>>> local
>>> version.
>>>
>>> I never heard about "PDFen". The two other services I mentioned are
>>> well
>>> known in the industry.
>>>
>>> (For me:
>>>
>>> 2.0 xmp:
>>> <rdf:li xml:lang="x-default">target/test-output/PDFA.pdf</rdf:li>
>>>
>>> tilman trunk xmp:
>>> <rdf:li lang="x-default">target/test-output/PDFA.pdf</rdf:li> )
>>>
>>> Tilman
>>>
>>> Am 03.02.2022 um 11:15 schrieb Tommy Wu:
>>>> So how should we address this?
>>>>
>>>> Tilman Hausherr<TH...@t-online.de> 於 2022年2月2日週三
>>>> 下午11:42寫道:
>>>>
>>>>> OK, now we have a problem. I tried
>>>>> https://www.pdf-online.com/osa/validate.aspx
>>>>>
>>>>> Validating file "PDFA.pdf" for conformance level pdfa-1b
>>>>>
>>>>> dc:title/*[0] :: Missing language qualifier.
>>>>>
>>>>> The document does not conform to the requested standard.
>>>>>
>>>>> The document's meta data is either missing or inconsistent or
>>> corrupt.
>>>>> The document does not conform to the PDF/A-1b standard.
>>>>>
>>>>> Done.
>>>>>
>>>>> and veraPDF:
>>>>>
>>>>> *Rule* *Status*
>>>>> Specification: ISO 19005-1:2005, Clause: 6.7.11, Test number: 1
>>>>> <
>>>>>
>>> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-6711-1
>>>
>>>>>
>>>>> The PDF/A version and conformance level of a file shall be specified
>>>>> using the PDF/A Identification extension schema. **Failed**
>>>>> 1 occurrences Show
>>>>>
>>>>>
>>>>> Specification: ISO 19005-1:2005, Clause: 6.7.9, Test number: 1
>>>>> <
>>>>>
>>> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-679-1
>>>
>>>>>
>>>>> The metadata stream shall conform to XMP Specification and well
>>>>> formed
>>>>> PDFAExtension Schema for all extensions **Failed**
>>>>> 1 occurrences
>>>>>
>>>>>
>>>>> Tilman
>>>>>
>>>>> Am 02.02.2022 um 22:37 schrieb Tommy Wu:
>>>>>> I was using your CreatePDFA java code to create a PDF/A document but
>>> the
>>>>>> validator web site was saying it was not a true PDF/A
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to set PDF/A to an existing PDF
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 04.02.2022 um 01:48 schrieb Tommy Wu:
> Sorry I am bit confused. Do you mean you have a version that is working and
> can pass the validation? If so, would you please provide the link to the
> source file?
I used the ordinary 2.0.25 version that you can download at
https://pdfbox.apache.org/download.html
However it doesn't pass the "validation" at the site you mentioned (
https://www.pdfen.com/pdf-a-validator ) that I have never heard about.
It passes the validation with VeraPDF ( https://verapdf.org/software/ )
and PDF-Tools ( https://www.pdf-online.com/osa/validate.aspx ).
Tilman
>
> Tilman Hausherr <TH...@t-online.de> 於 2022年2月3日週四 下午1:29寫道:
>
>> I must correct myself. The file created by 2.0 is fine on both services
>> that I mentioned. The problem is only in the trunk, and only in my local
>> version.
>>
>> I never heard about "PDFen". The two other services I mentioned are well
>> known in the industry.
>>
>> (For me:
>>
>> 2.0 xmp:
>> <rdf:li xml:lang="x-default">target/test-output/PDFA.pdf</rdf:li>
>>
>> tilman trunk xmp:
>> <rdf:li lang="x-default">target/test-output/PDFA.pdf</rdf:li> )
>>
>> Tilman
>>
>> Am 03.02.2022 um 11:15 schrieb Tommy Wu:
>>> So how should we address this?
>>>
>>> Tilman Hausherr<TH...@t-online.de> 於 2022年2月2日週三 下午11:42寫道:
>>>
>>>> OK, now we have a problem. I tried
>>>> https://www.pdf-online.com/osa/validate.aspx
>>>>
>>>> Validating file "PDFA.pdf" for conformance level pdfa-1b
>>>>
>>>> dc:title/*[0] :: Missing language qualifier.
>>>>
>>>> The document does not conform to the requested standard.
>>>>
>>>> The document's meta data is either missing or inconsistent or
>> corrupt.
>>>> The document does not conform to the PDF/A-1b standard.
>>>>
>>>> Done.
>>>>
>>>> and veraPDF:
>>>>
>>>> *Rule* *Status*
>>>> Specification: ISO 19005-1:2005, Clause: 6.7.11, Test number: 1
>>>> <
>>>>
>> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-6711-1
>>>>
>>>> The PDF/A version and conformance level of a file shall be specified
>>>> using the PDF/A Identification extension schema. **Failed**
>>>> 1 occurrences Show
>>>>
>>>>
>>>> Specification: ISO 19005-1:2005, Clause: 6.7.9, Test number: 1
>>>> <
>>>>
>> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-679-1
>>>>
>>>> The metadata stream shall conform to XMP Specification and well formed
>>>> PDFAExtension Schema for all extensions **Failed**
>>>> 1 occurrences
>>>>
>>>>
>>>> Tilman
>>>>
>>>> Am 02.02.2022 um 22:37 schrieb Tommy Wu:
>>>>> I was using your CreatePDFA java code to create a PDF/A document but
>> the
>>>>> validator web site was saying it was not a true PDF/A
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to set PDF/A to an existing PDF
Posted by Tommy Wu <to...@gmail.com>.
Sorry I am bit confused. Do you mean you have a version that is working and
can pass the validation? If so, would you please provide the link to the
source file?
Tilman Hausherr <TH...@t-online.de> 於 2022年2月3日週四 下午1:29寫道:
> I must correct myself. The file created by 2.0 is fine on both services
> that I mentioned. The problem is only in the trunk, and only in my local
> version.
>
> I never heard about "PDFen". The two other services I mentioned are well
> known in the industry.
>
> (For me:
>
> 2.0 xmp:
> <rdf:li xml:lang="x-default">target/test-output/PDFA.pdf</rdf:li>
>
> tilman trunk xmp:
> <rdf:li lang="x-default">target/test-output/PDFA.pdf</rdf:li> )
>
> Tilman
>
> Am 03.02.2022 um 11:15 schrieb Tommy Wu:
> > So how should we address this?
> >
> > Tilman Hausherr<TH...@t-online.de> 於 2022年2月2日週三 下午11:42寫道:
> >
> >> OK, now we have a problem. I tried
> >> https://www.pdf-online.com/osa/validate.aspx
> >>
> >> Validating file "PDFA.pdf" for conformance level pdfa-1b
> >>
> >> dc:title/*[0] :: Missing language qualifier.
> >>
> >> The document does not conform to the requested standard.
> >>
> >> The document's meta data is either missing or inconsistent or
> corrupt.
> >>
> >> The document does not conform to the PDF/A-1b standard.
> >>
> >> Done.
> >>
> >> and veraPDF:
> >>
> >> *Rule* *Status*
> >> Specification: ISO 19005-1:2005, Clause: 6.7.11, Test number: 1
> >> <
> >>
> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-6711-1
> >
> >>
> >>
> >> The PDF/A version and conformance level of a file shall be specified
> >> using the PDF/A Identification extension schema. **Failed**
> >> 1 occurrences Show
> >>
> >>
> >> Specification: ISO 19005-1:2005, Clause: 6.7.9, Test number: 1
> >> <
> >>
> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-679-1
> >
> >>
> >>
> >> The metadata stream shall conform to XMP Specification and well formed
> >> PDFAExtension Schema for all extensions **Failed**
> >> 1 occurrences
> >>
> >>
> >> Tilman
> >>
> >> Am 02.02.2022 um 22:37 schrieb Tommy Wu:
> >>> I was using your CreatePDFA java code to create a PDF/A document but
> the
> >>> validator web site was saying it was not a true PDF/A
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
Re: How to set PDF/A to an existing PDF
Posted by Tilman Hausherr <TH...@t-online.de>.
I must correct myself. The file created by 2.0 is fine on both services
that I mentioned. The problem is only in the trunk, and only in my local
version.
I never heard about "PDFen". The two other services I mentioned are well
known in the industry.
(For me:
2.0 xmp:
<rdf:li xml:lang="x-default">target/test-output/PDFA.pdf</rdf:li>
tilman trunk xmp:
<rdf:li lang="x-default">target/test-output/PDFA.pdf</rdf:li> )
Tilman
Am 03.02.2022 um 11:15 schrieb Tommy Wu:
> So how should we address this?
>
> Tilman Hausherr<TH...@t-online.de> 於 2022年2月2日週三 下午11:42寫道:
>
>> OK, now we have a problem. I tried
>> https://www.pdf-online.com/osa/validate.aspx
>>
>> Validating file "PDFA.pdf" for conformance level pdfa-1b
>>
>> dc:title/*[0] :: Missing language qualifier.
>>
>> The document does not conform to the requested standard.
>>
>> The document's meta data is either missing or inconsistent or corrupt.
>>
>> The document does not conform to the PDF/A-1b standard.
>>
>> Done.
>>
>> and veraPDF:
>>
>> *Rule* *Status*
>> Specification: ISO 19005-1:2005, Clause: 6.7.11, Test number: 1
>> <
>> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-6711-1>
>>
>>
>> The PDF/A version and conformance level of a file shall be specified
>> using the PDF/A Identification extension schema. **Failed**
>> 1 occurrences Show
>>
>>
>> Specification: ISO 19005-1:2005, Clause: 6.7.9, Test number: 1
>> <
>> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-679-1>
>>
>>
>> The metadata stream shall conform to XMP Specification and well formed
>> PDFAExtension Schema for all extensions **Failed**
>> 1 occurrences
>>
>>
>> Tilman
>>
>> Am 02.02.2022 um 22:37 schrieb Tommy Wu:
>>> I was using your CreatePDFA java code to create a PDF/A document but the
>>> validator web site was saying it was not a true PDF/A
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to set PDF/A to an existing PDF
Posted by Tommy Wu <to...@gmail.com>.
So how should we address this?
Tilman Hausherr <TH...@t-online.de> 於 2022年2月2日週三 下午11:42寫道:
> OK, now we have a problem. I tried
> https://www.pdf-online.com/osa/validate.aspx
>
> Validating file "PDFA.pdf" for conformance level pdfa-1b
>
> dc:title/*[0] :: Missing language qualifier.
>
> The document does not conform to the requested standard.
>
> The document's meta data is either missing or inconsistent or corrupt.
>
> The document does not conform to the PDF/A-1b standard.
>
> Done.
>
> and veraPDF:
>
> *Rule* *Status*
> Specification: ISO 19005-1:2005, Clause: 6.7.11, Test number: 1
> <
> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-6711-1>
>
>
> The PDF/A version and conformance level of a file shall be specified
> using the PDF/A Identification extension schema. **Failed**
> 1 occurrences Show
>
>
> Specification: ISO 19005-1:2005, Clause: 6.7.9, Test number: 1
> <
> https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-679-1>
>
>
> The metadata stream shall conform to XMP Specification and well formed
> PDFAExtension Schema for all extensions **Failed**
> 1 occurrences
>
>
> Tilman
>
> Am 02.02.2022 um 22:37 schrieb Tommy Wu:
> > I was using your CreatePDFA java code to create a PDF/A document but the
> > validator web site was saying it was not a true PDF/A
>
>
>
Re: How to set PDF/A to an existing PDF
Posted by Tilman Hausherr <TH...@t-online.de>.
OK, now we have a problem. I tried
https://www.pdf-online.com/osa/validate.aspx
Validating file "PDFA.pdf" for conformance level pdfa-1b
dc:title/*[0] :: Missing language qualifier.
The document does not conform to the requested standard.
The document's meta data is either missing or inconsistent or corrupt.
The document does not conform to the PDF/A-1b standard.
Done.
and veraPDF:
*Rule* *Status*
Specification: ISO 19005-1:2005, Clause: 6.7.11, Test number: 1
<https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-6711-1>
The PDF/A version and conformance level of a file shall be specified
using the PDF/A Identification extension schema. **Failed**
1 occurrences Show
Specification: ISO 19005-1:2005, Clause: 6.7.9, Test number: 1
<https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-679-1>
The metadata stream shall conform to XMP Specification and well formed
PDFAExtension Schema for all extensions **Failed**
1 occurrences
Tilman
Am 02.02.2022 um 22:37 schrieb Tommy Wu:
> I was using your CreatePDFA java code to create a PDF/A document but the
> validator web site was saying it was not a true PDF/A
Re: How to set PDF/A to an existing PDF
Posted by Tommy Wu <to...@gmail.com>.
I was using your CreatePDFA java code to create a PDF/A document but the
validator web site was saying it was not a true PDF/A
Tilman Hausherr <TH...@t-online.de> 於 2022年2月2日週三 下午2:15寫道:
> That image was swallowed by the mailing list engine. I point you to my
> comment in your SO question
>
> https://stackoverflow.com/questions/70888090/set-pda-a-to-existing-pdf-using-pdfbox
>
> "Converting an existing PDF to PDF/A can be very difficult, it's more
> than just setting the metadata."
>
> If you want to convert random files then you should use commercial
> tools. PDFBox can only help for simple PDFs, e.g. PDFs from scans.
>
> Tilman
>
> Am 02.02.2022 um 13:03 schrieb Tommy Wu:
> > Thanks Tilman
> > I was able to run the example now
> > However, when I tested in https://www.pdfen.com/pdf-a-validator, it said
> > image.png
> >
> > Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二
> > 下午11:04寫道:
> >
> > Because you're not using the 2.0 CreatePDFA.java example. That one
> > goes
> > like this:
> >
> > // add XMP metadata
> > XMPMetadata xmp = XMPMetadata.createXMPMetadata();
> >
> > try
> > {
> > DublinCoreSchema dc =
> > xmp.createAndAddDublinCoreSchema();
> > dc.setTitle(file);
> >
> > PDFAIdentificationSchema id =
> > xmp.createAndAddPFAIdentificationSchema();
> > id.setPart(1);
> > id.setConformance("B");
> >
> > XmpSerializer serializer = new XmpSerializer();
> > ByteArrayOutputStream baos = new
> > ByteArrayOutputStream();
> > serializer.serialize(xmp, baos, true);
> >
> > PDMetadata metadata = new PDMetadata(doc);
> > metadata.importXMPMetadata(baos.toByteArray());
> > doc.getDocumentCatalog().setMetadata(metadata);
> > }
> > catch(BadFieldValueException e)
> > {
> > // won't happen here, as the provided value is valid
> > throw new IllegalArgumentException(e);
> > }
> >
> > Tilman
> >
> > Am 01.02.2022 um 21:17 schrieb Tommy Wu:
> > > I still cannot get it to compile
> > >
> > > <dependency>
> > > <groupId>org.apache.pdfbox</groupId>
> > > <artifactId>pdfbox</artifactId>
> > > <version>2.0.25</version>
> > > </dependency>
> > >
> > > <dependency>
> > > <groupId>org.apache.pdfbox</groupId>
> > > <artifactId>xmpbox</artifactId>
> > > <version>2.0.24</version>
> > > </dependency>
> > > <dependency>
> > > <groupId>org.apache.pdfbox</groupId>
> > > <artifactId>fontbox</artifactId>
> > > <version>2.0.25</version>
> > > </dependency>
> > > // jempbox version
> > > XMPMetadata xmp = new XMPMetadata();
> > > XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
> > > xmp.addSchema(pdfaid);
> > > pdfaid.setConformance("B");
> > > pdfaid.setPart(1);
> > > pdfaid.setAbout("");
> > > metadata.importXMPMetadata(xmp);
> > >
> > > *java: constructor XMPMetadata in class
> > org.apache.xmpbox.XMPMetadata
> > > cannot be applied to given types;*
> > > * required: no arguments*
> > > * found: no arguments*
> > > * reason: XMPMetadata() has protected access in
> > > org.apache.xmpbox.XMPMetadata*
> > >
> > >
> > >
> > >
> > > *java: cannot find symbol symbol: class XMPSchemaPDFAId
> > location: class
> > > com.example.pdfboxtest.CreatePDFAjava: cannot find symbol
> > symbol: class
> > > XMPSchemaPDFAId location: class
> > com.example.pdfboxtest.CreatePDFAjava:
> > > incompatible types: org.apache.xmpbox.XMPMetadata cannot be
> > converted to
> > > byte[]*
> > >
> > > Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二
> > 下午3:03寫道:
> > >
> > >> Use xmpbox, not jempbox.
> > >>
> > >> Tilman
> > >>
> > >> Am 01.02.2022 um 20:19 schrieb Tommy Wu:
> > >>> Here's the dependency I used
> > >>>
> > >>> <dependency>
> > >>> <groupId>org.apache.pdfbox</groupId>
> > >>> <artifactId>pdfbox</artifactId>
> > >>> <version>2.0.25</version>
> > >>> </dependency>
> > >>> <!--
> > https://mvnrepository.com/artifact/org.apache.pdfbox/jempbox -->
> > >>> <dependency>
> > >>> <groupId>org.apache.pdfbox</groupId>
> > >>> <artifactId>jempbox</artifactId>
> > >>> <version>1.8.16</version>
> > >>> </dependency>
> > >>>
> > >>>
> > >>>
> >
> pdfboxTest\src\main\java\com\example\pdfboxtest\CreatePDFA.java:101:40
> > >>> java: incompatible types: org.apache.jempbox.xmp.XMPMetadata
> > cannot be
> > >>> converted to byte[]
> > >>>
> > >>> line 40 is
> > >>>
> > >>> metadata.importXMPMetadata(xmp);
> > >>>
> > >>>
> > >>> Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二
> > 下午1:56寫道:
> > >>>
> > >>>> Then please tell what errors you get, and what libraries
> > you're using
> > >>>> (hopefully pdfbox, fontbox and xmpbox).
> > >>>>
> > >>>> Tilman
> > >>>>
> > >>>> Am 01.02.2022 um 19:42 schrieb Tommy Wu:
> > >>>>> I can't even get it to compile
> > >>>>>
> > >>>>> Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二
> > 上午12:35寫道:
> > >>>>>
> > >>>>>> Hi,
> > >>>>>>
> > >>>>>> Am 31.01.22 um 22:03 schrieb Tommy Wu:
> > >>>>>>> The following cookbook is not long working for the new
> > version. Do
> > >> you
> > >>>>>> have
> > >>>>>>> a way to do it now?
> > >>>>>> Which version are you referring to?
> > >>>>>>
> > >>>>>> What exactly doesn't work?
> > >>>>>>
> > >>>>>> Andreas
> > >>>>>>> Apache PDFBox | PDF/A Creation
> > >>>>>>> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> Thanks
> > >>>>>>>
> > >>>>>>
> > ---------------------------------------------------------------------
> > >>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> > >>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
> > >>>>>>
> > >>>>>>
> > >>>>
> > ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> > >>>> For additional commands, e-mail: users-help@pdfbox.apache.org
> > >>>>
> > >>>>
> > >>
> > >>
> > ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> > >> For additional commands, e-mail: users-help@pdfbox.apache.org
> > >>
> > >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> > For additional commands, e-mail: users-help@pdfbox.apache.org
> >
>
Re: How to set PDF/A to an existing PDF
Posted by Tilman Hausherr <TH...@t-online.de>.
That image was swallowed by the mailing list engine. I point you to my
comment in your SO question
https://stackoverflow.com/questions/70888090/set-pda-a-to-existing-pdf-using-pdfbox
"Converting an existing PDF to PDF/A can be very difficult, it's more
than just setting the metadata."
If you want to convert random files then you should use commercial
tools. PDFBox can only help for simple PDFs, e.g. PDFs from scans.
Tilman
Am 02.02.2022 um 13:03 schrieb Tommy Wu:
> Thanks Tilman
> I was able to run the example now
> However, when I tested in https://www.pdfen.com/pdf-a-validator, it said
> image.png
>
> Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二
> 下午11:04寫道:
>
> Because you're not using the 2.0 CreatePDFA.java example. That one
> goes
> like this:
>
> // add XMP metadata
> XMPMetadata xmp = XMPMetadata.createXMPMetadata();
>
> try
> {
> DublinCoreSchema dc =
> xmp.createAndAddDublinCoreSchema();
> dc.setTitle(file);
>
> PDFAIdentificationSchema id =
> xmp.createAndAddPFAIdentificationSchema();
> id.setPart(1);
> id.setConformance("B");
>
> XmpSerializer serializer = new XmpSerializer();
> ByteArrayOutputStream baos = new
> ByteArrayOutputStream();
> serializer.serialize(xmp, baos, true);
>
> PDMetadata metadata = new PDMetadata(doc);
> metadata.importXMPMetadata(baos.toByteArray());
> doc.getDocumentCatalog().setMetadata(metadata);
> }
> catch(BadFieldValueException e)
> {
> // won't happen here, as the provided value is valid
> throw new IllegalArgumentException(e);
> }
>
> Tilman
>
> Am 01.02.2022 um 21:17 schrieb Tommy Wu:
> > I still cannot get it to compile
> >
> > <dependency>
> > <groupId>org.apache.pdfbox</groupId>
> > <artifactId>pdfbox</artifactId>
> > <version>2.0.25</version>
> > </dependency>
> >
> > <dependency>
> > <groupId>org.apache.pdfbox</groupId>
> > <artifactId>xmpbox</artifactId>
> > <version>2.0.24</version>
> > </dependency>
> > <dependency>
> > <groupId>org.apache.pdfbox</groupId>
> > <artifactId>fontbox</artifactId>
> > <version>2.0.25</version>
> > </dependency>
> > // jempbox version
> > XMPMetadata xmp = new XMPMetadata();
> > XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
> > xmp.addSchema(pdfaid);
> > pdfaid.setConformance("B");
> > pdfaid.setPart(1);
> > pdfaid.setAbout("");
> > metadata.importXMPMetadata(xmp);
> >
> > *java: constructor XMPMetadata in class
> org.apache.xmpbox.XMPMetadata
> > cannot be applied to given types;*
> > * required: no arguments*
> > * found: no arguments*
> > * reason: XMPMetadata() has protected access in
> > org.apache.xmpbox.XMPMetadata*
> >
> >
> >
> >
> > *java: cannot find symbol symbol: class XMPSchemaPDFAId
> location: class
> > com.example.pdfboxtest.CreatePDFAjava: cannot find symbol
> symbol: class
> > XMPSchemaPDFAId location: class
> com.example.pdfboxtest.CreatePDFAjava:
> > incompatible types: org.apache.xmpbox.XMPMetadata cannot be
> converted to
> > byte[]*
> >
> > Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二
> 下午3:03寫道:
> >
> >> Use xmpbox, not jempbox.
> >>
> >> Tilman
> >>
> >> Am 01.02.2022 um 20:19 schrieb Tommy Wu:
> >>> Here's the dependency I used
> >>>
> >>> <dependency>
> >>> <groupId>org.apache.pdfbox</groupId>
> >>> <artifactId>pdfbox</artifactId>
> >>> <version>2.0.25</version>
> >>> </dependency>
> >>> <!--
> https://mvnrepository.com/artifact/org.apache.pdfbox/jempbox -->
> >>> <dependency>
> >>> <groupId>org.apache.pdfbox</groupId>
> >>> <artifactId>jempbox</artifactId>
> >>> <version>1.8.16</version>
> >>> </dependency>
> >>>
> >>>
> >>>
> pdfboxTest\src\main\java\com\example\pdfboxtest\CreatePDFA.java:101:40
> >>> java: incompatible types: org.apache.jempbox.xmp.XMPMetadata
> cannot be
> >>> converted to byte[]
> >>>
> >>> line 40 is
> >>>
> >>> metadata.importXMPMetadata(xmp);
> >>>
> >>>
> >>> Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二
> 下午1:56寫道:
> >>>
> >>>> Then please tell what errors you get, and what libraries
> you're using
> >>>> (hopefully pdfbox, fontbox and xmpbox).
> >>>>
> >>>> Tilman
> >>>>
> >>>> Am 01.02.2022 um 19:42 schrieb Tommy Wu:
> >>>>> I can't even get it to compile
> >>>>>
> >>>>> Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二
> 上午12:35寫道:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> Am 31.01.22 um 22:03 schrieb Tommy Wu:
> >>>>>>> The following cookbook is not long working for the new
> version. Do
> >> you
> >>>>>> have
> >>>>>>> a way to do it now?
> >>>>>> Which version are you referring to?
> >>>>>>
> >>>>>> What exactly doesn't work?
> >>>>>>
> >>>>>> Andreas
> >>>>>>> Apache PDFBox | PDF/A Creation
> >>>>>>> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> Thanks
> >>>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>>>>>
> >>>>>>
> >>>>
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >>>> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>>>
> >>>>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
Re: How to set PDF/A to an existing PDF
Posted by Tommy Wu <to...@gmail.com>.
Thanks Tilman
I was able to run the example now
However, when I tested in https://www.pdfen.com/pdf-a-validator, it said
[image: image.png]
Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午11:04寫道:
> Because you're not using the 2.0 CreatePDFA.java example. That one goes
> like this:
>
> // add XMP metadata
> XMPMetadata xmp = XMPMetadata.createXMPMetadata();
>
> try
> {
> DublinCoreSchema dc = xmp.createAndAddDublinCoreSchema();
> dc.setTitle(file);
>
> PDFAIdentificationSchema id =
> xmp.createAndAddPFAIdentificationSchema();
> id.setPart(1);
> id.setConformance("B");
>
> XmpSerializer serializer = new XmpSerializer();
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> serializer.serialize(xmp, baos, true);
>
> PDMetadata metadata = new PDMetadata(doc);
> metadata.importXMPMetadata(baos.toByteArray());
> doc.getDocumentCatalog().setMetadata(metadata);
> }
> catch(BadFieldValueException e)
> {
> // won't happen here, as the provided value is valid
> throw new IllegalArgumentException(e);
> }
>
> Tilman
>
> Am 01.02.2022 um 21:17 schrieb Tommy Wu:
> > I still cannot get it to compile
> >
> > <dependency>
> > <groupId>org.apache.pdfbox</groupId>
> > <artifactId>pdfbox</artifactId>
> > <version>2.0.25</version>
> > </dependency>
> >
> > <dependency>
> > <groupId>org.apache.pdfbox</groupId>
> > <artifactId>xmpbox</artifactId>
> > <version>2.0.24</version>
> > </dependency>
> > <dependency>
> > <groupId>org.apache.pdfbox</groupId>
> > <artifactId>fontbox</artifactId>
> > <version>2.0.25</version>
> > </dependency>
> > // jempbox version
> > XMPMetadata xmp = new XMPMetadata();
> > XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
> > xmp.addSchema(pdfaid);
> > pdfaid.setConformance("B");
> > pdfaid.setPart(1);
> > pdfaid.setAbout("");
> > metadata.importXMPMetadata(xmp);
> >
> > *java: constructor XMPMetadata in class org.apache.xmpbox.XMPMetadata
> > cannot be applied to given types;*
> > * required: no arguments*
> > * found: no arguments*
> > * reason: XMPMetadata() has protected access in
> > org.apache.xmpbox.XMPMetadata*
> >
> >
> >
> >
> > *java: cannot find symbol symbol: class XMPSchemaPDFAId location:
> class
> > com.example.pdfboxtest.CreatePDFAjava: cannot find symbol symbol:
> class
> > XMPSchemaPDFAId location: class com.example.pdfboxtest.CreatePDFAjava:
> > incompatible types: org.apache.xmpbox.XMPMetadata cannot be converted to
> > byte[]*
> >
> > Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午3:03寫道:
> >
> >> Use xmpbox, not jempbox.
> >>
> >> Tilman
> >>
> >> Am 01.02.2022 um 20:19 schrieb Tommy Wu:
> >>> Here's the dependency I used
> >>>
> >>> <dependency>
> >>> <groupId>org.apache.pdfbox</groupId>
> >>> <artifactId>pdfbox</artifactId>
> >>> <version>2.0.25</version>
> >>> </dependency>
> >>> <!-- https://mvnrepository.com/artifact/org.apache.pdfbox/jempbox -->
> >>> <dependency>
> >>> <groupId>org.apache.pdfbox</groupId>
> >>> <artifactId>jempbox</artifactId>
> >>> <version>1.8.16</version>
> >>> </dependency>
> >>>
> >>>
> >>> pdfboxTest\src\main\java\com\example\pdfboxtest\CreatePDFA.java:101:40
> >>> java: incompatible types: org.apache.jempbox.xmp.XMPMetadata cannot be
> >>> converted to byte[]
> >>>
> >>> line 40 is
> >>>
> >>> metadata.importXMPMetadata(xmp);
> >>>
> >>>
> >>> Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午1:56寫道:
> >>>
> >>>> Then please tell what errors you get, and what libraries you're using
> >>>> (hopefully pdfbox, fontbox and xmpbox).
> >>>>
> >>>> Tilman
> >>>>
> >>>> Am 01.02.2022 um 19:42 schrieb Tommy Wu:
> >>>>> I can't even get it to compile
> >>>>>
> >>>>> Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二 上午12:35寫道:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> Am 31.01.22 um 22:03 schrieb Tommy Wu:
> >>>>>>> The following cookbook is not long working for the new version. Do
> >> you
> >>>>>> have
> >>>>>>> a way to do it now?
> >>>>>> Which version are you referring to?
> >>>>>>
> >>>>>> What exactly doesn't work?
> >>>>>>
> >>>>>> Andreas
> >>>>>>> Apache PDFBox | PDF/A Creation
> >>>>>>> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> Thanks
> >>>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>>>>>
> >>>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >>>> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>>>
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
Re: How to set PDF/A to an existing PDF
Posted by Tilman Hausherr <TH...@t-online.de>.
Because you're not using the 2.0 CreatePDFA.java example. That one goes
like this:
// add XMP metadata
XMPMetadata xmp = XMPMetadata.createXMPMetadata();
try
{
DublinCoreSchema dc = xmp.createAndAddDublinCoreSchema();
dc.setTitle(file);
PDFAIdentificationSchema id =
xmp.createAndAddPFAIdentificationSchema();
id.setPart(1);
id.setConformance("B");
XmpSerializer serializer = new XmpSerializer();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
serializer.serialize(xmp, baos, true);
PDMetadata metadata = new PDMetadata(doc);
metadata.importXMPMetadata(baos.toByteArray());
doc.getDocumentCatalog().setMetadata(metadata);
}
catch(BadFieldValueException e)
{
// won't happen here, as the provided value is valid
throw new IllegalArgumentException(e);
}
Tilman
Am 01.02.2022 um 21:17 schrieb Tommy Wu:
> I still cannot get it to compile
>
> <dependency>
> <groupId>org.apache.pdfbox</groupId>
> <artifactId>pdfbox</artifactId>
> <version>2.0.25</version>
> </dependency>
>
> <dependency>
> <groupId>org.apache.pdfbox</groupId>
> <artifactId>xmpbox</artifactId>
> <version>2.0.24</version>
> </dependency>
> <dependency>
> <groupId>org.apache.pdfbox</groupId>
> <artifactId>fontbox</artifactId>
> <version>2.0.25</version>
> </dependency>
> // jempbox version
> XMPMetadata xmp = new XMPMetadata();
> XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
> xmp.addSchema(pdfaid);
> pdfaid.setConformance("B");
> pdfaid.setPart(1);
> pdfaid.setAbout("");
> metadata.importXMPMetadata(xmp);
>
> *java: constructor XMPMetadata in class org.apache.xmpbox.XMPMetadata
> cannot be applied to given types;*
> * required: no arguments*
> * found: no arguments*
> * reason: XMPMetadata() has protected access in
> org.apache.xmpbox.XMPMetadata*
>
>
>
>
> *java: cannot find symbol symbol: class XMPSchemaPDFAId location: class
> com.example.pdfboxtest.CreatePDFAjava: cannot find symbol symbol: class
> XMPSchemaPDFAId location: class com.example.pdfboxtest.CreatePDFAjava:
> incompatible types: org.apache.xmpbox.XMPMetadata cannot be converted to
> byte[]*
>
> Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午3:03寫道:
>
>> Use xmpbox, not jempbox.
>>
>> Tilman
>>
>> Am 01.02.2022 um 20:19 schrieb Tommy Wu:
>>> Here's the dependency I used
>>>
>>> <dependency>
>>> <groupId>org.apache.pdfbox</groupId>
>>> <artifactId>pdfbox</artifactId>
>>> <version>2.0.25</version>
>>> </dependency>
>>> <!-- https://mvnrepository.com/artifact/org.apache.pdfbox/jempbox -->
>>> <dependency>
>>> <groupId>org.apache.pdfbox</groupId>
>>> <artifactId>jempbox</artifactId>
>>> <version>1.8.16</version>
>>> </dependency>
>>>
>>>
>>> pdfboxTest\src\main\java\com\example\pdfboxtest\CreatePDFA.java:101:40
>>> java: incompatible types: org.apache.jempbox.xmp.XMPMetadata cannot be
>>> converted to byte[]
>>>
>>> line 40 is
>>>
>>> metadata.importXMPMetadata(xmp);
>>>
>>>
>>> Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午1:56寫道:
>>>
>>>> Then please tell what errors you get, and what libraries you're using
>>>> (hopefully pdfbox, fontbox and xmpbox).
>>>>
>>>> Tilman
>>>>
>>>> Am 01.02.2022 um 19:42 schrieb Tommy Wu:
>>>>> I can't even get it to compile
>>>>>
>>>>> Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二 上午12:35寫道:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Am 31.01.22 um 22:03 schrieb Tommy Wu:
>>>>>>> The following cookbook is not long working for the new version. Do
>> you
>>>>>> have
>>>>>>> a way to do it now?
>>>>>> Which version are you referring to?
>>>>>>
>>>>>> What exactly doesn't work?
>>>>>>
>>>>>> Andreas
>>>>>>> Apache PDFBox | PDF/A Creation
>>>>>>> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to set PDF/A to an existing PDF
Posted by Tommy Wu <to...@gmail.com>.
I still cannot get it to compile
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.25</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>xmpbox</artifactId>
<version>2.0.24</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>
<version>2.0.25</version>
</dependency>
// jempbox version
XMPMetadata xmp = new XMPMetadata();
XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
xmp.addSchema(pdfaid);
pdfaid.setConformance("B");
pdfaid.setPart(1);
pdfaid.setAbout("");
metadata.importXMPMetadata(xmp);
*java: constructor XMPMetadata in class org.apache.xmpbox.XMPMetadata
cannot be applied to given types;*
* required: no arguments*
* found: no arguments*
* reason: XMPMetadata() has protected access in
org.apache.xmpbox.XMPMetadata*
*java: cannot find symbol symbol: class XMPSchemaPDFAId location: class
com.example.pdfboxtest.CreatePDFAjava: cannot find symbol symbol: class
XMPSchemaPDFAId location: class com.example.pdfboxtest.CreatePDFAjava:
incompatible types: org.apache.xmpbox.XMPMetadata cannot be converted to
byte[]*
Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午3:03寫道:
> Use xmpbox, not jempbox.
>
> Tilman
>
> Am 01.02.2022 um 20:19 schrieb Tommy Wu:
> > Here's the dependency I used
> >
> > <dependency>
> > <groupId>org.apache.pdfbox</groupId>
> > <artifactId>pdfbox</artifactId>
> > <version>2.0.25</version>
> > </dependency>
> > <!-- https://mvnrepository.com/artifact/org.apache.pdfbox/jempbox -->
> > <dependency>
> > <groupId>org.apache.pdfbox</groupId>
> > <artifactId>jempbox</artifactId>
> > <version>1.8.16</version>
> > </dependency>
> >
> >
> > pdfboxTest\src\main\java\com\example\pdfboxtest\CreatePDFA.java:101:40
> > java: incompatible types: org.apache.jempbox.xmp.XMPMetadata cannot be
> > converted to byte[]
> >
> > line 40 is
> >
> > metadata.importXMPMetadata(xmp);
> >
> >
> > Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午1:56寫道:
> >
> >> Then please tell what errors you get, and what libraries you're using
> >> (hopefully pdfbox, fontbox and xmpbox).
> >>
> >> Tilman
> >>
> >> Am 01.02.2022 um 19:42 schrieb Tommy Wu:
> >>> I can't even get it to compile
> >>>
> >>> Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二 上午12:35寫道:
> >>>
> >>>> Hi,
> >>>>
> >>>> Am 31.01.22 um 22:03 schrieb Tommy Wu:
> >>>>> The following cookbook is not long working for the new version. Do
> you
> >>>> have
> >>>>> a way to do it now?
> >>>> Which version are you referring to?
> >>>>
> >>>> What exactly doesn't work?
> >>>>
> >>>> Andreas
> >>>>>
> >>>>> Apache PDFBox | PDF/A Creation
> >>>>> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
> >>>>>
> >>>>>
> >>>>>
> >>>>> Thanks
> >>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >>>> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>>>
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
Re: How to set PDF/A to an existing PDF
Posted by Tilman Hausherr <TH...@t-online.de>.
Use xmpbox, not jempbox.
Tilman
Am 01.02.2022 um 20:19 schrieb Tommy Wu:
> Here's the dependency I used
>
> <dependency>
> <groupId>org.apache.pdfbox</groupId>
> <artifactId>pdfbox</artifactId>
> <version>2.0.25</version>
> </dependency>
> <!-- https://mvnrepository.com/artifact/org.apache.pdfbox/jempbox -->
> <dependency>
> <groupId>org.apache.pdfbox</groupId>
> <artifactId>jempbox</artifactId>
> <version>1.8.16</version>
> </dependency>
>
>
> pdfboxTest\src\main\java\com\example\pdfboxtest\CreatePDFA.java:101:40
> java: incompatible types: org.apache.jempbox.xmp.XMPMetadata cannot be
> converted to byte[]
>
> line 40 is
>
> metadata.importXMPMetadata(xmp);
>
>
> Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午1:56寫道:
>
>> Then please tell what errors you get, and what libraries you're using
>> (hopefully pdfbox, fontbox and xmpbox).
>>
>> Tilman
>>
>> Am 01.02.2022 um 19:42 schrieb Tommy Wu:
>>> I can't even get it to compile
>>>
>>> Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二 上午12:35寫道:
>>>
>>>> Hi,
>>>>
>>>> Am 31.01.22 um 22:03 schrieb Tommy Wu:
>>>>> The following cookbook is not long working for the new version. Do you
>>>> have
>>>>> a way to do it now?
>>>> Which version are you referring to?
>>>>
>>>> What exactly doesn't work?
>>>>
>>>> Andreas
>>>>>
>>>>> Apache PDFBox | PDF/A Creation
>>>>> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
>>>>>
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to set PDF/A to an existing PDF
Posted by Tommy Wu <to...@gmail.com>.
Here's the dependency I used
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.25</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.pdfbox/jempbox -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>jempbox</artifactId>
<version>1.8.16</version>
</dependency>
pdfboxTest\src\main\java\com\example\pdfboxtest\CreatePDFA.java:101:40
java: incompatible types: org.apache.jempbox.xmp.XMPMetadata cannot be
converted to byte[]
line 40 is
metadata.importXMPMetadata(xmp);
Tilman Hausherr <TH...@t-online.de> 於 2022年2月1日週二 下午1:56寫道:
> Then please tell what errors you get, and what libraries you're using
> (hopefully pdfbox, fontbox and xmpbox).
>
> Tilman
>
> Am 01.02.2022 um 19:42 schrieb Tommy Wu:
> > I can't even get it to compile
> >
> > Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二 上午12:35寫道:
> >
> >> Hi,
> >>
> >> Am 31.01.22 um 22:03 schrieb Tommy Wu:
> >>> The following cookbook is not long working for the new version. Do you
> >> have
> >>> a way to do it now?
> >> Which version are you referring to?
> >>
> >> What exactly doesn't work?
> >>
> >> Andreas
> >>>
> >>>
> >>> Apache PDFBox | PDF/A Creation
> >>> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
> >>>
> >>>
> >>>
> >>> Thanks
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
Re: How to set PDF/A to an existing PDF
Posted by Tilman Hausherr <TH...@t-online.de>.
Then please tell what errors you get, and what libraries you're using
(hopefully pdfbox, fontbox and xmpbox).
Tilman
Am 01.02.2022 um 19:42 schrieb Tommy Wu:
> I can't even get it to compile
>
> Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二 上午12:35寫道:
>
>> Hi,
>>
>> Am 31.01.22 um 22:03 schrieb Tommy Wu:
>>> The following cookbook is not long working for the new version. Do you
>> have
>>> a way to do it now?
>> Which version are you referring to?
>>
>> What exactly doesn't work?
>>
>> Andreas
>>>
>>>
>>> Apache PDFBox | PDF/A Creation
>>> <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
>>>
>>>
>>>
>>> Thanks
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to set PDF/A to an existing PDF
Posted by Tommy Wu <to...@gmail.com>.
I can't even get it to compile
Andreas Lehmkuehler <an...@lehmi.de> 於 2022年2月1日週二 上午12:35寫道:
> Hi,
>
> Am 31.01.22 um 22:03 schrieb Tommy Wu:
> > The following cookbook is not long working for the new version. Do you
> have
> > a way to do it now?
> Which version are you referring to?
>
> What exactly doesn't work?
>
> Andreas
> >
> >
> >
> > Apache PDFBox | PDF/A Creation
> > <https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html>
> >
> >
> >
> > Thanks
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>