Just to be clearer I attach below the code I'm trying now with XMLWorkerHelper

ByteArrayOutputStream pdfOut = new ByteArrayOutputStream();
       Document document = new Document();
       PdfWriter vPDFWriter;
       if (aPDF_A)
       {
          vPDFWriter = PdfAWriter.getInstance(document, pdfOut, 
PdfAConformanceLevel.PDF_A_1A);
          vPDFWriter.setPdfVersion(PdfAWriter.PDF_VERSION_1_4);
          vPDFWriter.createXmpMetadata();
          vPDFWriter.setTagged();

          vPDFWriter.getExtraCatalog().put(PdfName.LANG, new PdfString("it"));  
      
          vPDFWriter.getExtraCatalog().put(PdfName.MARKINFO, new 
PdfBoolean(true));

       }
       else
       {........
       }
       
       
       
       InputStream is = new ByteArrayInputStream(TESTO.getBytes());
         
     document.open();
     try
     {XMLWorkerHelper.getInstance().parseXHtml(vPDFWriter, document, is);}
     catch (Exception vExc)
     {vExc.printStackTrace();}
     
     document.close();
         vPDFWriter.close();
         return pdfOut;


Follows the Exception Stacktrace

com.itextpdf.text.pdf.PdfAConformanceException: All the fonts must be embedded. 
This one isn't: Helvetica
        at 
com.itextpdf.text.pdf.internal.PdfAConformanceImp.checkPdfAConformance(PdfAConformanceImp.java:90)
        at 
com.itextpdf.text.pdf.PdfAWriter.checkPdfIsoConformance(PdfAWriter.java:204)
        at 
com.itextpdf.text.pdf.PdfWriter.checkPdfIsoConformance(PdfWriter.java:3267)
        at com.itextpdf.text.pdf.PdfWriter.addSimple(PdfWriter.java:2200)
        at 
com.itextpdf.text.pdf.PdfContentByte.setFontAndSize(PdfContentByte.java:1585)
        at 
com.itextpdf.text.pdf.PdfDocument.writeLineToContent(PdfDocument.java:1482)
        at com.itextpdf.text.pdf.PdfDocument.flushLines(PdfDocument.java:1217)
        at com.itextpdf.text.pdf.PdfDocument.newPage(PdfDocument.java:836)
        at com.itextpdf.text.pdf.PdfDocument.close(PdfDocument.java:760)
        at com.itextpdf.text.Document.close(Document.java:398)
        at it.consoft.MotoreUtil.newMethod(MotoreUtil.java:104)
        at it.consoft.MotoreUtil.main(MotoreUtil.java:60)



Dott.ssa Fulvia Grignaschi

-----Messaggio originale-----
Da: iText Info [mailto:i...@1t3xt.info] 
Inviato: giovedì 12 giugno 2014 10.36
A: itext-questions@lists.sourceforge.net
Oggetto: Re: [iText-questions] I'm subscribed! please do not thrash this 
message.

1. Which version of iText are you using?
Only the latest versions have good PDF/A support. You need the itext-xtra jar 
and you need the PdfAWriter class.
2. You're using HTMLWorker
This class has been abandoned in favor of XML Worker: 
http://itextpdf.com/sandbox/xmlworker
3. I don't see you creating a FontProvider instance anywhere.

Please start studying PdfAWriter and XML Worker.
Then return to the mailing-list if you have further questions.

Fulvia Grignaschi schreef op 12/06/2014 9:17:
>
> Hi I'm newby and facing a struggling issue. I must create a PDF/A file 
> with arial font starting from html files and obviously must be able to 
> keep format information (bold, italic etc.).
>
> This is a snippet of my code
>
> BaseFont baseFontGenerale = BaseFont./createFont/(/FONTS_PATH/ + 
> "/arial.ttf", BaseFont./CP1252/, BaseFont./EMBEDDED/);
>
> baseFontGenerale.setSubset(*true*);
>
> StyleSheet vStyleSheet = *new* StyleSheet();
>
> vStyleSheet.loadTagStyle(HtmlTags.BODY,HtmlTags.FACE, "_Arial_ 
> _Unicode_ MS");
>
> List <Element> vElements = _HTMLWorker_./_parseToList_/_(*new*
> StringReader(/TESTO/), vStyleSheet)_;
>
> .................
>
> These instructions avoid the Helvetica not embedded exception to be 
> thrown and everything works fine on Windows but on Unix platform the 
> exception continues to be thrown.
>
> Any help would be appreciated.
>
> Thanks
>
> Fulvia Grignaschi
>
> Dott.ssa Fulvia Grignaschi.
>
>
> Consoft Sistemi S.p.A.
> 20158 Milano - Via G. Candiani 73
>
> Centralino: +39 02 48022861 <tel:%2B39%2002%2048022861>- Fax: +39 02
> 43981857 <tel:%2B39%2002%2043981857>
> Diretto: +39 02 99315143 <tel:%2B39%2002%2099315143>
> e-mail: fulvia.grignas...@consoft.it 
> <mailto:fulvia.grignas...@consoft.it>
> Web http://www.consoft.it <http://www.consoft.it/>
>
>
>
> ----------------------------------------------------------------------
> -------- HPCC Systems Open Source Big Data Platform from LexisNexis 
> Risk Solutions Find What Matters Most in Your Big Data with HPCC 
> Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration 
> http://p.sf.net/sfu/hpccsystems
>
>
> _______________________________________________
> 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


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find 
What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. 
Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration 
http://p.sf.net/sfu/hpccsystems _______________________________________________
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

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
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

Reply via email to