From 85ec627dba6daa69ea41593e5b1258ba589cadb3 Mon Sep 17 00:00:00 2001 From: pdanner Date: Mon, 8 Nov 2010 15:35:20 +0000 Subject: added compression for signature update block (excluding xobject, including fonts!) added subsetting for pdfa caption font git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@605 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../wag/egov/egiz/pdf/PDFSignatureObjectIText.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/knowcenter') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFSignatureObjectIText.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFSignatureObjectIText.java index 94abc17..48acb87 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFSignatureObjectIText.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFSignatureObjectIText.java @@ -303,7 +303,7 @@ public class PDFSignatureObjectIText implements PDFSignatureObject String fontPath = SettingsReader.RESOURCES_PATH + "fonts" + File.separator + fontName; logger_.debug("Instantiating \"" + fontPath + "\"."); - font = new Font(BaseFont.createFont(fontPath, BaseFont.WINANSI, true), fontSize); + font = new Font(BaseFont.createFont(fontPath, BaseFont.WINANSI, true), fontSize); fontMap_.put(fontString, font); } return font; @@ -340,7 +340,15 @@ public class PDFSignatureObjectIText implements PDFSignatureObject String profileid = sigObject_.getSignatureTypeDefinition().getType(); String pdfa = SettingsReader.getInstance().getSetting("sig_obj." +profileid+".key."+SIG_PDFA1_B_VALID, "default."+SIG_PDFA1_B_VALID, "false"); pdfaValid= "true".equalsIgnoreCase(pdfa); - SubsetLocal.set(!pdfaValid); + +// exthex test + //SubsetLocal.set(!pdfaValid); + +// boolean forceSubset = true; // get this from config, default to false + //String + + //SubsetLocal.set(true); // exthex + logger_.trace("Sign PDF/A compliant:"+pdfa); } catch (SettingsException e1) { @@ -378,7 +386,12 @@ public class PDFSignatureObjectIText implements PDFSignatureObject if (pdfaValid) { throw new PDFDocumentException(ErrorCode.NO_EMBEDABLE_TTF_CONFIGURED_FOR_PDFA, "PDF/A modus requires an embedable true type font"); } - cell_font = getCellFont(font_string); + cell_font = getCellFont(font_string); + + } + // exthex + if (pdfaValid && abstractCell.getType() == Entry.TYPE_VALUE) { + SubsetLocal.addNonSubsetFont(cell_font.getBaseFont()); } Phrase text_phrase = new Phrase(text, cell_font); pdf_cell = new PdfPCell(text_phrase); @@ -543,6 +556,7 @@ public class PDFSignatureObjectIText implements PDFSignatureObject */ private PdfPTable createPDFSignatureObject(SignatureObject sigObject) throws PDFDocumentException { + SubsetLocal.clear(); Table table = sigObject.getAbstractTable(); PdfPTable pdf_table = renderTable(table); return pdf_table; -- cgit v1.2.3