Error in PDF Validation with Mustang: A CIDSet entry in the Font descriptor does not correctly identify all glyphs present in the embedded font subset

  Kiến thức lập trình

I am using JasperReports to generate PDF documents and attempting to validate them with the Mustang library via

ZUGFeRDValidator validator = new ZUGFeRDValidator();
return validator.validate("./mypdf.pdf");

However, I encounter the following error: "A CIDSet entry in the Font descriptor does not correctly identify all glyphs present in the embedded font subset."

I am using the following libraries:

  • JasperReports Version: 6.21.3
  • Mustang Validator Version: 2.11.0
  • PDFBox Version: 3.0.2

Here is the code I use to create pdfs:

generate(JasperReport report, Map<String,Object> data) {
            JasperPrint print = JasperFillManager.fillReport(report, data, new JREmptyDataSource());
            JRPdfExporter exporter = new JRPdfExporter();
            exporter.setExporterInput(new SimpleExporterInput(print));
            exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(document));

            SimplePdfExporterConfiguration exportConfig = new SimplePdfExporterConfiguration();
            exportConfig.setMetadataAuthor("Your Name");



The fonts that I’m using are OpenSans fonts:

In my fontsfamily.xml:

<?xml version="1.0" encoding="UTF-8"?>
    <fontFamily name="OpenSans">
        <!-- Normal Font -->
        <!-- Bold Font -->
        <!-- Italic Font -->
        <!-- Bolt italic Font -->
        <!-- Is font is embedded in PDF -->

In my


I suspected that there might be an issue with how I embed the font, so here are my attempts:

  • I have ensured that the fonts are embedded as subsets by using the isPdfEmbedded attribute like this:
<style name="Standard" isDefault="true" pattern="" fontName="OpenSans" fontSize="10" isPdfEmbedded="true"/>

The pdf acrobat reader also shows in the font properties that a subset of the font is embedded.

  • The error also occurs when I comment out all text from the .jrxml report template, leaving only the font styles embedded.

  • I tried out another font as well (DejaVu Sans), to see if OpenSans is the problem but it didn’t work either.

I know that the error is related to a CIDSet, but it seems that it is implicit which I might have no control of?

What else can I do?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website