Eclipse BIRT 4.25 Reports: Page Totals, PDF/A and JDK 21

2026-11-03来源 dev.to JavaEnglish

We ran Eclipse BIRT 4.25.0, the Eclipse Foundation's Java reporting engine, released on 9 September 2026, on JDK 25, checked its advisory records, and wrote down each problem that came up. Some come from how BIRT lays out HTML, some from the release itself, and one from an old artifact still sitting on Maven Central. Each item below has the run output or the record behind it, who it hits, and the fix BIRT offers where there is one.

We work at Iron Software, and the end of this article covers our library, IronPDF.

Does BIRT Render Flexbox, Grid or JavaScript?

It does not, and the reason is structural. Every IReportEngine method that opens an input takes a design or a stored report document, which means an existing HTML page has no way in until someone rebuilds it as a .rptdesign. Inside a design, HTML can fill a text item, and BIRT's own layout code positions it. This test design packs a flex row, a CSS grid and a document.write script into a single text item, adds a 150-row table, and writes its footer with value-of page variables.

<?xml version="1.0" encoding="UTF-8"?> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23"> <data-sources> <script-data-source name="Generated"/> </data-sources> <data-sets> <script-data-set name="Rows"> <list-property name="resultSetHints"> <structure> <property name="position">1</property> <property name="name">line</property> <property name="dataType">string</property> </structure> </list-property> <property name="dataSource">Generated</property> <method name="open"><![CDATA[counter = 0;]]></method> <method name="fetch"><![CDATA[if (counter == 150) return false; counter++; row["line"] = "Row " + counter; return true;]]></method> </script-data-set> </data-sets> <page-setup> <simple-master-page name="Simple MasterPage"> <property name="type">a4</property> <page-footer> <text> <property name="contentType">html</property> <text-property name="content"><![CDATA[Page <value-of>pageNumber</value-of> of <value-of>totalPage</value-of>]]></text-property> </text> </page-footer> </simple-master-page> </page-setup> <body> <text> <property name="contentType">html</property> <text-property name="content"><![CDATA[<div style="display:flex"><div style="width:50%">Flex left</div><div style="width:50%">Flex right</div></div> <div style="display:grid; grid-template-columns:1fr 1fr"><div>Grid A</div><div>Grid B</div></div> <script>document.write("Written by script");</script> <p>After the script tag</p>]]></text-property> </text> <table> <property name="dataSet">Rows</property> <list-property name="boundDataColumns"> <structure> <property name="name">line</property> <expression name="expression" type="javascript">dataSetRow["line"]</expression> </structure> </list-property> <column/> <detail> <row> <cell><data><property name="resultSetColumn">line</property></data></cell> </row> </detail> </table> </body> </report> 

The class below runs it in two steps, storing a .rptdocument first and rendering the PDF from that document.

import java.util.logging.Level; import org.eclipse.birt.core.framework.Platform; import org.eclipse.birt.report.engine.api.EngineConfig; import org.eclipse.birt.report.engine.api.IRenderTask; import org.eclipse.birt.report.engine.api.IReportDocument; import org.eclipse.birt.report.engine.api.IReportEngine; import org.eclipse.birt.report.engine.api.IReportEngineFactory; import org.eclipse.birt.report.engine.api.IRunTask; import org.eclipse.birt.report.engine.api.PDFRenderOption; public class IssueReportTwoStep { public static void main(String[] args) throws Exception { EngineConfig config = new EngineConfig(); config.setLogConfig(null, Level.WARNING); Platform.startup(config); IReportEngine engine = ((IReportEngineFactory) Platform .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY)) .createReportEngine(config); try { // Run once into a report document, so the page count is known before rendering. IRunTask run = engine.createRunTask(engine.openReportDesign("known-issues.rptdesign")); run.run("known-issues.rptdocument"); run.close(); IReportDocument document = engine.openReportDocument("known-issues.rptdocument"); System.out.println("Pages: " + document.getPageCount()); IRenderTask render = engine.createRenderTask(document); PDFRenderOption options = new PDFRenderOption(); options.setOutputFormat(PDFRenderOption.OUTPUT_FORMAT_PDF); options.setOutputFileName("known-issues-two-step.pdf"); render.setRenderOption(options); render.render(); render.close(); document.close(); } finally { engine.destroy(); Platform.shutdown(); } } } 

Console output was Pages: 4, and known-issues-two-step.pdf, at about 3 KB, shows the layout problem on page one. All four boxes from the flex row and the grid sit one per line at the same 6.5 mm left offset, so no columns formed, and no page contains the string Written by script. The 4.25.0 source lines up with that. Its DisplayManager registers sixteen display keywords, among them block, inline, list-item and the table types, and none of them is flex or grid, and the code that turns HTML into PDF content skips over script nodes. Teams moving HTML templates or script-drawn charts into BIRT feel this most. The BIRT answer is to redo the layout with designer grids and tables, and to draw charts with BIRT's chart engine.

Why Does the Footer Say Page 2 of 2?

That same footer gave two different results depending on the task. Run as above, through IRunTask and then IRenderTask, the four pages read Page 1 of 4 to Page 4 of 4. Run through a single IRunAndRenderTask, every page claimed to be the last one, from Page 1 of 1 up to Page 4 of 4, the total keeping pace with the current page. Single-task runs of any multi-page report with this footer are affected. Besides the two-step run, the designer's auto-text items for page number and total page print the right count in one task, which a separate run of the design confirmed with Page 2 of 4 on page two.

Why Does PDF/A Output Stop on Times-Roman?

Archival output is a property of the design. BIRT's PDF emitter README names it PdfEmitter.Conformance (since 4.16), and in the XML it is one line under <report>.

<property name="pdfConformance">PDF.A1B</property> 

Adding just that line to known-issues.rptdesign and pointing the two-step class at the copy got as far as Pages: 4. Rendering then failed. A warning came first (Times not embeddable), then an EngineException whose cause, PdfXConformanceException, named Times-Roman as unembedded, and the PDF on disk was 0 bytes. Times-Roman is a base-14 font that BIRT references without embedding, so a design left on the default font cannot become PDF/A as it stands. Two fixes exist in BIRT itself, an embeddable font such as Arial set on the report style, or the PdfEmitter.PDFA.FallbackFont setting from the README. The Arial route came to roughly 35 KB, and veraPDF 1.30.3 accepted it as PDF/A-1b.

Why Won't BIRT 4.25 Compile on JDK 17?

The 4.21.0 release notes record the change that moved BIRT's bundles to JavaSE-21, and every engine jar with code in it since then is compiled to class file version 65. The 4.20.0 engine still targeted Java 11. Point a JDK 17 compiler at a 4.25.0 project and it stops at the first BIRT import, because javac reads Platform.class as version 65 where it can load at most 61. Teams still on Java 11 or 17 upgrade the JVM first, or hold at 4.20.0, the last Java 11 release.

The Maven layout adds two more issues. Central's all-in-one birt-runtime artifact has not moved past 4.9.0 from May 2022, so a 4.25.0 build lists the engine modules one by one, and a missing module surfaces only when a report runs.

  • Without org.eclipse.birt.report.engine.emitter.pdf, the run step still prints Pages: 4, and render() then ends in UnsupportedFormatException because no PDF writer is installed.
  • Without org.eclipse.birt.report.engine.script.javascript, data engine creation fails during the run step on No such script extension : javascript., so no PDF is written.

The bundled 4.25.0 runtime comes from the Eclipse download site instead, as a zip of 290,887,286 bytes. The project's license is the Eclipse Public License 2.0.

Is the BIRT Report Viewer Affected by CVEs?

Yes, in older builds, and one of those builds is still the newest Viewer on Maven Central. NVD records four BIRT CVEs, all in the Report Viewer, the servlet application that serves reports over HTTP, each scored by NIST and none disputed.

  • CVE-2021-34427, CVSS 3.1 score 9.8: Crafted query parameters write a remotely reachable JSP into the viewer folder, through 4.8.0.
  • CVE-2023-0100, CVSS 3.1 score 8.8: A tampered Host header lets the viewer fetch a report from an absolute HTTP path, from 2.6.2 until the 4.13 fix.
  • CVE-2019-11776, CVSS 3.1 score 6.1: Reflected XSS through a viewer URL parameter, versions 1.0 to 4.7.
  • CVE-2009-4521, CVSS 2.0 score 4.3: Cross-site scripting in the __report parameter of birt-viewer/run, before 2.5.0.

Exposure depends on where the Viewer is fetched from. Search Central for org.eclipse.birt.report.viewer and the newest hit is 4.9.0, uploaded 2 May 2022, a version that GHSA-4grc-q4fj-45p8 places inside the CVE-2023-0100 range. Deployments built from that coordinate carry the flaw. A patched birt.war ships inside the 4.25.0 runtime zip on the Eclipse download site. On 2 November 2026, OSV showed no advisories against the 4.25.0 engine or any of the 70 jars it pulled into the test build.

For reports that can start as HTML, IronPDF for Java is a commercial library our team builds that avoids the layout and footer issues above. Chromium does the drawing, and in our 2026.10.1 run a flex row and a grid each split into two columns while a script wrote its line. Java 8 and later can use it through a single Maven dependency, com.ironsoftware:ironpdf, which fetches the Chromium engine on first run or from a platform ironpdf-engine artifact, and Central lists ten 2026 versions up to 2026.10.1 from 1 October. A free trial covers evaluation.

Footers come from addTextFooter, which stamps {page} and {total-pages} onto the finished document, and saveAsPdfA with PdfAVersions.PdfA1b writes PDF/A. The PDF lands in a file or a byte array for the caller, so nothing like the Report Viewer has to be deployed.

Where These BIRT Issues Leave a Java Team

A JDK 21 floor, a Maven layout that needs hand-picked modules, no flex or grid display values, dropped scripts, a page total that depends on the task, PDF/A refusing the default Times font and a 2022 Viewer on Central with a known CVE are the issues to check before a BIRT upgrade, especially for a report that already exists as HTML.

IronPDF for Java renders that kind of report from a template on Java 8 or later, with rendering done in the separate engine process the IronPdfEngine guide describes.

Eclipse BIRT is a trademark of the Eclipse Foundation, we have no affiliation with the Foundation, and the versions, advisories and run results above rest on public records and our own test runs from 2 November 2026.

Drafted with AI. BIRT code run and claims checked by the Iron Software DevRel team against Eclipse BIRT 4.25.0 and com.ironsoftware:ironpdf 2026.10.1 on 2 November 2026.

原文:https://www.a8q9.cn/en/article/eclipse-birt-4-25-reports-page-totals-pdf-a-and-jdk-21-2e5f4b.html

相关文章