Hi
Anyway thanks for the reply, though I still didn't get any idea of my original
question. It is good to know what you think on my issue indeed.
In last few mails, Michael said "It is not strictly impossible to use iText to
convert arbitrary PDFs to PDF/A as the iText low level API allows you to nearly
everything allowed in PDF" and as he explained, it is also not a small fix to
be done.
I always pointed to that point. I claimed out that it is impossible for the
moment to change the FOP side and make this fixed. So I expected a help from
you to do so. As I got many information on "what to read" and "why it is
hard", I didn't get any reply saying "How to do it" or "try this".
I read many sources from the new and I know what is violated here. So I wrote
many mails including my example code and some suggestions and asked why they
are not working.
Hope you understand my question. If you have any idea on the errors which I am
getting and the thing I am trying to do, please forward them.
Please don't misunderstand and help me on this.
Thank a lot...!
- Manulak
PS : Meanwhile I found these forum entries
-
http://www.coderanch.com/t/502115/java/java/Covert-PDF-PDF-format-iText
-
http://stackoverflow.com/questions/2461852/free-java-library-for-converting-existing-pdf-to-pdf-a
But I have found your replies saying it is possible but hard, and some
guaranteed ways of doing this correct, which were not successful.
From: John Renfrew [mailto:r...@btclick.com]
Sent: Thursday, September 06, 2012 2:37 PM
To: 'Post all your questions about iText here'
Subject: [iText-questions] FW: [SPAM] Re: PDF Validation error with PDF/A1b
complaince
Manulak
You seem to be asking the same question each time but with slightly different
words, but complaint is not the same as compliant.
Saying 'well I read the documentation a bit' and 'well I can't change this
starting point' which is not producing PDF/A documents but I expect to be able
to just add a few things and that will make it compliant seems to have not
really understood the answers you have been pointed to
A document which is PDF/A will have several things in it according to a
standard. That is unlikely to mean that just adding some headers to a file will
make it therefore compliant if there are other issues too. It may, but it may
not. Starting by making a document of the right type would seem to always be
the right answer.
All cats are not black, just because a black cat has to be black, and painting
a white cat black does not make it so.
john renfrew
Right Way Up
From: Manulak Dissanayake
[mailto:manulak.dissanay...@ifsworld.com]<mailto:[mailto:manulak.dissanay...@ifsworld.com]>
Sent: 06 September 2012 09:16
To: Post all your questions about iText here
Subject: Re: [iText-questions] [SPAM] Re: PDF Validation error with PDF/A1b
complaince
Hi Leonard
Yes I read the specifications and documentations up to some extent. I have
tried several methods according to fulfill the required standards to be PDFA
complaint. One such is to edit the PDF Schema and add values to the "Keywords"
property, and then use it to generate new file with PDFA compliance. This was
not successful and have tried many solutions. Some said that iText cannot
specifically convert PDF to PDFA complaint ones, and some said it is bit tricky
and hardy to do so. But I didn't find any clear way.
My FOP version is mighty old (version 0.20.5) has got many customizations so
that, I am in a problem of upgrading it to a newer version too. So without
touching FOP side, I wanted to convert the PDF to PDFA.
So the intention I got is like you can convert PDF files to PDFA complaint once
from iText and still no example or a such way was exposed.
I referred the recommendations of Apache FOP :
PDFA<http://xmlgraphics.apache.org/fop/1.0/pdfa.html> as well, and no luck yet.
Thanks you for the reply and any help on this issue including suggestions are
highly appreciated. I think my first mail (attached)consists of my situation,
and wish it will helpful for you to reply me with an idea...!
BstRgds;
Manulak
From: Leonard Rosenthol
[mailto:lrose...@adobe.com]<mailto:[mailto:lrose...@adobe.com]>
Sent: Wednesday, September 05, 2012 5:04 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] [SPAM] Re: PDF Validation error with PDF/A1b
complaince
Have you actually read the PDF/A-1 (ISO 19005-1) standard?
Have you read the PDF 1.4 specification, which PDF/A-1 is based on?
It seems like you are trying to do this entirely via guesswork rather than
reading the relevant documentation and understanding them...
Leonard
From: Manulak Dissanayake
[mailto:manulak.dissanay...@ifsworld.com]<mailto:[mailto:manulak.dissanay...@ifsworld.com]>
Sent: Wednesday, September 05, 2012 12:29 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] [SPAM] Re: PDF Validation error with PDF/A1b
complaince
Hi Again
I found and experienced that the conversion of an existing PDF to a PDF A
complaint ones is merely impossible (or very hard and long process to do so)
and still I found that the problem is with the PDF Schema values when the newly
added metadata values are not matching with them.
I further found that it is quite possible to read a PDF and edit the PDF Schema
meta data. So I tried reading the existing PDF to an existing PdfCopy, add
metadata to it, and then forward it to the convertPdfA() method which is stated
in my below mail.
But still it doesn't work. (Assume that the file1 is the existing PDF and the
file2 is the PDFA complaint file which is the output)
PdfReader reader = new PdfReader(new
RandomAccessFileOrArray(file1.getPath()), null);
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream(newFile));
HashMap info = reader.getInfo();
info.put("Subject", "Report Executor");
info.put("Author", "Report building logic");
info.put("Keywords", "PDF/A compliant");
info.put("Title", "Report");
info.put("Creator", "Application reporting");
stamper.setMoreInfo(info);
ByteArrayOutputStream bo = new ByteArrayOutputStream();
XmpWriter xmp = new XmpWriter(bo, info);
xmp.close();
stamper.setXmpMetadata(bo.toByteArray());
stamper.close();
(I call this method before calling the convertToPdfA method, and then it will
return file1 with modified PDF document information)
In my already existing PDF (which is to be converted to PDFA), only the
following metadata are there.
(When executed - reader.getInfo() )
[0] "Type => Info"
[1] "Producer => null"
My PDF which was converted to PDFA from my convertToPdfA method compliance to
PDFA/1b correctly when I removed the title, keywords and subject fields from
the PDF information.
(Removed code)
//document.addTitle(reader.getInfo().get("Title").toString());
//document.addKeywords(reader.getInfo().get("Keywords").toString());
//document.addSubject(reader.getInfo().get("Subject").toString());
So it confirms that the above three properties are not existing in PDF
dictionary values, and if anyhow we can add those values to the already created
PDF and then pass it to conversion, it should work.
How can I change my approach? As this is not working for me, do you have any
more suggestions?
Is that enough to update only the PDF Schema like this and then use my
convertToPdfA method given below?
Thank you in advance.
-Manulak Dissanayake
From: Manulak Dissanayake
Sent: Tuesday, September 04, 2012 10:59 AM
To:
itext-questions@lists.sourceforge.net<mailto:itext-questions@lists.sourceforge.net>
Subject: RE: [iText-questions] [SPAM] Re: PDF Validation error with PDF/A1b
complaince
Hi
Thanks for the information.
Creating the PDFs as PDFA complaint files from the scratch is my second option
as it is not possible right now. So I tried adding the schema values first to
the created PDF, and then create a new file which is a PDFA conversion of the
previous file.
In my method converToPDFA (which I explained in earlier messages), I added a
call before all as follows.
public void convertToPdfA(File file1, File file2) { \\ This "file2" will be
the newly converted file to PDFA
file1 = editPDFSchema(file1);
PdfReader reader = null;
Document document = null;
......................
And I added that new method as follows...
private File editPDFSchema(File file1) {
File newFile = null;
PdfReader reader = null;
Document document = null;
File newFile = null;
try {
PdfReader reader = new PdfReader(new
RandomAccessFileOrArray(file1.getPath()), null);
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream(newFile));
HashMap info = reader.getInfo();
info.put("Subject", "Report Designer Operational Report");
info.put("Author", "Report ");
info.put("Keywords", "PDF/A compliant");
info.put("Title", " Designer Report");
info.put("Creator", "Application");
stamper.setMoreInfo(info);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XmpWriter xmp = new XmpWriter(baos, info);
xmp.close();
stamper.setXmpMetadata(baos.toByteArray());
stamper.close();
return newFile;
} catch (Exception ex) {
writeLog(ex.getMessage());
return file1;
}
Still this makes the PDF as PDFA but does not validate.
Can you please help me to maybe update the already created PDF like that, and
then do the PDFA conversion?
Thank you in advance...!
- Manulak
-----Original Message-----
From: mkl
[mailto:m...@wir-sind-cool.org]<mailto:[mailto:m...@wir-sind-cool.org]>
Sent: Wednesday, August 29, 2012 2:07 PM
To:
itext-questions@lists.sourceforge.net<mailto:itext-questions@lists.sourceforge.net>
Subject: [iText-questions] [SPAM] Re: PDF Validation error with PDF/A1b
complaince
It is not strictly impossible to use iText to convert arbitrary PDFs to PDF/A
as the iText low level API allows you to to nearly everything allowed in PDF.
It is a very big project, though, especially if the PDFs to convert really are
arbitrary. It's safe to assume that programming that as a single developer
takes more than a year.
iText used to assume everyone uses the recommended namespace prefixes and,
therefore, failed for source PDFs which didn't.
But the metadata are merely a tiny part of the conversion problem. I would
propose you initially create PDFs as PDF/as, and for people who don't want
that, you stamp those PDF/as in a non-compliant manner. (If such a distinction
is required, that is!)
Regards, Michael
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/PDF-Validation-error-with-PDF-A1b-complaince-tp4655986p4656073.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat
landscape has changed and how IT managers can respond. Discussions will include
endpoint security, mobile security and the latest in malware threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net<mailto:iText-questions@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/ Please check the keywords list
before you ask for examples: http://itextpdf.com/themes/keywords.php
------------------------------------------------------------------------------
CONFIDENTIALITY AND DISCLAIMER NOTICE
This e-mail, including any attachments, is confidential and for use only by
the intended recipient. If you are not the intended recipient, please notify
us immediately and delete this e-mail from your system. Any use or disclosure
of the information contained herein is strictly prohibited. As internet
communications are not secure, we do not accept legal responsibility for the
contents of this message nor responsibility for any change made to this
message after it was sent by the original sender. We advise you to carry out
your own virus check as we cannot accept liability for damage resulting from
software viruses.
------------------------------------------------------------------------------
CONFIDENTIALITY AND DISCLAIMER NOTICE
This e-mail, including any attachments, is confidential and for use only by
the intended recipient. If you are not the intended recipient, please notify
us immediately and delete this e-mail from your system. Any use or disclosure
of the information contained herein is strictly prohibited. As internet
communications are not secure, we do not accept legal responsibility for the
contents of this message nor responsibility for any change made to this
message after it was sent by the original sender. We advise you to carry out
your own virus check as we cannot accept liability for damage resulting from
software viruses.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php