Hello,
thanks for looking at this issue.
I discovered another thing. When i create a pdfa-1B with the metadata, the
result pdf it's not in pdfa-1B conformance. But, when i don't put the title
AND the subject, the result pdfa-1B is in the conformance.
@PDFA-1B With full metadata:
My code:
public static void main(String[] args) throws DocumentException, IOException
{
System.out.print("#> RUNING...");
Document document = new Document(PageSize.A4);
File outputFile = new File("out-pdfa1b.pdf");
FileOutputStream fos = new FileOutputStream(outputFile);
PdfAWriter writer = PdfAWriter.getInstance(document, fos,
PdfAConformanceLevel.PDF_A_1B);
String title = new String("Test Title");
String author = new String("Test Author");
String subject = new String("Test Subject");
String creator = new String("Test Creator");
String keywords = new String("Keyword Test0, Keyword Test1");
document.addTitle(title);
document.addAuthor(author);
document.addSubject(subject);
document.addCreator(creator);
document.addKeywords(keywords);
writer.createXmpMetadata();
document.open();
String FONT = "c:/windows/fonts/arial.ttf";
Font font = FontFactory.getFont(FONT, BaseFont.CP1252,
BaseFont.EMBEDDED);
document.add(new Paragraph("Hello World", font));
InputStream iccFis =
ImageToPdfXmp.class.getResourceAsStream("sRGB.profile");
ICC_Profile icc = ICC_Profile.getInstance(iccFis);
writer.setOutputIntents("Custom", "", "http://www.color.org", "sRGB
IEC61966-2.1", icc);
document.close();
writer.close();
fos.flush();
fos.close();
System.out.println("DONE.");
}
@PDFA-1B Without title and subject metadata:
My code:
public static void main(String[] args) throws DocumentException, IOException
{
System.out.print("#> RUNING...");
Document document = new Document(PageSize.A4);
File outputFile = new File("out-pdfa1b.pdf");
FileOutputStream fos = new FileOutputStream(outputFile);
PdfAWriter writer = PdfAWriter.getInstance(document, fos,
PdfAConformanceLevel.PDF_A_1B);
//String title = new String("Test Title");
String author = new String("Test Author");
//String subject = new String("Test Subject");
String creator = new String("Test Creator");
String keywords = new String("Keyword Test0, Keyword Test1");
//document.addTitle(title);
document.addAuthor(author);
//document.addSubject(subject);
document.addCreator(creator);
document.addKeywords(keywords);
writer.createXmpMetadata();
document.open();
String FONT = "c:/windows/fonts/arial.ttf";
Font font = FontFactory.getFont(FONT, BaseFont.CP1252,
BaseFont.EMBEDDED);
document.add(new Paragraph("Hello World", font));
InputStream iccFis =
ImageToPdfXmp.class.getResourceAsStream("sRGB.profile");
ICC_Profile icc = ICC_Profile.getInstance(iccFis);
writer.setOutputIntents("Custom", "", "http://www.color.org", "sRGB
IEC61966-2.1", icc);
document.close();
writer.close();
fos.flush();
fos.close();
System.out.println("DONE.");
}
@Results
pdfa-1b with title and subject:
https://www.dropbox.com/s/39vof3x76zrv1ct/pdfa1b-withTitleAndSubjectMetadata.jpg
preflight report:
https://www.dropbox.com/s/erbp7xqwq1kgott/pdfa1b-withTitleAndSubjectMetadata-preflightReport.jpg
pdfa-1b without title and subject:
https://www.dropbox.com/s/h1fiwl66imj4888/pdfa1b-withoutTitleAndSubjectMetadata.jpg
the two problems are related? When you fix one the problem with pdfa-1b will
be fixed too?
ps: i attached the two files.
out-pdfa1b-withTitleAndSubject.pdf
<http://itext-general.2136553.n4.nabble.com/file/n4658377/out-pdfa1b-withTitleAndSubject.pdf>
out-pdfa1b-withoutTitleAndSubject.pdf
<http://itext-general.2136553.n4.nabble.com/file/n4658377/out-pdfa1b-withoutTitleAndSubject.pdf>
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Itext-5-4-1-Metadata-Bug-tp4658360p4658377.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
iText-questions mailing list
[email protected]
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