-none- 2007-09-10 - By Max
Back Hello!
I have a "com.lowagie.text.pdf.PdfXConformanceException: All the fonts must be embedded." Exception by the following code!
try { Document document = new Document(PageSize.A4.rotate()); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream( "e:/temp/landscapeportraitPDF.pdf")); writer.setPDFXConformance(PdfWriter.PDFA1A); document.open(); Font font = new Font(BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.WINANSI, true)); document.add(new Paragraph( "landscape format, just make the height smaller than the width.", font)); document.close();
} catch (Exception e) { e.printStackTrace(); }
embedded is true but BaseFont.TIMES_ROMAN in an BuiltinFonts14 Font and in BaseFont -> public static BaseFont createFont(String name, String encoding, boolean embedded, boolean cached, byte ttfAfm[], byte pfb[], boolean noThrow) throws DocumentException, IOException {...
if (isBuiltinFonts14 || isCJKFont) embedded = false; ...
-> embedded switch to false!
and the same in Type1Font -> Type1Font(String afmFile, String enc, boolean emb, byte ttfAfm[], byte pfb[]) throws DocumentException, IOException ...
if (BuiltinFonts14.containsKey(afmFile)) { embedded = false; ...
Is this correct? How is the correct solution for my problem?
Thanks Max
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|