diff --git a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPage.java b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPage.java index e258dbd9ffd..8345f04090c 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPage.java +++ b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPage.java @@ -462,6 +462,8 @@ private void drawText(String text, float textX, float textY, FontInfo fontInfo, contentByte.setColorStroke(color); } BaseFont font = getBaseFont(fontInfo); + font.setIncludeCidSet(this.pageDevice.getPdfIncludeCidSet()); + float fontSize = fontInfo.getFontSize(); try { // PDF/A: if font not embeddable then use the configured PDF/A fallback font diff --git a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPageDevice.java b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPageDevice.java index 2aa012158a8..10625b1aa98 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPageDevice.java +++ b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPageDevice.java @@ -166,6 +166,8 @@ public class PDFPageDevice implements IPageDevice { private final static String PDFA_FALLBACK_FONT = "PdfEmitter.PDFA.FallbackFont"; + private final static String PDF_FONT_CID_SET = "PdfEmitter.IncludeCidSet"; + protected Map userProperties; private char pdfVersion = '0'; @@ -178,6 +180,8 @@ public class PDFPageDevice implements IPageDevice { private String defaultFontPdfA = null; + private boolean includeFontCidSet = true; + /** * * Constructor to define the PDF @@ -207,6 +211,8 @@ public PDFPageDevice(OutputStream output, String title, String author, String su this.setPdfConformance(); // PDF/A, set the default font of not embeddable fonts this.setDefaultFontPdfA(); + // PDF include font CID set stream + this.setPdfIncludeCidSet(); // PDF/A (A1A, A1B), avoid compression and transparency if (!this.isPdfAFormat) { @@ -867,4 +873,33 @@ public void setDefaultFontPdfA(String defaultFont) { public String getDefaultFontPdfA() { return this.defaultFontPdfA; } + + /** + * Set the including of a font CIDSet stream the document. When set to true, a + * CIDSet stream will be included in the document. When set to false, no CIDSet + * stream will be included. + */ + private void setPdfIncludeCidSet() { + if (this.userProperties != null && this.userProperties.containsKey(PDFPageDevice.PDF_FONT_CID_SET)) + this.includeFontCidSet = Boolean + .parseBoolean(this.userProperties.get(PDFPageDevice.PDF_FONT_CID_SET).toString()); + } + + /** + * Set the including of a font CIDSet stream the document + * + * @param includeFontCidSet include CIDSet stream of a font to the document + */ + public void setPdfIncludeCidSet(Boolean includeFontCidSet) { + this.includeFontCidSet = includeFontCidSet; + } + + /** + * Get the instruction to include CIDSet stream of fonts + * + * @return the CIDSet shall be included + */ + public boolean getPdfIncludeCidSet() { + return this.includeFontCidSet; + } } diff --git a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md index 49b724b06a5..fa95b6e44fe 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md +++ b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md @@ -63,6 +63,17 @@ The following list get an overview of all supported user properties, the content Values file name with full path or list of file names Default empty (null) + +**PdfEmitter.IncludeCidSet** + + Content include the CIDSet stream of a font into the document + Location report + Data type boolean + Values true, CIDSet will be included + false, CIDSet won't be included + Default true + Since 4.17 + **PdfEmitter.PDFA.FallbackFont** Content fall back font to create the pdf/a document correctly,