You're right about the specification but do you know of any validator that 
cares about it? (It will be fixed, nonetheless)

Paulo

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Schalück, Elmar
> Sent: Monday, August 18, 2008 10:53 AM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Problem with generating PDF/A with iText
>
> Hi,
> I'm building PDF/A documents with iText, but I have a problem
> with the validation.
>
> What's going wrong?
> The PDF/A specification demands in 6.1.8: ... The obj and
> endobj keywords shall each be followed by an EOL marker.
> This is the case for endobj, but not for obj.
> If you inspect the class
> com.lowagie.text.pdf.PdfIndirectObject, the lines
>     static final byte STARTOBJ[] = DocWriter.getISOBytes(" obj");
>     static final byte ENDOBJ[] = DocWriter.getISOBytes("\nendobj\n");
>
> show the difference.
>
> Can you please fix it?
>
> Regards,
> Elmar
>
> Here's my source code:
>         public static void main(String[] args) {
>                 Document document = new Document(PageSize.A4,
> 50, 50, 50, 50);
>                 PdfWriter pdfWriter;
>                 try {
>                         pdfWriter =
> PdfWriter.getInstance(document, new
> FileOutputStream("C:\\Projekte\\iText\\testpdfa.pdf"));
>
> pdfWriter.setPdfVersion(PdfWriter.PDF_VERSION_1_4);
>
> pdfWriter.setPDFXConformance(PdfWriter.PDFA1A);
>
>                         document.open();
>
>                         PdfDictionary outi = new
> PdfDictionary(PdfName.OUTPUTINTENT);
>
> outi.put(PdfName.OUTPUTCONDITIONIDENTIFIER, new
> PdfString("sRGB IEC61966-2.1"));
>                         outi.put(PdfName.INFO, new
> PdfString("sRGB IEC61966-2.1"));
>                         outi.put(PdfName.S, PdfName.GTS_PDFA1);
>                         ICC_Profile icc =
> ICC_Profile.getInstance(new
> FileInputStream("C:\\Projekte\\iText\\srgb.profile"));
>                         PdfICCBased ib = new PdfICCBased(icc);
>                         ib.remove(PdfName.ALTERNATE);
>                         outi.put(PdfName.DESTOUTPUTPROFILE,
> pdfWriter.addToBody(ib).getIndirectReference());
>
> pdfWriter.getExtraCatalog().put(PdfName.OUTPUTINTENTS, new
> PdfArray(outi));
>                         PdfDictionary markInfo = new
> PdfDictionary(PdfName.MARKINFO);
>                         markInfo.put(PdfName.MARKED, new
> PdfBoolean(true));
>
> pdfWriter.getExtraCatalog().put(PdfName.MARKINFO, markInfo);
>
>                         // Load Font
>                         InputStream ris = new
> FileInputStream("C:\\Projekte\\iText\\DejaVuSansMono.ttf");
>                         byte[] ttfAfm = IOUtils.toByteArray(ris);
>                         ris.close();
>                         BaseFont courier =
> BaseFont.createFont("DejaVuSansMono.ttf",
> BaseFont.IDENTITY_H, true, true, ttfAfm, null);
>
>                         document.add(new Chunk("TestString",
> new Font(courier,14)));
>                         pdfWriter.createXmpMetadata();
>                         document.close();
>                 } catch (FileNotFoundException e) {
>                         // TODO Auto-generated catch block
>                         e.printStackTrace();
>                 } catch (DocumentException e) {
>                         // TODO Auto-generated catch block
>                         e.printStackTrace();
>                 } catch (IOException e) {
>                         // TODO Auto-generated catch block
>                         e.printStackTrace();
>                 }
>
>
>         }


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to