<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: IronSoftware</title>
    <description>The latest articles on DEV Community by IronSoftware (@ironsoftware).</description>
    <link>https://dev.to/ironsoftware</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F714737%2F30e70529-1628-476f-9a14-3b157c0f5c82.png</url>
      <title>DEV Community: IronSoftware</title>
      <link>https://dev.to/ironsoftware</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ironsoftware"/>
    <language>en</language>
    <item>
      <title>HTML 轉 PDF C# 實作，比較 4 款函式庫的中文頁首頁尾與頁碼</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Mon, 09 Nov 2026 00:04:21 +0000</pubDate>
      <link>https://dev.to/ironsoftware/html-zhuan-pdf-c-shi-zuo-bi-jiao-4-kuan-han-shi-ku-de-zhong-wen-ye-shou-ye-wei-yu-ye-ma-286f</link>
      <guid>https://dev.to/ironsoftware/html-zhuan-pdf-c-shi-zuo-bi-jiao-4-kuan-han-shi-ku-de-zhong-wen-ye-shou-ye-wei-yu-ye-ma-286f</guid>
      <description>&lt;p&gt;報表與合約轉成 PDF 後，頁首的公司名稱與頁尾的「第 X 頁，共 Y 頁」可以讓讀者確認文件來源與頁數。本文以 C# 將同一份繁體中文 HTML 轉成 PDF（HTML to PDF），比較 &lt;a href="https://ironpdf.com/features/" rel="noopener noreferrer"&gt;IronPDF&lt;/a&gt;、PuppeteerSharp、DinkToPdf 與 iText pdfHTML 如何加入中文頁首頁尾與頁碼，並以 &lt;a href="https://pymupdf.readthedocs.io/en/latest/" rel="noopener noreferrer"&gt;PyMuPDF&lt;/a&gt; 逐頁檢查輸出。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;我們任職於 Iron Software，文中的 IronPDF 是我們的產品。&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;本文由 AI 協助撰寫，文中程式碼於 2026 年 11 月 9 日以 IronPdf 2026.11.1、PuppeteerSharp 25.15.0、DinkToPdf 1.0.8 與 itext.pdfhtml 6.3.4 實際執行。&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  測試條件
&lt;/h2&gt;

&lt;p&gt;測試在 Windows 11 與 .NET 10 SDK 10.0.400 上執行。測試頁面 doc.html 是一份 60 段的繁體中文年度報告，內文字型為微軟正黑體。頁首文字為「台灣範例科技股份有限公司」，頁尾為「第 X 頁，共 Y 頁」。每份 PDF 都檢查四個項目，分別是每一頁的頁首頁尾文字、頁碼、使用的字型，以及擷取出的文字是否與原文相同。&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;HtmlHeaderFooter&lt;/code&gt; 頁首頁尾
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe3qmhwa4umuouy3w6l3g.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe3qmhwa4umuouy3w6l3g.webp" alt="IronPDF 官網首頁，標題為「The C# PDF Library」，並有 NuGet 安裝與 30 天試用按鈕" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;IronPDF 官網&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;IronPDF 的 &lt;code&gt;HtmlHeaderFooter&lt;/code&gt; 以一段 HTML 定義頁首或頁尾，&lt;code&gt;{page}&lt;/code&gt; 與 &lt;code&gt;{total-pages}&lt;/code&gt; 代表目前&lt;a href="https://ironpdf.com/how-to/page-numbers/" rel="noopener noreferrer"&gt;頁碼&lt;/a&gt;與總頁數。官方的 &lt;a href="https://ironpdf.com/examples/html-headers-and-footers/" rel="noopener noreferrer"&gt;HTML 頁首頁尾範例&lt;/a&gt;也使用同一組佔位符。&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;IronPdf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ChromePdfRenderer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RenderingOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HtmlHeader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HtmlHeaderFooter&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;HtmlFragment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;div style='text-align:center; font-family:Microsoft JhengHei'&amp;gt;台灣範例科技股份有限公司&amp;lt;/div&amp;gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RenderingOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HtmlFooter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HtmlHeaderFooter&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;HtmlFragment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;div style='text-align:center; font-family:Microsoft JhengHei'&amp;gt;第 {page} 頁，共 {total-pages} 頁&amp;lt;/div&amp;gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;pdf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RenderHtmlAsPdf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ReadAllText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"doc.html"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SaveAs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ironpdf-headers.pdf"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;輸出共 5 頁，每一頁的頁首、頁尾與頁碼都正確，字型為微軟正黑體。詳細設定可參考 IronPDF 的&lt;a href="https://ironpdf.com/how-to/headers-and-footers/" rel="noopener noreferrer"&gt;頁首頁尾教學&lt;/a&gt;，中文字型與編碼則可參考 &lt;a href="https://ironpdf.com/how-to/utf-8/" rel="noopener noreferrer"&gt;UTF-8 與多國語言說明&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F80f0b8npqt96f5u718zd.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F80f0b8npqt96f5u718zd.webp" alt="IronPDF 第 1 頁的中文頁首「台灣範例科技股份有限公司」與頁尾「第 1 頁，共 5 頁」" width="800" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;上圖為 IronPDF 輸出的第 1 頁頁首與頁尾。&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;HeaderTemplate&lt;/code&gt; 與 &lt;code&gt;FooterTemplate&lt;/code&gt; 範本
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Filqeq4p3rahpwosmm06l.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Filqeq4p3rahpwosmm06l.webp" alt="PuppeteerSharp 官網首頁，標題為「Drive the browser from C#.」，並列出 dotnet add package 安裝指令" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;PuppeteerSharp 官網&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;PuppeteerSharp 透過 Chrome 的&lt;a href="https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF" rel="noopener noreferrer"&gt;列印功能&lt;/a&gt;產生 PDF，範本中 class 為 &lt;code&gt;pageNumber&lt;/code&gt; 與 &lt;code&gt;totalPages&lt;/code&gt; 的元素會被替換成頁碼與總頁數。&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;PuppeteerSharp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;PuppeteerSharp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Media&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LaunchOptions&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Headless&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;ExecutablePath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; @&lt;span class="s2"&gt;"C:\Program Files\Google\Chrome\Application\chrome.exe"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;Puppeteer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;LaunchAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NewPageAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SetContentAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ReadAllText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"doc.html"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PdfAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"puppeteerfont-headers.pdf"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfOptions&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Format&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PaperFormat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;A4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;DisplayHeaderFooter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;HeaderTemplate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;div style='width:100%; text-align:center; font-size:10px; font-family:Microsoft JhengHei'&amp;gt;台灣範例科技股份有限公司&amp;lt;/div&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;FooterTemplate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;div style='width:100%; text-align:center; font-size:10px; font-family:Microsoft JhengHei'&amp;gt;第 &amp;lt;span class='pageNumber'&amp;gt;&amp;lt;/span&amp;gt; 頁，共 &amp;lt;span class='totalPages'&amp;gt;&amp;lt;/span&amp;gt; 頁&amp;lt;/div&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;MarginOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MarginOptions&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"60px"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Bottom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"60px"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5 頁的頁首頁尾與頁碼都正確。範本未指定字型時，Chrome 以簡體中文字型 Microsoft YaHei 顯示中文，數字則使用 Arial，上方程式碼因此在 style 中加入 &lt;code&gt;font-family:Microsoft JhengHei&lt;/code&gt;。本次以 &lt;code&gt;ExecutablePath&lt;/code&gt; 指向本機的 Chrome 157。&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;HeaderSettings&lt;/code&gt; 與 &lt;code&gt;FooterSettings&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpf2uqxgauu0ykqcap2m2.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpf2uqxgauu0ykqcap2m2.webp" alt="DinkToPdf 的 GitHub 儲存庫，最新發行版為 v1.0.8，多數檔案的最後更新在 9 年前" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;DinkToPdf 的 GitHub 頁面&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;DinkToPdf 是 wkhtmltopdf 的 C# 包裝，本文以 &lt;code&gt;HeaderSettings&lt;/code&gt; 與 &lt;code&gt;FooterSettings&lt;/code&gt; 的純文字屬性設定頁首頁尾，兩者另有 &lt;code&gt;HtmUrl&lt;/code&gt; 可指定 HTML 頁首頁尾。&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nc"&gt;DinkToPdf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;converter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SynchronizedConverter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfTools&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HtmlToPdfDocument&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;GlobalSettings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;PaperSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PaperKind&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;A4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nc"&gt;Margins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MarginSettings&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Bottom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nc"&gt;Out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"dinktopdf-headers.pdf"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;Objects&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ObjectSettings&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;HtmlContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ReadAllText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"doc.html"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;WebSettings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;DefaultEncoding&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"utf-8"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;HeaderSettings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nc"&gt;Center&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"台灣範例科技股份有限公司"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="nc"&gt;FontName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Microsoft JhengHei"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="nc"&gt;FontSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;FooterSettings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nc"&gt;Center&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"第 [page] 頁，共 [toPage] 頁"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="nc"&gt;FontName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Microsoft JhengHei"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="nc"&gt;FontSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;converter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4 頁的畫面與字型都符合預期。擷取文字時，頁尾的「頁」卻變成康熙部首字元「⾴」（U+2FB4），內文的「竹」「高」等字也有相同情形，因此以 PyMuPDF 搜尋「第 1 頁」或「新竹」都找不到結果。DinkToPdf 1.0.8 發布於 2017 年，套件本身不含原生程式庫，需另外複製 wkhtmltopdf 0.12.4 版的 libwkhtmltox。&lt;a href="https://github.com/wkhtmltopdf/wkhtmltopdf" rel="noopener noreferrer"&gt;wkhtmltopdf 的 GitHub 儲存庫&lt;/a&gt;已封存。&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS 頁邊方塊 &lt;code&gt;@top-center&lt;/code&gt; 與 &lt;code&gt;@bottom-center&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4zfmpqzus1zsmdhpwnpi.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4zfmpqzus1zsmdhpwnpi.webp" alt="iText pdfHTML 產品頁，說明 pdfHTML 是 iText Core 的附加元件，可將 HTML 與 CSS 轉成 PDF" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;iText pdfHTML 產品頁&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;本文的 iText pdfHTML 範例把頁首頁尾寫在 CSS Paged Media 的&lt;a href="https://www.w3.org/TR/css-page-3/#margin-boxes" rel="noopener noreferrer"&gt;頁邊方塊&lt;/a&gt;（margin box）中。&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="n"&gt;iText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Html2pdf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="n"&gt;iText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StyledXmlParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Resolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Font&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;css&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"""
    &amp;lt;style&amp;gt;
      @page {
        @top-center {
          content: "台灣範例科技股份有限公司";
          font-family: "Microsoft JhengHei";
        }
        @bottom-center {
          content: "第 " counter(page) " 頁，共 " counter(pages) " 頁";
          font-family: "Microsoft JhengHei";
        }
      }
    &amp;lt;/style&amp;gt;
    """&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ReadAllText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"doc.html"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;/head&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;css&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;/head&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;fontProvider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BasicFontProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;fontProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddFont&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;@&lt;span class="s2"&gt;"C:\Windows\Fonts\msjh.ttc,0"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;properties&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ConverterProperties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SetFontProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fontProvider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"itext-headers.pdf"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;FileMode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;HtmlConverter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ConvertToPdf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;輸出共 4 頁，頁首頁尾與內文共用以 &lt;code&gt;AddFont&lt;/code&gt; 註冊的微軟正黑體。iText pdfHTML 採 AGPL 與商業授權雙軌制。&lt;/p&gt;

&lt;h2&gt;
  
  
  實測結果
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnjb2058e6o5m403hy3lu.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnjb2058e6o5m403hy3lu.webp" alt="PuppeteerSharp、DinkToPdf 與 iText pdfHTML 第 1 頁的中文頁首與「第 1 頁，共 X 頁」頁尾" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;上圖為其他三款函式庫輸出的第 1 頁頁首與頁尾。&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;函式庫&lt;/th&gt;
&lt;th&gt;版本&lt;/th&gt;
&lt;th&gt;頁碼語法&lt;/th&gt;
&lt;th&gt;頁數&lt;/th&gt;
&lt;th&gt;頁首頁尾&lt;/th&gt;
&lt;th&gt;字型&lt;/th&gt;
&lt;th&gt;擷取文字&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;IronPDF&lt;/td&gt;
&lt;td&gt;2026.11.1&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;{page}&lt;/code&gt;、&lt;code&gt;{total-pages}&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;每頁正確&lt;/td&gt;
&lt;td&gt;微軟正黑體&lt;/td&gt;
&lt;td&gt;正確&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PuppeteerSharp&lt;/td&gt;
&lt;td&gt;25.15.0&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;pageNumber&lt;/code&gt;、&lt;code&gt;totalPages&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;每頁正確&lt;/td&gt;
&lt;td&gt;微軟正黑體&lt;/td&gt;
&lt;td&gt;正確&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DinkToPdf&lt;/td&gt;
&lt;td&gt;1.0.8&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;[page]&lt;/code&gt;、&lt;code&gt;[toPage]&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;每頁正確&lt;/td&gt;
&lt;td&gt;微軟正黑體&lt;/td&gt;
&lt;td&gt;部分字元變成康熙部首&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;iText pdfHTML&lt;/td&gt;
&lt;td&gt;6.3.4&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;counter(page)&lt;/code&gt;、&lt;code&gt;counter(pages)&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;每頁正確&lt;/td&gt;
&lt;td&gt;微軟正黑體&lt;/td&gt;
&lt;td&gt;正確&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;本文沒有統一各工具的邊界與縮放設定，因此總頁數不宜直接比較。&lt;/p&gt;

&lt;h2&gt;
  
  
  選擇建議
&lt;/h2&gt;

&lt;p&gt;四款函式庫的畫面都顯示中文頁碼，差異在於設定方式，以及部分工具附帶的問題。IronPDF 與 PuppeteerSharp 都以 HTML 撰寫頁首頁尾，PuppeteerSharp 的範本應指定 &lt;code&gt;font-family&lt;/code&gt;。IronPDF 的平台套件（&lt;code&gt;IronPdf&lt;/code&gt;、&lt;code&gt;IronPdf.Linux&lt;/code&gt; 與 &lt;code&gt;IronPdf.MacOs&lt;/code&gt;）已附帶 &lt;a href="https://ironpdf.com/get-started/advanced-installation-nuget/" rel="noopener noreferrer"&gt;Chromium 引擎&lt;/a&gt;，PuppeteerSharp 則須另外提供 Chrome。iText 把頁首頁尾寫在 CSS 中，適合不需要 JavaScript 且可接受 AGPL 或商業授權的專案。DinkToPdf 的畫面正確，但擷取文字有誤，需要文字搜尋的文件不適合使用。&lt;/p&gt;

&lt;p&gt;HTML 轉 PDF 的完整流程可參考 IronPDF 的 &lt;a href="https://ironpdf.com/tutorials/html-to-pdf/" rel="noopener noreferrer"&gt;HTML 轉 PDF 教學&lt;/a&gt;。您的專案目前以哪一種方式產生中文頁首頁尾，是否也遇過擷取文字的問題？&lt;/p&gt;

&lt;p&gt;若要以自己的報表範本測試 IronPDF，可以申請 &lt;a href="https://ironpdf.com/licensing/" rel="noopener noreferrer"&gt;30 天試用金鑰&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;文中提及的其他產品名稱屬於其各自的擁有者，我們與這些專案沒有關聯。版本與結果來自各套件的 NuGet 頁面以及我們於 2026 年 11 月的實測。&lt;/em&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>pdf</category>
      <category>html</category>
    </item>
    <item>
      <title>Aspose.PDF 26.10 HTML to PDF: Blank Charts and Small Fonts</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Sat, 07 Nov 2026 00:11:34 +0000</pubDate>
      <link>https://dev.to/ironsoftware/asposepdf-2610-html-to-pdf-blank-charts-and-small-fonts-1bcf</link>
      <guid>https://dev.to/ironsoftware/asposepdf-2610-html-to-pdf-blank-charts-and-small-fonts-1bcf</guid>
      <description>&lt;p&gt;Aspose.PDF for Java turns HTML into a PDF through &lt;code&gt;HtmlLoadOptions&lt;/code&gt;, and version 26.10 came out on 31 October 2026. Before real templates go through it, a few behaviors are worth checking, from how it treats page scripts and canvas charts to what evaluation mode does and which advisory records carry the product's name. Each section below reports what a run on Java 17 against 26.10, or a query to the advisory databases, produced.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Page Scripts Do Not Run, So Canvas Charts Come Out Blank
&lt;/h2&gt;

&lt;p&gt;CSS grid columns lay out correctly in 26.10, where 26.9 stacked them in one column, but scripts moved the opposite way. Text set with &lt;code&gt;textContent&lt;/code&gt; and list items added with &lt;code&gt;createElement&lt;/code&gt; each altered the page in separate 26.9 probes and did nothing in 26.10. No license was loaded for these probes, which leaves the licensed behavior untested. This bar chart shows what that means for a canvas.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.aspose.pdf.Document&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.aspose.pdf.HtmlLoadOptions&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.nio.charset.StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CanvasChartCheck&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// A bar chart drawn on a canvas, with a caption the same script fills in afterwards.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body style='font-family:Arial'&amp;gt;&amp;lt;h1&amp;gt;Monthly orders&amp;lt;/h1&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;canvas id='bars' width='320' height='140'&amp;gt;&amp;lt;/canvas&amp;gt;&amp;lt;p id='caption'&amp;gt;Chart: not drawn&amp;lt;/p&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;script&amp;gt;var ctx = document.getElementById('bars').getContext('2d');"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"[40, 90, 65].forEach(function (v, i) { ctx.fillStyle = '#1f3c78'; ctx.fillRect(20 + i * 90, 140 - v, 60, v); });"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"document.getElementById('caption').textContent = 'Chart: drawn';&amp;lt;/script&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Document&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getBytes&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;UTF_8&lt;/span&gt;&lt;span class="o"&gt;)),&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HtmlLoadOptions&lt;/span&gt;&lt;span class="o"&gt;()))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"canvas-chart.pdf"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The page kept an empty space where the 320 by 140 canvas should be, with no bars in it, and the caption still read &lt;code&gt;Chart: not drawn&lt;/code&gt;. The canvas calls are not the cause, because a probe with one &lt;code&gt;textContent&lt;/code&gt; line and no canvas also left its paragraph as written. &lt;code&gt;HtmlLoadOptions&lt;/code&gt; has no script setting, Aspose's HTML conversion guide lists none, and the 26.10 release notes, with 11 bug fixes and no added APIs, never mention scripts. Reports that embed &lt;a href="https://ironpdf.com/java/examples/js-charts-to-pdf/" rel="noopener noreferrer"&gt;JavaScript charts&lt;/a&gt; drawn on canvas lose them on this route, along with anything else a script fills in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixed-Width Tables Widen the Page or Shrink the Text
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;HtmlPageLayoutOption.ScaleToPageWidth&lt;/code&gt; is documented as the option that scales wide content to the page instead of clipping it. This check applies it to an eight-column table fixed at 1200px.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.aspose.pdf.Document&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.aspose.pdf.HtmlLoadOptions&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.aspose.pdf.HtmlPageLayoutOption&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.nio.charset.StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WideTableCheck&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Eight fixed 150px columns make a 1200px table, about one and a half times the width of A4.&lt;/span&gt;
        &lt;span class="nc"&gt;StringBuilder&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;StringBuilder&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&amp;lt;tr&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;append&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&amp;lt;td style='width:150px;border:1px solid #999'&amp;gt;Month "&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;append&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;append&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&amp;lt;/td&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body style='font-family:Arial'&amp;gt;&amp;lt;h1&amp;gt;Usage by month&amp;lt;/h1&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;table style='border-collapse:collapse;width:1200px'&amp;gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;// The documented option for wide content, applied before the import.&lt;/span&gt;
        &lt;span class="nc"&gt;HtmlLoadOptions&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HtmlLoadOptions&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setPageLayoutOption&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HtmlPageLayoutOption&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ScaleToPageWidth&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Document&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getBytes&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;UTF_8&lt;/span&gt;&lt;span class="o"&gt;)),&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Pages: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getPages&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
            &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"wide-table.pdf"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It printed &lt;code&gt;Pages: 1&lt;/code&gt;, and that one page was 595 by 842 points, with Month 8 ending at x = 474 and the table's right border at x = 505. The table was scaled down as documented, which 26.9 did not do, and the option applied to the whole page. Cell text, 12 pt by default, came out at 5.5 pt, and the default 24 pt heading at 11 pt. Without the option the text stayed at 12 pt and the page grew to 1,086 points to hold the table. A fixed-width block followed the same pattern, widening the page to 1,236 points by default and dropping to 4.7 pt text with the option.&lt;/p&gt;

&lt;p&gt;Both cases cleared once the template stopped fixing pixel widths. Setting the table to &lt;code&gt;width:100%&lt;/code&gt; with &lt;code&gt;table-layout:fixed&lt;/code&gt;, with no pixel widths left on its cells, kept the page at 595 points and the text at 12 pt, and &lt;code&gt;max-width:100%&lt;/code&gt; held the block inside the margins. Holding a template to a standard &lt;a href="https://ironpdf.com/java/object-reference/api/com/ironsoftware/ironpdf/render/PaperSize.html" rel="noopener noreferrer"&gt;paper size&lt;/a&gt; took that edit in these runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Font Data, Installation and Evaluation Mode
&lt;/h2&gt;

&lt;p&gt;A one-page account statement saved with default settings measured 211,791 bytes, and the same statement with &lt;code&gt;setEmbedFonts(false)&lt;/code&gt; on the load options measured 34,101 bytes. &lt;code&gt;isEmbedFonts()&lt;/code&gt; returns &lt;code&gt;true&lt;/code&gt; on a new &lt;code&gt;HtmlLoadOptions&lt;/code&gt;, and in the larger file the two embedded Arial font programs account for 177,231 bytes, while the statement's text uses only 39 distinct characters. Both files are evaluation output, and each also holds the embedded font behind the evaluation notice.&lt;/p&gt;

&lt;p&gt;Turning embedding off is the library's own switch, and it leaves the fonts to the machine that opens the file. PDF/A requires embedded fonts, and the PDF/A conversion log Aspose writes lists every unembedded one as an error, so archived output has to keep its fonts. For services that store or mail statements in volume, every file carries that font data.&lt;/p&gt;

&lt;p&gt;The library is not on Maven Central, where &lt;code&gt;com.aspose:aspose-pdf&lt;/code&gt; returns 404. It comes from Aspose's own repository, which every build and any internal proxy has to list next to the &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/what-is-maven-in-java/" rel="noopener noreferrer"&gt;Maven dependency&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;repositories&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;repository&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;id&amp;gt;&lt;/span&gt;aspose&lt;span class="nt"&gt;&amp;lt;/id&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;url&amp;gt;&lt;/span&gt;https://releases.aspose.com/java/repo/&lt;span class="nt"&gt;&amp;lt;/url&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/repository&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/repositories&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;dependencies&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;com.aspose&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;aspose-pdf&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;26.10&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependencies&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Version 26.10 ships as one JAR whose POM lists no dependencies, and Aspose's install docs set JDK 1.8 as the floor. Aspose.PDF for Java is commercial, and a &lt;code&gt;.lic&lt;/code&gt; file loaded with &lt;code&gt;com.aspose.pdf.License&lt;/code&gt; lifts evaluation mode. Until then, the licensing documentation says each page carries a watermark and only four elements of any collection are processed, pages and form fields included.&lt;/p&gt;

&lt;p&gt;Every PDF from these runs had the evaluation notice across its top edge, and building a document page by page in code threw &lt;code&gt;IndexOutOfRangeException&lt;/code&gt; when the fifth page was added, citing the four-element evaluation limit. An HTML import with seven page breaks did produce seven pages. Aspose's 30-day temporary license removes both limits, and it is issued only to business email addresses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advisory Records Under the Aspose.PDF Name
&lt;/h2&gt;

&lt;p&gt;Neither OSV nor GHSA held an entry for &lt;code&gt;com.aspose:aspose-pdf&lt;/code&gt; on Maven when queried on 4 November 2026. NVD has four records that name Aspose.PDF or the Aspose PDF Exporter plugin, out of 11 for the keyword aspose.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2019-5042, CVSS 3.1 score 8.8 (NIST), CVSS 3.0 score 8.8 (Cisco Talos, the CNA):&lt;/strong&gt; Aspose.PDF 19.2 for C++, a use-after-free when a crafted PDF's FunctionType 0 elements are parsed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2019-5066, score 9.8 (NIST and Talos):&lt;/strong&gt; The same C++ release, a use-after-free while decoding LZW-compressed streams&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2019-5067, score 9.8 (NIST and Talos):&lt;/strong&gt; The same C++ release, uninitialized memory access from invalid parent object pointers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2015-20125, CVSS 3.1 score 7.5, CVSS 4.0 score 8.7 (VulnCheck, the CNA):&lt;/strong&gt; A WordPress plugin called Aspose PDF Exporter, versions before 2.0, a path traversal published on 20 October 2026, with NVD analysis deferred&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NVD scopes the three 2019 records to the C++ edition at 19.2 without a fixed release, and none of the four covers the Java library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Aspose.PDF Behaviors and a Chromium-Based Option
&lt;/h2&gt;

&lt;p&gt;Across these unlicensed checks, Aspose.PDF for Java 26.10 skipped page scripts, left canvas charts blank, widened the page for fixed-width tables or scaled their text to 5.5 pt, embedded about 177 KB of font data in a one-page file, capped code-built documents at four pages in evaluation mode and installed from a repository outside Maven Central.&lt;/p&gt;

&lt;p&gt;For HTML that depends on page scripts or canvas charts, IronPDF for Java is another commercial option, since it renders HTML through Chromium. On 2026.11.3, a page with the canvas markup above plus a grid section drew the bars and changed the caption to &lt;code&gt;Chart: drawn&lt;/code&gt;. Scripts run by default, and &lt;a href="https://ironpdf.com/java/object-reference/api/com/ironsoftware/ironpdf/render/ChromePdfRenderOptions.html" rel="noopener noreferrer"&gt;&lt;code&gt;setEnableJavaScript&lt;/code&gt; on &lt;code&gt;ChromePdfRenderOptions&lt;/code&gt;&lt;/a&gt; is the switch. Fixed-width content still has to change in the template there as well, because with &lt;code&gt;UseFitToPageRendering(1400)&lt;/code&gt; the wide banner in that run printed at 5.2 pt. It installs from Maven Central as &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt;, where 2026.11.3 came out on 3 November 2026 as the 23rd monthly-numbered release since 2025.1.1.&lt;/p&gt;

&lt;p&gt;To run your own scripted and chart templates through it, IronPDF has a &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; with a 30-day key.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Aspose.PDF is a trademark of its respective owner, we have no affiliation with Aspose, and the versions, advisory records and run results above come from Aspose's public documentation, NVD, OSV, the GitHub Advisory Database and our own test runs in November 2026.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. Code run and claims checked by the Iron Software DevRel team against &lt;code&gt;com.aspose:aspose-pdf&lt;/code&gt; 26.10 and &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3 on 4 November 2026.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>html</category>
      <category>aspose</category>
    </item>
    <item>
      <title>Pentaho Reporting 11 PDFs: Maven Access, Flexbox, Passwords</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Thu, 05 Nov 2026 17:49:47 +0000</pubDate>
      <link>https://dev.to/ironsoftware/pentaho-reporting-11-pdfs-maven-access-flexbox-passwords-3epe</link>
      <guid>https://dev.to/ironsoftware/pentaho-reporting-11-pdfs-maven-access-flexbox-passwords-3epe</guid>
      <description>&lt;p&gt;A Maven build that pulls &lt;code&gt;classic-core&lt;/code&gt;, an invoice header written as a flex row, and a statement guarded by an open password look like routine jobs for Pentaho Reporting's classic engine. Each of them has a catch in the 11.0 line, and this post walks through all three plus the CVEs in its dependency tree. Our test build came from &lt;code&gt;11.0.0.4-325&lt;/code&gt;, committed on 30 October 2026. GitHub's newest service-pack tag on 4 November 2026 is &lt;code&gt;11.0.0.4-328&lt;/code&gt;, three commits later, with the dependency versions below unchanged. Every snippet below ran on JDK 17, and we opened each resulting PDF to check it. The same snippets gave matching output on a build from &lt;code&gt;11.0.0.0-237&lt;/code&gt;, the top &lt;code&gt;11.0.0.0&lt;/code&gt; tag, committed on 30 December 2025.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Does Maven Need Before classic-core Will Resolve?
&lt;/h2&gt;

&lt;p&gt;Repository credentials, or a source build. Neither &lt;code&gt;classic-core&lt;/code&gt; nor the eleven &lt;code&gt;org.pentaho.reporting.library&lt;/code&gt; modules it depends on is on Maven Central, where every lookup returned 404 on 4 November 2026. Following the README leads to Pentaho's Artifactory at &lt;code&gt;repo.pentaho.com/artifactory/pnt-mvn/&lt;/code&gt;, configured through a &lt;code&gt;settings.xml&lt;/code&gt; in Pentaho's maven-parent-poms repository, and it refused the 11.0 POMs with HTTP 401 when Maven and curl sent no credentials. Build servers limited to Maven Central stop here, which is why the classes for this post came from the GitHub tag. Our source build skipped 46 core files, the database connection, SQL data factory and query editor code, because parts of it need &lt;code&gt;commons-database-model&lt;/code&gt; and &lt;code&gt;rsyntaxtextarea&lt;/code&gt; 1.3.2, which are missing from Central too, and no snippet below touches them.&lt;/p&gt;

&lt;p&gt;Check the JDK as well. The README still names Java 11 as the minimum, yet &lt;code&gt;release.jdk.version&lt;/code&gt; is 17 in the 11.0 parent POM, and Java 11 cannot load classes compiled for release 17. The &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/what-is-maven-in-java/" rel="noopener noreferrer"&gt;overview of Maven and the POM&lt;/a&gt; explains the repository lookup a build makes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Happens to a Flexbox Invoice Header in an HTML Text Field?
&lt;/h2&gt;

&lt;p&gt;The flex layout disappears, and so does the script's output. Pentaho Reporting reads no HTML pages. Markup is only allowed inside a text element flagged as &lt;code&gt;text/html&lt;/code&gt; through &lt;code&gt;AttributeNames.Core.RICH_TEXT_TYPE&lt;/code&gt;, and &lt;code&gt;HtmlRichTextConverter&lt;/code&gt; then hands it to &lt;code&gt;HTMLEditorKit&lt;/code&gt; from Java Swing, a kit whose Oracle javadoc says it covers HTML version 3.2 with some extensions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.AttributeNames&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.ClassicEngineBoot&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.Element&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.MasterReport&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.elementfactory.LabelElementFactory&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HtmlInvoiceHeader&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;ClassicEngineBoot&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getInstance&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// An invoice header as a web template would write it, with a flex row and a script-filled date.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;".bar { display: flex; justify-content: space-between; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div class='bar'&amp;gt;&amp;lt;span&amp;gt;ACME Supplies&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;Invoice INV-2041&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;p&amp;gt;Issued &amp;lt;span id='issued'&amp;gt;DATE&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;script&amp;gt;document.getElementById('issued').textContent = '26 October 2026';&amp;lt;/script&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="nc"&gt;LabelElementFactory&lt;/span&gt; &lt;span class="n"&gt;factory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LabelElementFactory&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;factory&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;factory&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setMinimumWidth&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;factory&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setMinimumHeight&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;Element&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;factory&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createElement&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// Marking the label as text/html sends it through the engine's rich-text converter.&lt;/span&gt;
        &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setAttribute&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AttributeNames&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Core&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;NAMESPACE&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;AttributeNames&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Core&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RICH_TEXT_TYPE&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"text/html"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="nc"&gt;MasterReport&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MasterReport&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getReportHeader&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;addElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;PdfReportUtil&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createPDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"invoice-header.pdf"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look at &lt;code&gt;invoice-header.pdf&lt;/code&gt; and the company name and invoice number share one line, glued together as &lt;code&gt;ACME SuppliesInvoice INV-2041&lt;/code&gt; from the left margin, so &lt;code&gt;justify-content: space-between&lt;/code&gt; did nothing. Below it, &lt;code&gt;Issued DATE&lt;/code&gt; still shows the placeholder the script was meant to overwrite. Front-end teams that already keep invoices as web templates are the ones affected. Pentaho's answer is one report element per value, laid out in Report Designer or from Java, while the &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/java-create-pdf-from-template-tutorial/" rel="noopener noreferrer"&gt;HTML template tutorial&lt;/a&gt; keeps the markup as it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does an Open Password Alone Protect a Pentaho PDF?
&lt;/h2&gt;

&lt;p&gt;Not in the test below. Encryption comes in two strengths, &lt;code&gt;40bit&lt;/code&gt; and &lt;code&gt;128bit&lt;/code&gt;, and both produced RC4 here (revision 2 and revision 3 of the standard handler), an algorithm qpdf's encryption notes list as deprecated in PDF 2.0. If the configuration has no &lt;code&gt;OwnerPassword&lt;/code&gt;, &lt;code&gt;PdfDocumentWriter&lt;/code&gt; writes the PDF padding constant in its place, and a comment in that class says this amounts to an empty password, which Adobe accepts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.File&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.ClassicEngineBoot&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.MasterReport&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.elementfactory.LabelElementFactory&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.pentaho.reporting.libraries.base.config.ModifiableConfiguration&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OpenPasswordOnly&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="no"&gt;PDF&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf."&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;ClassicEngineBoot&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getInstance&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="nc"&gt;LabelElementFactory&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LabelElementFactory&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Payroll summary, October 2026"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setMinimumWidth&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setMinimumHeight&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;MasterReport&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MasterReport&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getReportHeader&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;addElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createElement&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;

        &lt;span class="c1"&gt;// An open password and a copy ban, but no OwnerPassword key.&lt;/span&gt;
        &lt;span class="nc"&gt;ModifiableConfiguration&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getReportConfiguration&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setConfigProperty&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;PDF&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"Encryption"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"128bit"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setConfigProperty&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;PDF&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"UserPassword"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"payroll-2026"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setConfigProperty&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;PDF&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"AllowCopy"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"false"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="nc"&gt;PdfReportUtil&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createPDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"payroll-open-password.pdf"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;payroll-2026&lt;/code&gt; the file opens as expected. An empty string opened it too, with every owner permission, in both pypdf and the OpenPDF reader, and pypdf then saved a decrypted copy reading &lt;code&gt;Payroll summary, October 2026&lt;/code&gt;. MuPDF was the exception and prompted for the password. This matters to anyone who sets &lt;code&gt;UserPassword&lt;/code&gt; by itself on HR or finance output, and supplying an &lt;code&gt;OwnerPassword&lt;/code&gt; alongside it closes the gap. Signing and PDF/A have no configuration key in the PDF module, so an export cannot request either. The &lt;a href="https://ironpdf.com/java/examples/security-and-metadata/" rel="noopener noreferrer"&gt;security and metadata example&lt;/a&gt; sets an open password and a permissions password side by side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which CVEs Ship With the 11.0 Dependency Tree?
&lt;/h2&gt;

&lt;p&gt;These entries come from OSV and NVD, queried on 4 November 2026 and matched to the compile-scope dependencies of &lt;code&gt;classic-core&lt;/code&gt; and its library modules. They are a selection, and CVE.org holds 47 records across the Bouncy Castle Java modules on 1.78.1, none of them on 1.86. Scores follow NVD and name who assigned them, all under CVSS 3.1 apart from Guava's CVSS 4.0, and NVD flags none of the entries as disputed. Each bullet gives the component at 11.0.0.0-237, the release that fixes it and its state in 11.0.0.4-325.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-8763, 9.1 Critical (NIST):&lt;/strong&gt; Affects &lt;code&gt;bcprov-jdk15to18&lt;/code&gt; 1.78.1, fixed in 1.85, and cleared by 1.86 in 11.0.0.4-325.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-13506, 7.5 High (NIST):&lt;/strong&gt; Affects the same &lt;code&gt;bcprov-jdk15to18&lt;/code&gt;, also fixed in 1.85 and cleared by 1.86.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2025-31672, 5.3 Medium (CISA-ADP):&lt;/strong&gt; Affects &lt;code&gt;poi-ooxml&lt;/code&gt; 5.2.5, fixed in 5.4.0, and cleared by 5.5.1.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2025-66453, 7.5 High (NIST):&lt;/strong&gt; Affects &lt;code&gt;rhino&lt;/code&gt; 1.7.13, fixed in 1.7.14.1, and cleared by 1.7.15.1.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-102554, 8.2 High (Google):&lt;/strong&gt; Affects &lt;code&gt;guava&lt;/code&gt; 32.1.2-jre, fixed in 33.7.2, and still open because 11.0.0.4-325 keeps that version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-34478 and CVE-2026-34480, 7.5 High (NIST):&lt;/strong&gt; Affects &lt;code&gt;log4j-core&lt;/code&gt; 2.23.1, fixed in 2.25.4, and still open at 2.25.3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-34477, 5.9 Medium (NIST):&lt;/strong&gt; Also &lt;code&gt;log4j-core&lt;/code&gt; 2.23.1 and fixed in 2.25.4, with 2.25.3 still inside the range.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-49844, 5.9 Medium (NIST):&lt;/strong&gt; Affects &lt;code&gt;log4j-api&lt;/code&gt; 2.23.1, fixed in 2.25.5, and 2.25.3 has not reached that fix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2025-48924, 5.3 Medium (CISA-ADP):&lt;/strong&gt; Affects &lt;code&gt;commons-lang3&lt;/code&gt; 3.14.0, fixed in 3.18.0, and still open because 11.0.0.4-325 keeps 3.14.0.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;classic-core&lt;/code&gt; declares &lt;code&gt;bcmail-jdk15to18&lt;/code&gt; directly, which is how Bouncy Castle gets in, and Rhino is declared by &lt;code&gt;classic-core&lt;/code&gt; and by &lt;code&gt;libloader&lt;/code&gt;. In Rhino's case, a crafted number passed to &lt;code&gt;toFixed()&lt;/code&gt; can pin the CPU. &lt;code&gt;classic-core&lt;/code&gt; declares Guava directly too, and that entry concerns memory allocation while deserializing its &lt;code&gt;CompactHashMap&lt;/code&gt;, &lt;code&gt;CompactHashSet&lt;/code&gt; and &lt;code&gt;MapMakerInternalMap&lt;/code&gt; types, with NVD still listing it as awaiting analysis. The three Log4j Core entries need a particular setup to matter, &lt;code&gt;Rfc5424Layout&lt;/code&gt; for log injection, &lt;code&gt;XmlLayout&lt;/code&gt; for unsanitized characters and a TLS socket whose &lt;code&gt;verifyHostName&lt;/code&gt; setting is silently ignored. OSV lists nothing against OpenPDF 1.3.32. GitHub's newer 11.1.0.0 build tags, from 11.1.0.0-343 onward, already carry Log4j 2.25.5, outside the Log4j ranges above, though 11.1.0.0-461, the newest on 4 November 2026, still pins Guava 32.1.2-jre. A &lt;code&gt;dependencyManagement&lt;/code&gt; pin can override these versions as a stopgap, with regression testing on a set Pentaho never released.&lt;/p&gt;

&lt;h2&gt;
  
  
  Replacing the Pentaho PDF Path for HTML Reports
&lt;/h2&gt;

&lt;p&gt;The engine drops flexbox and script from HTML text, writes RC4 files that pypdf and the OpenPDF reader reopen with an empty password when no &lt;code&gt;OwnerPassword&lt;/code&gt; is set, carries Log4j advisories into the 11.0.0.4 service pack, and comes from a repository that answered 401 to Maven and curl requests without credentials.&lt;/p&gt;

&lt;p&gt;Where the invoice already exists as an HTML page, IronPDF for Java renders it in full Chromium, and in our 2026.11.3 run the header above put &lt;code&gt;ACME Supplies&lt;/code&gt; and &lt;code&gt;Invoice INV-2041&lt;/code&gt; at opposite edges and showed &lt;code&gt;Issued 26 October 2026&lt;/code&gt;, with &lt;code&gt;setEnableJavaScript(true)&lt;/code&gt; set on &lt;code&gt;ChromePdfRenderOptions&lt;/code&gt;. Maven Central carries it as &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt;, version 2026.11.3 from 3 November. Its &lt;code&gt;setPassword&lt;/code&gt; alone also wrote RC4, at 128 bits, and pypdf and MuPDF both refused the empty password. In another run, &lt;code&gt;SecurityOptions&lt;/code&gt; with &lt;code&gt;PdfEncryptionType.AES_256&lt;/code&gt; and distinct user and owner passwords wrote an AES-256 file.&lt;/p&gt;

&lt;p&gt;IronPDF for Java has a &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; for running these documents against your own templates, and the &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/digital-signature-pdf-java-tutorial/" rel="noopener noreferrer"&gt;signing guide&lt;/a&gt; covers the digital signatures the Pentaho PDF module has no key for.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Pentaho, OpenPDF, Apache POI, Apache Commons Lang, Log4j, Bouncy Castle, Guava and Rhino are trademarks of their respective owners, we have no affiliation with any of them, and the details here come from the Pentaho Reporting repository, NVD, OSV, CVE.org, qpdf's documentation, Oracle's Java documentation and Maven Central.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. Pentaho Reporting code run on the &lt;code&gt;11.0.0.4-325&lt;/code&gt; engine and claims checked by the Iron Software DevRel team on 4 November 2026, with &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3 as the IronPDF reference.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>security</category>
      <category>reporting</category>
    </item>
    <item>
      <title>PD4ML for Java: Scripts, File Access and Layout Width</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Thu, 05 Nov 2026 17:41:29 +0000</pubDate>
      <link>https://dev.to/ironsoftware/pd4ml-for-java-scripts-file-access-and-layout-width-3fem</link>
      <guid>https://dev.to/ironsoftware/pd4ml-for-java-scripts-file-access-and-layout-width-3fem</guid>
      <description>&lt;p&gt;A one-line script that writes a total into a &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; is enough to show the first issue. PD4ML 4.1.2 printed the label and left the number out. PD4ML is a pure-Java HTML to PDF engine, and 4.1.2, uploaded to PD4ML's own Maven repository on 2 November 2026, is still its newest release on 4 November 2026. This post collects the issues we found running it on Java 17, with the run output and a workaround wherever we found one.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every run was unlicensed, which puts PD4ML in evaluation mode. The sections below cover every row of the table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Issue&lt;/th&gt;
&lt;th&gt;Affected version&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Script never executed, &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; left blank&lt;/td&gt;
&lt;td&gt;PD4ML 4.1.2&lt;/td&gt;
&lt;td&gt;Run and HTML5 support matrix&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local files embedded from user markup&lt;/td&gt;
&lt;td&gt;PD4ML 4.1.2, &lt;code&gt;null&lt;/code&gt; base URL&lt;/td&gt;
&lt;td&gt;Run and javadoc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CVE-2026-8763, CVE-2026-13506 and 26 more records&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;bcprov-jdk18on&lt;/code&gt; and &lt;code&gt;bcpkix-jdk18on&lt;/code&gt; 1.84&lt;/td&gt;
&lt;td&gt;OSV, GHSA and CVE.org&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Grid columns and &lt;code&gt;var()&lt;/code&gt; colours ignored&lt;/td&gt;
&lt;td&gt;PD4ML 4.1.2&lt;/td&gt;
&lt;td&gt;Run and features page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Elements wider than 727 px clipped&lt;/td&gt;
&lt;td&gt;PD4ML 4.1.2 default &lt;code&gt;htmlWidth&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Run and manual&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PDF/A request returns a license error&lt;/td&gt;
&lt;td&gt;PD4ML 4.1.2 without a license&lt;/td&gt;
&lt;td&gt;Run and veraPDF&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Does PD4ML Run the Page's JavaScript?
&lt;/h2&gt;

&lt;p&gt;No. PD4ML's published HTML5 compatibility table rates &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; N/A by design and explains that the code contains no script engine at all. Whatever a page's own scripts would have added stays invisible to the converter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.pd4ml.PD4ML&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.nio.charset.StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ScriptFilledTotal&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// The span is empty in the markup and a script writes the sum into it after load.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;p&amp;gt;Open invoices: &amp;lt;span id='n'&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;script&amp;gt;document.getElementById('n').textContent = [12, 7, 23].reduce(function (a, b) { return a + b; });&amp;lt;/script&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="no"&gt;PD4ML&lt;/span&gt; &lt;span class="n"&gt;pd4ml&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;PD4ML&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;pd4ml&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;readHTML&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getBytes&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;UTF_8&lt;/span&gt;&lt;span class="o"&gt;)),&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FileOutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"open-invoices.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;pd4ml&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;writePDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;open-invoices.pdf&lt;/code&gt; is a single A4 page whose only line reads &lt;code&gt;Open invoices:&lt;/code&gt;. The 42 the script would have written is not there, and nothing in the run's output mentions the skipped script. A &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; painted by script behaves the same way, and in a separate run the canvas area came out blank, with no image or drawing on the page.&lt;/p&gt;

&lt;p&gt;Any template that builds content in the browser runs into this, from chart libraries to totals computed client-side. The workaround is to compute values in Java and put them into the HTML, for example through &lt;code&gt;setDynamicData&lt;/code&gt; placeholders, and to switch charts to inline &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt;, drawn as true vector graphics in STD and every higher edition according to PD4ML's products page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can User-Supplied HTML Read Files From the Server?
&lt;/h2&gt;

&lt;p&gt;It can. When &lt;code&gt;readHTML&lt;/code&gt; gets a &lt;code&gt;null&lt;/code&gt; base URL, the javadoc says relative references resolve against the current working directory, and the manual warns that unrestricted HTML can make a server read local files or call internal services.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.pd4ml.PD4ML&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.nio.charset.StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserHtmlReadsDisk&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Stands in for HTML a user submitted, which points an image at a file on the server.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;userHtml&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;p&amp;gt;My profile&amp;lt;/p&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;img src='internal/hr-badge.png'&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;// With a null base URL, relative paths resolve against the working directory.&lt;/span&gt;
        &lt;span class="no"&gt;PD4ML&lt;/span&gt; &lt;span class="n"&gt;pd4ml&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;PD4ML&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;pd4ml&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;readHTML&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;userHtml&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getBytes&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;UTF_8&lt;/span&gt;&lt;span class="o"&gt;)),&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FileOutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"profile.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;pd4ml&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;writePDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The working directory held &lt;code&gt;internal/hr-badge.png&lt;/code&gt;, a 240 by 60 pixel image, and &lt;code&gt;profile.pdf&lt;/code&gt; came out with that image embedded under &lt;code&gt;My profile&lt;/code&gt;. A conversion service that accepts HTML from users can therefore be pointed at images on its own disk, and in two more probes a &lt;code&gt;../&lt;/code&gt; path and an absolute &lt;code&gt;file:&lt;/code&gt; URL each embedded an image from outside that directory. PD4ML has a setting for this. Passing &lt;code&gt;Constants.PD4ML_ALLOWED_RESOURCE_LOCATION&lt;/code&gt; to &lt;code&gt;setParam&lt;/code&gt; with a URL prefix makes it reject images, stylesheets and attachments from anywhere else, and a rerun with the prefix set to a different folder produced the page without the badge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which Advisories Ride Along With the Bouncy Castle Pin?
&lt;/h2&gt;

&lt;p&gt;A search of OSV and GitHub's advisory database for &lt;code&gt;com.pd4ml:pd4ml&lt;/code&gt; on 4 November 2026 returned nothing. What does show up is in Bouncy Castle. The manual's Maven snippet, still written for 4.1.1 on that date, sets both Bouncy Castle artifacts to 1.84, and OSV attaches two advisories to that &lt;code&gt;bcprov&lt;/code&gt; version, both dated 3 August 2026 and both resolved in 1.85. CVE.org holds far more, with 28 records naming &lt;code&gt;bcprov&lt;/code&gt; or &lt;code&gt;bcpkix&lt;/code&gt; on 1.84, 21 from August and 7 from October, and none on 1.86.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-8763, CVSS 4.0 score 9.3 Critical (Bouncy Castle, the CNA), CVSS 3.1 score 9.1 (GitHub):&lt;/strong&gt; A certificate whose rfc822Name or URI ends in a trailing dot can slip past Name Constraints&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-13506, CVSS 4.0 score 8.7 High (the CNA), CVSS 3.1 score 7.5 (GitHub):&lt;/strong&gt; Forcing a lazily parsed ASN.1 sequence resets the nesting-depth guard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The manual names the encryption and signing packages as depending on Bouncy Castle, so teams protecting or signing PDFs through PD4ML carry these until they move, and 1.86, the current release, is the one clear of them all, since records such as CVE-2026-18036 run from 1.73 to before 1.86. A separate test had PD4ML's &lt;code&gt;PdfSigner&lt;/code&gt; sign a PDF with the 1.85 Bouncy Castle jars on the classpath.&lt;/p&gt;

&lt;p&gt;The pin is easy to inherit without noticing. According to the manual, Maven resolves Bouncy Castle through PD4ML automatically, but the POM published for 4.1.2 lists none, so whatever versions end up in the build are the ones someone typed, and the manual's snippet offers 1.84. Maven Central doesn't carry PD4ML either, which means a Maven build first registers PD4ML's repository, &lt;code&gt;pd4ml.com/maven2&lt;/code&gt; in the manual.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layout Gaps Between the Feature List and a 4.1.2 Run
&lt;/h2&gt;

&lt;p&gt;PD4ML's features page says its engine lays out Flexbox and CSS Grid. In a 4.1.2 run, a &lt;code&gt;display: grid&lt;/code&gt; container with &lt;code&gt;grid-template-columns: 150px 150px 150px&lt;/code&gt; printed its three cards stacked down the left edge, and text coloured through &lt;code&gt;var(--brand)&lt;/code&gt; came out black. Flexbox held up in the same session, with a &lt;code&gt;space-between&lt;/code&gt; row spread correctly across the page.&lt;/p&gt;

&lt;p&gt;The second layout check is width. The manual gives 727 px as the default &lt;code&gt;htmlWidth&lt;/code&gt;, the width of the imaginary browser PD4ML lays the page out in, and a wider element is clipped at the right margin rather than scaled down.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.pd4ml.PD4ML&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.nio.charset.StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WideTableAt727&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// A 1000 px wide table, as a desktop page would lay it out, with htmlWidth left at its default.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;table border='1' style='width:1000px'&amp;gt;&amp;lt;tr&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;td&amp;gt;Region&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Q1&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Q2&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Q3&amp;lt;/td&amp;gt;&amp;lt;td style='text-align:right'&amp;gt;Year total&amp;lt;/td&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="no"&gt;PD4ML&lt;/span&gt; &lt;span class="n"&gt;pd4ml&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;PD4ML&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;pd4ml&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;readHTML&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ByteArrayInputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getBytes&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;UTF_8&lt;/span&gt;&lt;span class="o"&gt;)),&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FileOutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"wide-table.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;pd4ml&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;writePDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four of the five cells show on the page. &lt;code&gt;Year total&lt;/code&gt; is clipped at the right margin, though its text is still in the content stream and pypdf extracts it. A rerun with &lt;code&gt;pd4ml.setHtmlWidth(1000)&lt;/code&gt; ahead of &lt;code&gt;readHTML&lt;/code&gt; put it back, and &lt;code&gt;adjustHtmlWidth(true)&lt;/code&gt; from the manual sizes the window to the document instead. For grid layouts and shared design tokens, the fallback is a table or flexbox plus plain colour values in the stylesheet the PDF reads.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Evaluation Output Looks Like
&lt;/h2&gt;

&lt;p&gt;Every page of unlicensed PDF output has two blue watermark bands running vertically along its left and right margins. The manual calls evaluation mode watermarked with no restriction on functionality, yet a run asking &lt;code&gt;writePDF&lt;/code&gt; for &lt;code&gt;PdfSpec.PDFA_2B&lt;/code&gt; came back with an error status from &lt;code&gt;getLastRenderInfo&lt;/code&gt; stating that the license didn't permit PDF/A. Its metadata claimed PDF/A-2B, and veraPDF 1.30.3 passed the file as PDF/A-2B, where the 4.1.1 file failed on a broken header, so a build reading that status stops on output the validator accepts. The message points at licensing, and an evaluation license, a &lt;code&gt;pd4ml.lic&lt;/code&gt; file, can be requested from the PD4ML downloads page.&lt;/p&gt;

&lt;p&gt;Features are also split across PD4ML's four editions. The javadoc marks TrueType embedding through &lt;code&gt;useTTF&lt;/code&gt; and form generation as PRO features, and the products page starts DOCX at DMS and keeps PDF/UA in UA.&lt;/p&gt;

&lt;h2&gt;
  
  
  How IronPDF Handles Script, Grid and Wide Pages
&lt;/h2&gt;

&lt;p&gt;The script, grid and width results trace back to laying out HTML without a browser, and IronPDF for Java takes the other route. Every &lt;a href="https://ironpdf.com/java/object-reference/api/com/ironsoftware/ironpdf/PdfDocument.html" rel="noopener noreferrer"&gt;&lt;code&gt;PdfDocument&lt;/code&gt; render&lt;/a&gt; goes through a Chromium instance, so scripts on the page execute before the PDF is produced. Our 2026.11.3 run of a page with the same summing script, three grid columns and a &lt;code&gt;var()&lt;/code&gt; colour printed &lt;code&gt;42&lt;/code&gt;, laid the columns out side by side and applied the colour.&lt;/p&gt;

&lt;p&gt;When a layout is wider than the paper, the &lt;a href="https://ironpdf.com/java/object-reference/api/com/ironsoftware/ironpdf/render/ChromePdfRenderOptions.html" rel="noopener noreferrer"&gt;render option&lt;/a&gt; &lt;code&gt;UseFitToPageRendering&lt;/code&gt; takes its pixel width and scales it to the width of one sheet, which brought a 1,000 px table inside the page next to a canvas bar in our run, and the &lt;a href="https://ironpdf.com/java/examples/js-charts-to-pdf/" rel="noopener noreferrer"&gt;C3.js chart example&lt;/a&gt; waits a second before capture.&lt;/p&gt;

&lt;p&gt;It resolves from Maven Central as &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt;. Eleven versions shipped in 2026, ending with 2026.11.3 on 3 November, and nothing from Bouncy Castle turns up when Maven resolves it. IronPDF has a &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; for running your own script-heavy templates through it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Weighing PD4ML's Issues Before Production
&lt;/h2&gt;

&lt;p&gt;Missing script output, local files pulled in by untrusted markup, a Bouncy Castle 1.84 pin inside 28 CVE.org records, grid columns, custom properties and anything past 727 px lost in our runs, and a license error on a PDF/A request make up the PD4ML 4.1.2 list. For templates that depend on browser behavior, IronPDF for Java renders the same HTML in Chromium on &lt;a href="https://ironpdf.com/java/object-reference/api/com/ironsoftware/ironpdf/render/PaperSize.html" rel="noopener noreferrer"&gt;a paper size you choose&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;PD4ML is a trademark of its respective owner, we have no affiliation with its vendor, and the versions, advisories and behavior described above are taken from the vendor's public documentation, its Maven repository, public advisory databases and our own runs.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. PD4ML code run and claims checked by the Iron Software DevRel team against PD4ML 4.1.2, with IronPDF APIs checked against &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3, on 4 November 2026.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>security</category>
      <category>html</category>
    </item>
    <item>
      <title>Checking Open HTML to PDF 1.1.108: CVEs, Flex Rows, Fonts</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Thu, 05 Nov 2026 17:41:16 +0000</pubDate>
      <link>https://dev.to/ironsoftware/checking-open-html-to-pdf-11108-cves-flex-rows-fonts-p26</link>
      <guid>https://dev.to/ironsoftware/checking-open-html-to-pdf-11108-cves-flex-rows-fonts-p26</guid>
      <description>&lt;p&gt;A dependency scan on a build with Open HTML to PDF can report Batik, PDFBox or Commons IO advisories, even though NVD, OSV and GitHub's database list no CVE for the renderer's own jars. That scan result leads this post on 1.1.108, the 1 November 2026 release of the community fork under the &lt;code&gt;io.github.openhtmltopdf&lt;/code&gt; group ID. Flex rows, fonts, base URIs and XHTML parsing follow, tested on Java 17 or traced to the README and wiki on 4 November 2026.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Which CVEs Reach a Build Through Its Dependencies
&lt;/h2&gt;

&lt;p&gt;A search of the three main advisory sources (NVD, OSV and GitHub's database) on 4 November 2026 found no CVE for the renderer's own jars, under the old or the new group ID. The records a scanner reports come in with the modules' dependencies. CVSS 3.1 base scores below are from NVD, with the scorer named.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2022-38398 and CVE-2022-38648, score 5.3 Medium (NIST):&lt;/strong&gt; Server-side request forgery in Batik 1.14, fixed in Batik 1.15.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2022-40146, score 7.5 High (NIST):&lt;/strong&gt; Request forgery in Batik 1.14 that reaches files through a Jar URL, fixed in 1.15.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2022-42890, score 7.5 High (NIST):&lt;/strong&gt; Untrusted SVG runs Java code through JavaScript in Batik before 1.16.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2022-41704, score 7.5 High (NIST):&lt;/strong&gt; Untrusted Java code runs from an SVG in Batik before 1.16.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2022-44729 and CVE-2022-44730, scores 7.1 High and 4.4 Medium (NIST):&lt;/strong&gt; Request forgery in Batik up to 1.16, fixed in 1.17.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2022-34169, score 7.5 High (NIST):&lt;/strong&gt; Integer truncation in Xalan through 2.7.2 when it processes a malicious XSLT stylesheet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-33929, score 4.3 Medium (CISA-ADP):&lt;/strong&gt; Path traversal through the &lt;code&gt;ExtractEmbeddedFiles&lt;/code&gt; example shipped with PDFBox 2.0.24 to 2.0.36 and 3.0.0 to 3.0.7, fixed in 2.0.37 and 3.0.8.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2024-47554, score 4.3 Medium (CISA-ADP):&lt;/strong&gt; CPU exhaustion in &lt;code&gt;XmlStreamReader&lt;/code&gt; in Commons IO before 2.14.0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2021-29425, score 4.8 Medium (NIST):&lt;/strong&gt; Limited path traversal in &lt;code&gt;FilenameUtils.normalize&lt;/code&gt; in Commons IO before 2.7.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The seven Batik records apply to the &lt;code&gt;com.openhtmltopdf&lt;/code&gt; 1.0.10 SVG module, which depends on Batik 1.14, and that group ID has had no newer release. The Xalan record reaches the same module, through Xalan 2.7.2 from &lt;code&gt;batik-dom&lt;/code&gt; 1.14. The PDFBox record applies to 1.0.10, which uses PDFBox 2.0.24, and to every fork build on Maven Central before 1.1.100, which used PDFBox 3.0.2 to 3.0.7. GitHub's advisory files that example under the separate &lt;code&gt;pdfbox-examples&lt;/code&gt; artifact, but scanners that read NVD match on the PDFBox version even though the renderer never calls that example. CVE-2024-47554 applies to 1.1.108 as well, since its SVG module resolves &lt;code&gt;commons-io&lt;/code&gt; 2.11.0 through &lt;code&gt;xmlgraphics-commons&lt;/code&gt; 2.9, while OSV's range for CVE-2021-29425 takes in the &lt;code&gt;commons-io&lt;/code&gt; 1.3.1 that the 1.0.10 SVG module gets from &lt;code&gt;xmlgraphics-commons&lt;/code&gt; 2.6. Seven newer Batik CVEs sit outside those databases. Apache's security page rates them medium, ties them to the 1.20 release of 20 October 2026 and scopes them to 1.19 and older, so the Batik 1.17 that the 1.1.108 module uses falls in that range, with no NVD or OSV entry as of 4 November 2026. The library's own mitigations are Batik 1.17 and PDFBox 3.0.8 in 1.1.108 and a default &lt;code&gt;BatikSVGDrawer&lt;/code&gt; that blocks scripts and external requests inside SVG, and a &lt;code&gt;dependencyManagement&lt;/code&gt; entry in the &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/what-is-maven-in-java/" rel="noopener noreferrer"&gt;Maven&lt;/a&gt; build can lift Commons IO to a fixed 2.14.0 or newer.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Flex Row Stacks Instead of Sitting Side by Side
&lt;/h2&gt;

&lt;p&gt;Two panels in a flex row are the usual shape of a dashboard card.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.openhtmltopdf.pdfboxout.PdfRendererBuilder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.File&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FlexPanelsRow&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Two flex:1 panels meant to sit side by side, the shape of a dashboard card row.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;panel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"flex: 1; height: 600px; border: 1px solid #999;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;div style=\"display: flex; gap: 12px;\"&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div style=\""&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;panel&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\"&amp;gt;Renewals due in Q1&amp;lt;/div&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div style=\""&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;panel&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"\"&amp;gt;Renewals due in Q2&amp;lt;/div&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/div&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"renewal-panels.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;PdfRendererBuilder&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfRendererBuilder&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;withHtmlContent&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;toURI&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
            &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In 1.1.108 the log reported that &lt;code&gt;flex&lt;/code&gt; is not a recognized identifier, ignored &lt;code&gt;gap&lt;/code&gt; and both &lt;code&gt;flex&lt;/code&gt; declarations, and laid the panels out in block flow. Each panel took the full body width, the Q2 panel started partway down page one, and its border ran onto a second A4 page. According to the README's DISCLAIMER section, flex and grid layouts are unsupported, JavaScript is ignored everywhere in the code, and the suggested substitutes are HTML tables or floated inline blocks. A template built on a flex row or a grid needs that rewrite before it prints, and anything a page script draws or fills in, from a total to a &lt;a href="https://ironpdf.com/java/examples/js-charts-to-pdf/" rel="noopener noreferrer"&gt;JavaScript chart&lt;/a&gt;, has to be produced in Java first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Text Outside Western European Scripts Needs a Font File
&lt;/h2&gt;

&lt;p&gt;With no font registered, text falls back to the PDF built-in fonts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.openhtmltopdf.pdfboxout.PdfRendererBuilder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GreekWithoutFont&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// No font is registered, so the text falls back to the built-in PDF fonts.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;p&amp;gt;Invoice / Τιμολόγιο 2048&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"greek.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;PdfRendererBuilder&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfRendererBuilder&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;withHtmlContent&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing in the log mentioned the missing glyphs, and the PDF's text layer read &lt;code&gt;Invoice / ######### 2048&lt;/code&gt;, with each of the nine Greek letters replaced by the &lt;code&gt;#&lt;/code&gt; character. The project's Fonts wiki explains that the built-in fonts cover only a basic Western European character set and that a character with no glyph becomes the replacement character. Any document with Greek, Cyrillic, Arabic or Asian text needs a font file registered through &lt;code&gt;useFont&lt;/code&gt; or &lt;code&gt;@font-face&lt;/code&gt;, and the README rules out OpenType, so the file has to be TrueType. PDF/A and PDF/UA output bar the built-in fonts entirely, and PDF/A also needs an ICC profile that the project does not ship.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relative Images Need a Base URI, and Markup Needs to Be XHTML
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;withHtmlContent&lt;/code&gt; takes the markup and a base URI. Passing &lt;code&gt;null&lt;/code&gt; is legal, and nothing stops the render.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.openhtmltopdf.pdfboxout.PdfRendererBuilder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MissingBaseUri&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;img src=\"images/logo.png\" alt=\"Company logo\" /&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;p&amp;gt;Statement for October 2026&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"no-base.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;PdfRendererBuilder&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfRendererBuilder&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

            &lt;span class="c1"&gt;// No base URI, so the relative image path has nothing to resolve against.&lt;/span&gt;
            &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;withHtmlContent&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The log printed &lt;code&gt;Couldn't resolve relative URI(images/logo.png) because no base URI was provided&lt;/code&gt; three times, and the PDF came out with the text and no image. The program exits normally, so the missing logo shows up only when someone opens the file. The fix is a base URI such as the working folder's &lt;code&gt;file:&lt;/code&gt; URI, or &lt;code&gt;withFile&lt;/code&gt;, which uses the file's own location.&lt;/p&gt;

&lt;p&gt;Markup has its own entry condition. The renderer's parser is an XML parser, and a test HTML5 letter with an unclosed &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tag stopped &lt;code&gt;withFile&lt;/code&gt; with an &lt;code&gt;XRRuntimeException&lt;/code&gt; at line 7, column 3, leaving a zero-byte PDF. The README recommends parsing such files with Jsoup first and passing the renderer a &lt;code&gt;Document&lt;/code&gt;, which adds Jsoup to the build, and Jsoup's result has to be converted to the &lt;code&gt;org.w3c.dom.Document&lt;/code&gt; that &lt;code&gt;withW3cDocument&lt;/code&gt; takes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Release History of the Two Coordinates
&lt;/h2&gt;

&lt;p&gt;The last &lt;code&gt;com.openhtmltopdf&lt;/code&gt; release is 1.0.10, dated 13 September 2021, and danfickle's original repository, unarchived, has had no commit on its default branch since 1 April 2022. Because the fork's pipeline releases each push to main that changes more than Markdown files, its 103 versions count pushes and say little about the size of any one change. It went from 1.1.37 on 21 January 2026 to 1.1.38 on 3 July 2026 with nothing in between, then published 70 more by 1 November 2026. The wiki the README links is still hosted on the old repository and marked as not yet migrated, and the online sandbox carries a 1.0.10 label in the README. The project is distributed under LGPL-2.1-or-later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summing Up the Checks
&lt;/h2&gt;

&lt;p&gt;Open HTML to PDF needs flex and grid layouts rewritten, page scripts replaced, TrueType fonts registered for non-Latin text and for PDF/A, a base URI for relative images and well-formed XHTML input, and its dependency tree carries Batik, Xalan, PDFBox or Commons IO advisories depending on the build. For templates that come from a web front end, IronPDF for Java is a commercial alternative from Iron Software that renders that markup through Chromium.&lt;/p&gt;

&lt;p&gt;In our runs on 2026.11.3, two renewal panels stayed side by side in a flex row, a grid row took its reference from a page script with a &lt;code&gt;WaitFor&lt;/code&gt; delay, and a string with &lt;code&gt;&amp;amp;nbsp;&lt;/code&gt; and unclosed tags rendered with no Jsoup step. An &lt;code&gt;@font-face&lt;/code&gt; rule embedded its TrueType file in another run, the &lt;a href="https://ironpdf.com/java/examples/google-fonts-htmltopdf/" rel="noopener noreferrer"&gt;Google Fonts example&lt;/a&gt; shows the web-font route, and the &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/pdf-to-pdfa-java/" rel="noopener noreferrer"&gt;PDF/A guide&lt;/a&gt; converts after rendering, with PDF/A-1, 2 and 3 output passing veraPDF in our run.&lt;/p&gt;

&lt;p&gt;The library is declared as &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt;, and Maven Central carries eleven 2026 builds of it, from 2026.1.3 to 2026.11.3 on 3 November 2026. A &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; covers running your own templates before any purchase.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Open HTML to PDF, Apache PDFBox, Apache Batik, Apache Xalan, Apache Commons IO and Jsoup remain the property of their owners, we have no affiliation with those projects, and what we say about them is based on their READMEs, wiki pages, Apache's security page, Maven Central metadata and the NVD, OSV and GitHub records.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. Code run and claims checked by the Iron Software DevRel team against Open HTML to PDF 1.1.108, with IronPDF APIs checked against &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3, on 4 November 2026.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>html</category>
      <category>security</category>
    </item>
    <item>
      <title>Docmosis in Java Setup: License Key, LibreOffice, Security</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Thu, 05 Nov 2026 04:30:22 +0000</pubDate>
      <link>https://dev.to/ironsoftware/docmosis-in-java-setup-license-key-libreoffice-security-2h6c</link>
      <guid>https://dev.to/ironsoftware/docmosis-in-java-setup-license-key-libreoffice-security-2h6c</guid>
      <description>&lt;p&gt;Before a Java service can turn a Docmosis template into a PDF, it needs a jar that Maven Central does not carry, a license key the core accepts and a LibreOffice converter on a host it can reach. All three apply to Docmosis-Java 4.9.1, the current embedded library from May 2026, so they come first here, ahead of the advisories and the PDF/A ceiling. Where the library would run we show its output, and otherwise we name the public record behind the claim, whether the vendor's documentation and release notes, NVD, LibreOffice's advisories, GitHub or Maven Central.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing the Jar Without Maven Central
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;com.docmosis&lt;/code&gt; group on Maven Central holds three Docmosis Cloud SDKs and no Docmosis-Java artifact, so the 4.9.1 jar comes out of the vendor's zip and goes into a local repository with &lt;code&gt;mvn install:install-file&lt;/code&gt;. This &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/what-is-maven-in-java/" rel="noopener noreferrer"&gt;introduction to Maven&lt;/a&gt; explains what a POM file declares, and the POM is where this install can go wrong. Run with the usual flags on Maven 3.9.16, which Apache now lists as previous stable, the install succeeded and the first compile of a project that depends on it stopped with these lines, trimmed here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ERROR] Failed to read artifact descriptor for com.docmosis:docmosis-java:jar:4.9.1
[ERROR]   Caused by: The following artifacts could not be resolved: com.docmosis:docmosis:pom:4.9.1 (absent)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Several poms are packed inside the jar, and Maven registered one whose parent, &lt;code&gt;com.docmosis:docmosis&lt;/code&gt;, does not exist on Central. The workaround is one more flag, which tells Maven to generate a minimal pom without the parent reference.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn &lt;span class="nb"&gt;install&lt;/span&gt;:install-file &lt;span class="nt"&gt;-Dfile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;java-4.9.1.jar &lt;span class="nt"&gt;-DgroupId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;com.docmosis &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-DartifactId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;docmosis-java &lt;span class="nt"&gt;-Dversion&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4.9.1 &lt;span class="nt"&gt;-Dpackaging&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;jar &lt;span class="nt"&gt;-DgeneratePom&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;-DgeneratePom=true&lt;/code&gt; the same project compiled. Maven 3.10.0, out since 27 September 2026 and Apache's current version, wrote that minimal pom without the flag, and the project compiled there too. Each Docmosis upgrade repeats the install, as does each machine that does not pull from a shared company repository, and the coordinates are a local choice because the vendor publishes none.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting the Core Without a Valid Key
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;Configuration&lt;/code&gt; class is the start-up route the Developer Reference recommends, and it checks the key before it looks for LibreOffice. The manual's own sample chains &lt;code&gt;setOpenOfficeLocation&lt;/code&gt;, which the 4.9.1 jar does not contain, so the code below calls &lt;code&gt;setOfficeLocation&lt;/code&gt; instead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.docmosis.SystemManager&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.docmosis.util.Configuration&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ConfiguredStart&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// The Configuration route keeps the settings out of global system properties.&lt;/span&gt;
        &lt;span class="nc"&gt;Configuration&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Configuration&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;standard&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setKeyAndSite&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"YOUR-LICENSE-KEY"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"YOUR-SITE-NAME"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setOfficeLocation&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"C:/Program Files/LibreOffice"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Start-up validates the key before it looks for LibreOffice.&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;SystemManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initialise&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"converters online"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getClass&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;getSimpleName&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;": "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getMessage&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;SystemManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;release&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The run printed &lt;code&gt;InvalidLicenseException: Unable to process the license:com.docmosis.util.InvalidLicenseException:No valid license available.&lt;/code&gt; and no converter came online. Data preparation, on the other hand, runs without a key, which makes the gap easy to miss in unit tests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.docmosis.document.DocumentProcessor&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.docmosis.template.population.DataProvider&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.docmosis.template.population.DataProviderBuilder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.File&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OrderJsonThenRender&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"{\"orderId\":\"PO-7731\",\"items\":[{\"sku\":\"A-100\",\"qty\":4},{\"sku\":\"B-220\",\"qty\":12}]}"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;// The JSON maps onto template data with no key and no converter involved.&lt;/span&gt;
        &lt;span class="nc"&gt;DataProviderBuilder&lt;/span&gt; &lt;span class="n"&gt;dpb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DataProviderBuilder&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;dpb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addJSONString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;DataProvider&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dpb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getDataProvider&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"orderId"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" items: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getDataProviderCount&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"items"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

        &lt;span class="c1"&gt;// The PDF step is where the started core and its LibreOffice converter come in.&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;DocumentProcessor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;renderDoc&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"purchase-order.docx"&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"purchase-order.pdf"&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;IllegalStateException&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"render: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getMessage&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the output read &lt;code&gt;PO-7731 items: 2&lt;/code&gt;, followed by an &lt;code&gt;IllegalStateException&lt;/code&gt; saying the store is unavailable until the factory is initialised, and no &lt;code&gt;purchase-order.pdf&lt;/code&gt; appeared. A test suite can pass on the data side, yet with no key this render path produced no document. The vendor offers a 30-day trial key for evaluation, limited to one converter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tornado CVEs and the LibreOffice Patch Cycle
&lt;/h2&gt;

&lt;p&gt;NVD returned four CVEs for a Docmosis keyword search on 4 November 2026, every one of them filed against the Tornado server product and none against Docmosis-Java.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2023-25264, CVSS 3.1 score 7.5 (NIST):&lt;/strong&gt; Crafted relative path segments bypass authentication in Tornado before 2.9.5.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2023-25265, CVSS 3.1 score 7.5 (NIST):&lt;/strong&gt; A directory traversal in Tornado 2.9.4 and earlier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2023-25266, CVSS 3.1 score 8.8 (NIST):&lt;/strong&gt; A signed-in user can redirect Tornado's office path to a network share and have Tornado run the &lt;code&gt;soffice&lt;/code&gt; binary found there, in releases before 2.9.5.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2024-42733, CVSS 3.1 score 9.8 (CISA-ADP):&lt;/strong&gt; Code execution through a crafted script sent to the UNC path input in Tornado 2.9.7 and earlier, its only score, with no fixed version listed by NVD.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NVD gives 2.9.5 as the fixed release for the first three. The GitHub report NVD cites for the fourth says those fixes could be bypassed in 2.9.7, and a Docmosis commit dated 4 November 2024 closed that report by moving its Docker image to Tornado 2.10.0, stating that all items have been addressed.&lt;/p&gt;

&lt;p&gt;The Tornado 2.11.4 release notes (August 2026) add a flaw with no CVE, one of several security fixes those notes list without a number. The &lt;code&gt;storeTo=file:&lt;/code&gt; option of the render API could write generated content to unintended locations, and 2.11.4 disables it until a path whitelist is configured.&lt;/p&gt;

&lt;p&gt;LibreOffice keeps its own advisory list, so a converter host has a second set of records to read, for Docmosis-Java and Tornado alike. On 5 October 2026 it published six, CVE-2026-63266 through CVE-2026-63270 plus CVE-2026-63277, whose records name the 26.2 series below 26.2.5, with the fixes shipped in versions 26.2.5 and 26.8.0. Its page now adds CVE-2026-76181, fixed in 26.2.6 and 26.8.1. Whether any of them applies depends on the version a host runs, and the Docmosis 4.9.1 download page names LibreOffice 7. The Docmosis manual asks for automatic updates to stay off.&lt;/p&gt;

&lt;h2&gt;
  
  
  LibreOffice on Every Converter Host
&lt;/h2&gt;

&lt;p&gt;Every converter runs on LibreOffice, so each machine hosting one carries that office suite. Version 6 is the minimum in the Developer Reference, while the 4.9.1 download page names version 7. The JVM and LibreOffice have to share a bitness, LibreOffice 7 or newer needs Java 8 or newer, servers should match each other version for version, and Linux machines need a set of X libraries. When converters do not launch, the Developer Reference points first at the LibreOffice setup. Release 4.9.0 from October 2025 lists turning off automatic updates for LibreOffice 24 among its stability fixes.&lt;/p&gt;

&lt;p&gt;Where the converters live is a choice between two sets of costs. Run embedded, they share a JVM with the Docmosis core, stay on that one machine, and go down and come up only together with the core. Run remotely, each machine needs its own office install plus a service that starts the converter at boot. Initialisation is slow enough that the manual recommends doing it once per application lifetime.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTML Snippets, Floating Images and PDF/A Levels
&lt;/h2&gt;

&lt;p&gt;Docmosis templates are Word or Writer documents, so HTML arrives through a &lt;code&gt;&amp;lt;&amp;lt;html:name&amp;gt;&amp;gt;&lt;/code&gt; field. The Template Guide cautions that complex HTML can come out differently in the document than in a browser, and it points users to inline styles and simple snippets. Pictures in Word templates must be inline too, since Docmosis locates each one through a bookmark that Word strips from floating pictures.&lt;/p&gt;

&lt;p&gt;Archive output follows the installed LibreOffice. &lt;code&gt;setPdfVersion&lt;/code&gt; on &lt;code&gt;ConversionInstruction&lt;/code&gt; offers PDF/A-1b, PDF/A-2b from LibreOffice 6 and PDF/A-3b from LibreOffice 7, the 4.9.1 &lt;code&gt;PdfVersion&lt;/code&gt; enum has no a-level entry, and &lt;code&gt;setPdfArchiveMode&lt;/code&gt; has been deprecated since 4.8.0. The &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/pdf-to-pdfa-java/" rel="noopener noreferrer"&gt;PDF/A guide for Java&lt;/a&gt; explains what the archive format is for. By default a broken field is printed into the output in red, because the populator's fatal-error property starts as false, and the vendor tells production systems to switch it on.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Route Without the Converter Pool
&lt;/h2&gt;

&lt;p&gt;IronPDF for Java, sold commercially by Iron Software, replaces the converter with its own engine. Templates are HTML and CSS, rendered by Chromium with page JavaScript on by default. Rendering happens in IronPdfEngine, which is downloaded for the platform the first time the library runs or bundled through a platform-specific Maven artifact, so no LibreOffice goes on the host and engine updates arrive with IronPDF upgrades. &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; itself is an ordinary Maven Central coordinate, published eleven times in 2026 up to version 2026.11.3, and the engine can also run on a separate server kept at the matching version, as the &lt;a href="https://ironpdf.com/java/get-started/use-ironpdfengine/" rel="noopener noreferrer"&gt;IronPdfEngine guide&lt;/a&gt; shows.&lt;/p&gt;

&lt;p&gt;With IronPDF, the purchase order becomes an HTML string passed to &lt;code&gt;PdfDocument.renderHtmlAsPdf&lt;/code&gt;. We ran one on 2026.11.3 and veraPDF passed the converted file as PDF/A-3b, and a version of the page with a title and language set also passed through &lt;code&gt;convertToPdfA&lt;/code&gt; as PDF/A-1a, 2a and 3a, the a-levels that Docmosis enum lacks. IronPDF offers a &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; for running it against your own templates, and the &lt;a href="https://ironpdf.com/java/examples/file-to-pdf/" rel="noopener noreferrer"&gt;HTML file example&lt;/a&gt; covers templates kept on disk.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap of the Docmosis Checks
&lt;/h2&gt;

&lt;p&gt;Docmosis-Java 4.9.1 needs a manual Maven install, with &lt;code&gt;-DgeneratePom=true&lt;/code&gt; on Maven 3.9.16, a valid key at start-up and LibreOffice installed on every converter host, and its PDF/A levels stop at 3b, while Tornado's record holds four CVEs plus fixes with no number, such as the &lt;code&gt;storeTo=file:&lt;/code&gt; flaw. IronPDF for Java takes HTML templates in place of Word ones, resolves from Central and renders in Chromium, and its &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/java-create-pdf-from-template-tutorial/" rel="noopener noreferrer"&gt;guide to PDFs from templates&lt;/a&gt; shows the HTML template setup.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Docmosis is a trademark of Docmosis Pty Ltd, LibreOffice belongs to its owner, we have no affiliation with either, and the details here come from the vendor's public manuals and release notes, NVD, the LibreOffice advisories page, GitHub and Maven Central.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. Docmosis code run against Docmosis-Java 4.9.1 and Maven 3.9.16 and 3.10.0, and claims checked by the Iron Software DevRel team on 4 November 2026, with &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3 as the IronPDF reference.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>security</category>
      <category>libreoffice</category>
    </item>
    <item>
      <title>Testing DynamicReports 6.20: Grouped Totals and Encryption</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Thu, 05 Nov 2026 04:30:10 +0000</pubDate>
      <link>https://dev.to/ironsoftware/testing-dynamicreports-620-grouped-totals-and-encryption-3b1i</link>
      <guid>https://dev.to/ironsoftware/testing-dynamicreports-620-grouped-totals-and-encryption-3b1i</guid>
      <description>&lt;p&gt;Grouped totals that split in two, an encrypted export that needs an extra jar, HTML that loses its tables, and a dependency tree with remote code execution advisories are the issues we hit when we put DynamicReports 6.20.1 through a set of test reports on Java 17. The library builds JasperReports report designs through a fluent API in Java, and 6.20.1, published on 21 November 2023, is its newest release. Each issue below comes with the run or the advisory record behind it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Grouped Totals Split When Rows Arrive Unsorted
&lt;/h2&gt;

&lt;p&gt;A DynamicReports group breaks every time the grouping value changes from one row to the next. It does not collect matching rows together, so the order of the data decides the layout. The listing below groups four orders by customer, with one Harbor Supply order arriving last.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;col&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;grp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sbt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.math.BigDecimal&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.dynamicreports.report.builder.column.TextColumnBuilder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.dynamicreports.report.builder.group.ColumnGroupBuilder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.dynamicreports.report.datasource.DRDataSource&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UnsortedGroupReport&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;TextColumnBuilder&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Customer"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"customer"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stringType&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="nc"&gt;TextColumnBuilder&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Order"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"orderId"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stringType&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="nc"&gt;TextColumnBuilder&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;BigDecimal&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Amount"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"amount"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bigDecimalType&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;

        &lt;span class="c1"&gt;// The last row belongs to Harbor Supply but arrives after the Northwind Tools rows.&lt;/span&gt;
        &lt;span class="nc"&gt;DRDataSource&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DRDataSource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"customer"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"orderId"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"amount"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Harbor Supply"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"A-100"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"1250.00"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Northwind Tools"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"A-101"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"86.40"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Northwind Tools"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"A-103"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"442.10"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Harbor Supply"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"A-102"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"310.75"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

        &lt;span class="nc"&gt;ColumnGroupBuilder&lt;/span&gt; &lt;span class="n"&gt;byCustomer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;grp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"orders-unsorted.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
                    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;columns&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;groupBy&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;byCustomer&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;subtotalsAtGroupFooter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;byCustomer&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sbt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="n"&gt;sbt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sum&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
                    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setDataSource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toPdf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The PDF holds three groups instead of two. Harbor Supply appears first with one order and a subtotal of 1,250.00, Northwind Tools follows with two orders and 528.50, and a second Harbor Supply group closes the page with one order and 310.75. Nothing in the run warns about it. Any report fed from a query without a matching &lt;code&gt;ORDER BY&lt;/code&gt; can print a customer twice with two partial subtotals. Adding &lt;code&gt;sortBy(customer)&lt;/code&gt; to the builder, or sorting the query, merged the two Harbor Supply orders into a single group (2 orders, 1,560.75) in a follow-up run.&lt;/p&gt;

&lt;p&gt;The same class of quiet output change shows up in number columns. &lt;code&gt;type.doubleType()&lt;/code&gt; formats with the pattern &lt;code&gt;#,##0.#&lt;/code&gt;, so a &lt;code&gt;double&lt;/code&gt; price of 8.99 printed as 9 in a separate run, while &lt;code&gt;type.bigDecimalType()&lt;/code&gt; keeps at least two decimal places.&lt;/p&gt;

&lt;h2&gt;
  
  
  Encrypted Export Needs Bouncy Castle and a 128-Bit Switch
&lt;/h2&gt;

&lt;p&gt;Encryption is configured on a &lt;code&gt;JasperPdfExporterBuilder&lt;/code&gt;. The listing below sets metadata, both passwords, a print permission and the 128-bit key flag, then writes the JasperReports design out as JRXML.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;col&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;export&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.math.BigDecimal&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.dynamicreports.jasper.builder.JasperReportBuilder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.dynamicreports.jasper.builder.export.JasperPdfExporterBuilder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.dynamicreports.jasper.constant.PdfPermission&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.dynamicreports.report.datasource.DRDataSource&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ProtectedOrderExport&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;DRDataSource&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DRDataSource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"orderId"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"amount"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"A-100"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"1250.00"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"A-101"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"86.40"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

        &lt;span class="nc"&gt;JasperReportBuilder&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;columns&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                        &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Order"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"orderId"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stringType&lt;/span&gt;&lt;span class="o"&gt;()),&lt;/span&gt;
                        &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Amount"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"amount"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bigDecimalType&lt;/span&gt;&lt;span class="o"&gt;()))&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setDataSource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// An exporter builder carries the metadata and encryption settings that toPdf(OutputStream) leaves at defaults.&lt;/span&gt;
        &lt;span class="c1"&gt;// Encryption needs bcprov-jdk18on on the classpath, and setBitKey128 lifts the 40-bit default key.&lt;/span&gt;
        &lt;span class="nc"&gt;JasperPdfExporterBuilder&lt;/span&gt; &lt;span class="n"&gt;pdf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;export&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;pdfExporter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"orders-protected.pdf"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setMetadataTitle&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Open orders"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setMetadataAuthor&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Accounts team"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setEncrypted&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setBitKey128&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setUserPassword&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"reader"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setOwnerPassword&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"owner"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PdfPermission&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;PRINTING&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toPdf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// The same builder can also write out the JasperReports design it generated.&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;jrxml&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"orders.jrxml"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toJrXml&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jrxml&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things stand between this listing and a working file. With only &lt;code&gt;dynamicreports-core&lt;/code&gt; declared, the first encrypted export threw &lt;code&gt;NoClassDefFoundError&lt;/code&gt; for a Bouncy Castle class from inside OpenPDF's &lt;code&gt;PdfEncryption&lt;/code&gt;, because OpenPDF 1.3.30.jaspersoft.3, the PDF writer JasperReports 6.20.6 uses, lists Bouncy Castle as an optional dependency. Adding &lt;code&gt;org.bouncycastle:bcprov-jdk18on&lt;/code&gt; 1.86 fixed that. The second is the key length. Without &lt;code&gt;setBitKey128(true)&lt;/code&gt;, a run of the same exporter wrote an encryption dictionary with V 1 and R 2, which is 40-bit RC4. With the flag set as above, the dictionary moves to version 2, revision 3 and a 128-bit RC4 key, and the file opens with the password &lt;code&gt;reader&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Teams that protect payslips or statements this way should check both settings in their build, since the missing class only shows up when an encrypted export runs, and the key length only in the file's encryption dictionary. The walkthrough on &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/password-protect-pdf-java/" rel="noopener noreferrer"&gt;password protecting a PDF in Java&lt;/a&gt; shows how a password and print and copy restrictions are applied to a file.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Happens to HTML Passed Through Markup.HTML?
&lt;/h2&gt;

&lt;p&gt;DynamicReports has no HTML or CSS input. A report is a chain of builder calls, and the only place HTML enters is a text field whose markup is set to &lt;code&gt;Markup.HTML&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;cmp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dynamicreports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;DynamicReports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;report&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.dynamicreports.report.constant.Markup&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HtmlMarkupReport&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// A text field with HTML markup is the closest the builder gets to HTML input.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;b&amp;gt;Invoice 1042&amp;lt;/b&amp;gt; &amp;lt;i&amp;gt;due 30 November&amp;lt;/i&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Widget&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;120&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div style=\"display:flex\"&amp;gt;&amp;lt;span&amp;gt;Left&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;Right&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"html-markup.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
                    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cmp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;setMarkup&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Markup&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;HTML&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
                    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toPdf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bold and italic runs came through in Helvetica-Bold and Helvetica-Oblique. The table did not. &lt;code&gt;Widget&lt;/code&gt; and &lt;code&gt;120&lt;/code&gt; printed on two separate lines at the left margin, and the flex container printed &lt;code&gt;LeftRight&lt;/code&gt;, which is also what a browser gives two unspaced spans, so this short test says nothing about flex either way. A team with existing HTML invoice or statement templates would have to rebuild each one as a report design, in Java or through a JRXML file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remote Code Execution Advisories Arrive With JasperReports
&lt;/h2&gt;

&lt;p&gt;Declaring &lt;code&gt;dynamicreports-core&lt;/code&gt; 6.20.1 alone in an empty Maven project pulls in JasperReports 6.20.6, because the parent POM's &lt;code&gt;jasperreportsVersion&lt;/code&gt; property says so. OSV lists nothing against DynamicReports itself on 4 November 2026, but the resolved tree matches a longer list, which starts with these.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2025-10492 (GHSA-7c3f-cg9x-f3gr), CVSS 3.1 score 9.8 (NIST):&lt;/strong&gt; A Java deserialization flaw in JasperReports 6.20.6 that NVD describes as allowing remote code execution through externally supplied data. The CNA gives 8.7 High under CVSS 4.0, and 7.0.4 clears it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-6009 (GHSA-9wxq-mwqw-8hhg), CVSS 4.0 score 8.7 (CNA):&lt;/strong&gt; Another deserialization flaw in that JasperReports build, which NVD says can lead to remote code execution. NVD analysis is still pending, and 7.0.7 clears it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2025-48734, CVSS 3.1 score 8.8 (CISA ADP):&lt;/strong&gt; An access control issue that commons-beanutils 1.9.4 matches, cleared by 1.11.0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2025-52999, CVSS 4.0 score 8.7 (CNA):&lt;/strong&gt; Deeply nested input overflows the stack in jackson-core 2.14.1, cleared by 2.15.0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2025-48924 and CVE-2024-47554, CVSS 3.1 scores 5.3 and 4.3 (CISA ADP):&lt;/strong&gt; They match commons-lang3 3.13.0 and commons-io 2.11.0, cleared by 3.18.0 and 2.14.0.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Eleven further GHSA entries from the June to September 2026 window match &lt;code&gt;jackson-databind&lt;/code&gt; 2.14.1. CVE.org also holds CVE-2026-110879 for that version, scored 9.8 by HeroDevs and cleared by 2.18.12, which describes command execution where Spring is on the classpath and which an OSV package query misses. The same tree falls inside CVE-2026-89425 for &lt;code&gt;jackson-core&lt;/code&gt; (7.5 from HeroDevs, cleared by 2.18.11) and CVE-2026-78254 for &lt;code&gt;ant&lt;/code&gt; 1.7.1 (7.4 from CISA ADP, cleared by 1.10.18). NVD marks none of these CVEs as disputed. Both JasperReports fixes exist only on the 7.x line, so the last 6.x build on Maven Central, 6.21.5, sits inside both ranges as well. &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/what-is-maven-in-java/" rel="noopener noreferrer"&gt;Maven's dependency management system&lt;/a&gt; decides which of these versions a real application ends up with, so the scan of the actual build is the one that counts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Can a Version Pin Not Clear the JasperReports Advisories?
&lt;/h2&gt;

&lt;p&gt;Pinning JasperReports 7.0.7 in &lt;code&gt;dependencyManagement&lt;/code&gt;, with its separate &lt;code&gt;jasperreports-pdf&lt;/code&gt; and &lt;code&gt;jasperreports-json&lt;/code&gt; artifacts added, compiled the grouped report above cleanly against 6.20.1. The export did not run. Each attempt ended in &lt;code&gt;NoClassDefFoundError&lt;/code&gt; with a zero-byte PDF, naming &lt;code&gt;SimpleJsonMetadataReportConfiguration&lt;/code&gt; or &lt;code&gt;SimplePdfReportConfiguration&lt;/code&gt; from &lt;code&gt;net.sf.jasperreports.export&lt;/code&gt; depending on the run. JasperReports 7 moved both classes to new packages, so the advisory fix needs a DynamicReports build made for JasperReports 7.&lt;/p&gt;

&lt;p&gt;That build has not been released. Maven Central's newest &lt;code&gt;dynamicreports-core&lt;/code&gt; is still 6.20.1, and the GitHub releases page ends at the same tag. The default &lt;code&gt;development&lt;/code&gt; branch carries 7.0.0-SNAPSHOT pinned to JasperReports 7.0.6, which clears the first advisory but not the second, and nothing has been committed to it since 30 March 2026. A user request for a 7.x build, issue #198, dates from 5 December 2024 and is still open. That leaves the 7.0.0-SNAPSHOT on Sonatype's snapshot repository, last redeployed on 30 October 2026, or a source build, either way with its JasperReports version bumped to 7.0.7 by hand, a route read from the POM and not run for this post. Both 6.20 releases also require Java 17, class file version 61, and teams on Java 8 or 11 stay on 6.12.1 from May 2021. DynamicReports is licensed under the LGPL-3.0.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where These DynamicReports Issues Leave a Reporting Stack
&lt;/h2&gt;

&lt;p&gt;Unsorted groups, rounded doubles, encryption that needs an extra jar and a flag, markup without tables, and two JasperReports advisories that a version pin cannot clear all come with DynamicReports 6.20.1.&lt;/p&gt;

&lt;p&gt;IronPDF for Java takes a different route to a PDF report. It renders HTML with a Chromium engine, and in our 2026.11.3 run the markup test above kept &lt;code&gt;Widget&lt;/code&gt; and &lt;code&gt;120&lt;/code&gt; in one table row. &lt;a href="https://ironpdf.com/java/examples/js-charts-to-pdf/" rel="noopener noreferrer"&gt;Chart scripts&lt;/a&gt; run when &lt;code&gt;setEnableJavaScript&lt;/code&gt; is on, with &lt;code&gt;setWaitFor&lt;/code&gt; giving them time before the capture. The library resolves from Maven Central as &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt;, with no JasperReports in its POM and eleven 2026 releases, the latest 2026.11.3 on 3 November 2026.&lt;/p&gt;

&lt;p&gt;The grouping and number formatting move into the Java code that writes the rows. The &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/java-pdf-report-generator-tutorial/" rel="noopener noreferrer"&gt;Java PDF report generator tutorial&lt;/a&gt; shows a report table written as an HTML string in Java, and &lt;code&gt;getSecurity().setPassword()&lt;/code&gt; encrypted the finished file with a 128-bit RC4 key in our run. A &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; is enough to render one of your current reports from HTML and compare the files.&lt;/p&gt;

&lt;p&gt;Has a split group or a rounded total turned up in your DynamicReports output, and what fixed it?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;DynamicReports and JasperReports are trademarks of their respective owners, we have no affiliation with either project, and the facts above are based on the project's public repository, Maven Central, NVD, OSV, CVE.org and runs of each listing.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. Code run and claims checked by the Iron Software DevRel team against &lt;code&gt;net.sourceforge.dynamicreports:dynamicreports-core&lt;/code&gt; 6.20.1 and &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3 on 4 November 2026.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>reporting</category>
      <category>security</category>
    </item>
    <item>
      <title>iText pdfHTML in Practice: Invoice Totals, CSS and Signing</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Thu, 05 Nov 2026 04:30:04 +0000</pubDate>
      <link>https://dev.to/ironsoftware/itext-pdfhtml-in-practice-invoice-totals-css-and-signing-h05</link>
      <guid>https://dev.to/ironsoftware/itext-pdfhtml-in-practice-invoice-totals-css-and-signing-h05</guid>
      <description>&lt;p&gt;An invoice template with three line items and a script that adds them up came out of iText pdfHTML with a total of 0.00. That 4 November 2026 run on Java 17 opens this look at pdfHTML 6.3.4 and iText Core 9.8.0, on Maven Central since 30 September 2026. CSS rules that never reach the page, a signing setup that stops on a missing module, advisories on older releases and lines that only receive security patches follow, with every output taken from that day's runs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Scripts Never Execute During Conversion
&lt;/h2&gt;

&lt;p&gt;According to iText's knowledge base, JavaScript is not evaluated by pdfHTML, and the HTML feature FAQ lists the &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag as unsupported. The invoice below leaves its total row at 0.00 and expects a script to fill it in.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.itextpdf.html2pdf.HtmlConverter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.IOException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ScriptedInvoice&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// The table has three line items, and the script is meant to add them up into the total row.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;Invoice INV-2026-0418&amp;lt;/h1&amp;gt;&amp;lt;table id='items'&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Paper&amp;lt;/td&amp;gt;&amp;lt;td class='amt'&amp;gt;120.50&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Toner&amp;lt;/td&amp;gt;&amp;lt;td class='amt'&amp;gt;89.99&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Binders&amp;lt;/td&amp;gt;&amp;lt;td class='amt'&amp;gt;42.00&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Total&amp;lt;/td&amp;gt;&amp;lt;td id='total'&amp;gt;0.00&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;script&amp;gt;var sum = 0;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"document.querySelectorAll('.amt').forEach(function (c) { sum += parseFloat(c.textContent); });"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"document.getElementById('total').textContent = sum.toFixed(2);&amp;lt;/script&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"scripted-invoice.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;HtmlConverter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;convertToPdf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;scripted-invoice.pdf&lt;/code&gt; is a single page of 1,345 bytes, and its total row reads &lt;code&gt;0.00&lt;/code&gt;, where the script would have written 252.49. A canvas chart drawn by a script fares the same way, and in a second run the canvas area held no drawing at all, not even its border. Templates that compute totals, format dates or draw &lt;a href="https://ironpdf.com/java/examples/js-charts-to-pdf/" rel="noopener noreferrer"&gt;charts with JavaScript&lt;/a&gt; are the ones affected. iText's documented workaround is to load the page in headless Chrome through Selenium WebDriver and a &lt;code&gt;chromedriver&lt;/code&gt; binary, then hand the evaluated HTML to pdfHTML.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS That Chrome Draws and pdfHTML Skips
&lt;/h2&gt;

&lt;p&gt;The FAQ, written against pdfHTML 6.3.3, has a long list of CSS marked unsupported. It includes &lt;code&gt;box-shadow&lt;/code&gt;, &lt;code&gt;text-shadow&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, &lt;code&gt;mix-blend-mode&lt;/code&gt;, &lt;code&gt;writing-mode&lt;/code&gt;, &lt;code&gt;z-index&lt;/code&gt;, &lt;code&gt;text-decoration-style&lt;/code&gt;, and pseudo-elements such as &lt;code&gt;::marker&lt;/code&gt;, &lt;code&gt;::first-line&lt;/code&gt; and &lt;code&gt;::first-letter&lt;/code&gt;. Flexbox and grid are marked supported. The snippet below uses three of the unsupported rules.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.itextpdf.html2pdf.HtmlConverter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.IOException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DecoratedInvoice&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// A drop cap, a wavy underline and vertical text, three rules the pdfHTML FAQ marks as unsupported.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"p.note::first-letter { font-size: 32pt; color: #c0392b; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"h1 { text-decoration: underline; text-decoration-style: wavy; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;".stamp { writing-mode: vertical-rl; background: #f1c40f; padding: 6px; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;h1&amp;gt;Invoice INV-2026-0418&amp;lt;/h1&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;p class='note'&amp;gt;Payment is due within 30 days.&amp;lt;/p&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div class='stamp'&amp;gt;PAID&amp;lt;/div&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"decorated-invoice.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;HtmlConverter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;convertToPdf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;decorated-invoice.pdf&lt;/code&gt; (1,364 bytes) the note's first letter is the same 12-point black as the rest of the line, the heading's underline is a straight line, and &lt;code&gt;PAID&lt;/code&gt; runs horizontally across a full-width yellow band. Release 6.3.4, which postdates the FAQ, brought initial &lt;code&gt;vertical-rl&lt;/code&gt; and &lt;code&gt;vertical-lr&lt;/code&gt; handling that applies only with &lt;code&gt;text-orientation&lt;/code&gt; set to &lt;code&gt;upright&lt;/code&gt;, and once that property was added, a further run stacked the four letters of &lt;code&gt;PAID&lt;/code&gt; one above the other. A related run with &lt;code&gt;text-shadow&lt;/code&gt;, &lt;code&gt;box-shadow&lt;/code&gt; and &lt;code&gt;filter: grayscale(100%)&lt;/code&gt; gave the same result, with no shadow under the text or the card and the card still in its original blue. Teams that reuse stylesheets from a web front end lose these effects with no exception, and the FAQ lists no substitutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Signing Stops Without a Bouncy Castle Adapter
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;html2pdf&lt;/code&gt; 6.3.4 brings in &lt;code&gt;kernel&lt;/code&gt;, &lt;code&gt;layout&lt;/code&gt;, &lt;code&gt;forms&lt;/code&gt;, &lt;code&gt;svg&lt;/code&gt;, &lt;code&gt;pdfa&lt;/code&gt; and &lt;code&gt;pdfua&lt;/code&gt;, but not &lt;code&gt;sign&lt;/code&gt;, so signing starts with a second dependency. The class below signs the invoice with a PAdES Baseline B signature from a self-signed PKCS#12 key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.itextpdf.kernel.pdf.PdfReader&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.itextpdf.signatures.PdfPadesSigner&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.itextpdf.signatures.SignerProperties&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileInputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.InputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.security.KeyStore&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.security.PrivateKey&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.security.cert.Certificate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SignInvoice&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"changeit"&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toCharArray&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="nc"&gt;KeyStore&lt;/span&gt; &lt;span class="n"&gt;keyStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;KeyStore&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getInstance&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"PKCS12"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;InputStream&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileInputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"keys/signer.p12"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;keyStore&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="nc"&gt;PrivateKey&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PrivateKey&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;keyStore&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getKey&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"signer"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;Certificate&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;chain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;keyStore&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getCertificateChain&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"signer"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// PAdES Baseline B, the level that needs no timestamp authority.&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"invoice-signed.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;PdfPadesSigner&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfReader&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"invoice.pdf"&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;signWithBaselineBProfile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SignerProperties&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;setFieldName&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Approval"&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="n"&gt;chain&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;html2pdf&lt;/code&gt; and &lt;code&gt;sign&lt;/code&gt; alone on the classpath, the class compiled and then threw an &lt;code&gt;UnsupportedOperationException&lt;/code&gt; from &lt;code&gt;signWithBaselineBProfile&lt;/code&gt;, whose message asks for one of the two Bouncy Castle adapter artifacts before any cryptographic call can run. The failed run also left an empty &lt;code&gt;invoice-signed.pdf&lt;/code&gt; of 0 bytes. iText's installation guide confirms that one of the two adapters is required and that both together are not supported. With &lt;code&gt;bouncy-castle-adapter&lt;/code&gt; 9.8.0 added, the run wrote a 48,052-byte file carrying one &lt;code&gt;ETSI.CAdES.detached&lt;/code&gt; signature. Every iText 8.x or 9.x project that &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/digital-signature-pdf-java-tutorial/" rel="noopener noreferrer"&gt;signs PDFs in Java&lt;/a&gt; needs &lt;code&gt;sign&lt;/code&gt; plus an adapter, and the block below adds the standard one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;com.itextpdf&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;sign&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;9.8.0&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;com.itextpdf&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;bouncy-castle-adapter&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;9.8.0&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advisories on iText and the Bouncy Castle It Pins
&lt;/h2&gt;

&lt;p&gt;NVD has eight entries that name iText, the newest published on 26 November 2023, and all of them concern older releases. OSV returns none for &lt;code&gt;html2pdf&lt;/code&gt; 6.3.4, &lt;code&gt;kernel&lt;/code&gt; 9.8.0 or &lt;code&gt;sign&lt;/code&gt; 9.8.0, though its iText records sit on &lt;code&gt;itext7-core&lt;/code&gt;, &lt;code&gt;itextpdf&lt;/code&gt;, &lt;code&gt;itext-rups&lt;/code&gt; and the older &lt;code&gt;com.lowagie:itext&lt;/code&gt;, so a query on &lt;code&gt;kernel&lt;/code&gt; returns none for 7.1.17 either.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2021-43113, CVSS 3.1 score 9.8 (NIST):&lt;/strong&gt; Command injection through a &lt;code&gt;CompareTool&lt;/code&gt; file name passed to Ghostscript, fixed in 7.1.17 and 5.5.13.3 according to GitHub's advisory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2017-9096, CVSS 3.0 score 8.8 (NIST):&lt;/strong&gt; XML external entities in iText's XML parsers, fixed in 5.5.12 and 7.0.3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2017-20151, CVSS 3.1 score 9.8 (NIST):&lt;/strong&gt; An XML external entity in iText RUPS, the PDF inspection tool, which VulDB scores at 5.5.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2022-24196 and CVE-2022-24197, CVSS 3.1 score 6.5 each (NIST):&lt;/strong&gt; Denial of service from crafted PDFs in 7.1.17, addressed in 7.1.18 and 7.2.2 according to iText's CVE page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2023-6299, CVSS 3.1 score 6.5 (NIST):&lt;/strong&gt; NVD describes a memory leak in 8.0.1 fixed in 8.0.2, and VulDB scores it at 4.3, but iText's CVE page says that report is wrong and that 7.2.4 and 7.1.16 were the versions affected.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2022-24198 and CVE-2023-6298, CVSS 3.1 score 6.5 each (NIST):&lt;/strong&gt; Filed against 7.1.17 and 8.0.2, and NVD marks both as disputed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Bouncy Castle jars carry more, reaching 7.x builds from 7.1.10 on through &lt;code&gt;kernel&lt;/code&gt; and 8.x and 9.x builds through the signing adapter. Each iText release pins a Bouncy Castle version, 1.75 for 7.2.6, 1.78 for 8.0.5, 1.83 for 9.6.0 and 1.84 for 9.7.0 and 9.7.1. CVE-2026-5588, a weak-algorithm issue in &lt;code&gt;bcpkix&lt;/code&gt; that the 9.7.0 notes cite for the move to 1.84, covers most Bouncy Castle releases between 1.67 and 1.84, and NVD has not scored it yet. CVE.org holds 28 records on the &lt;code&gt;bcprov&lt;/code&gt; and &lt;code&gt;bcpkix&lt;/code&gt; 1.84 pair that 9.7.x pins. OSV shows two of them, CVE-2026-8763 (a name-constraints bypass, 9.1 from NIST) and CVE-2026-13506 (lazy ASN.1 parsing that resets a depth guard, 7.5 from NIST), which reach every Bouncy Castle release before 1.85. The 9.8.0 release moves to Bouncy Castle 1.86, which neither OSV nor CVE.org lists a record against, so upgrading is iText's remedy. That tree still carries &lt;code&gt;jackson-databind&lt;/code&gt; 2.22.3 through &lt;code&gt;commons&lt;/code&gt;, inside CVE-2026-110879 (9.8 from HeroDevs, cleared by 2.22.4), a record the OSV package query misses.&lt;/p&gt;

&lt;h2&gt;
  
  
  End of Life for iText 7.1, 7.2 and 8.0
&lt;/h2&gt;

&lt;p&gt;Published on 8 July 2026, the iText Core 9.7.0 notes record 7.1 reaching end of life in April 2025, with 7.2 following that October and 8.0 in October 2026. Once a line reaches that point it moves into maintenance and gets security patches and nothing else. Maven Central's last 7.x build is 7.2.6, released 9 January 2024, and its last 8.x build is 8.0.5, released 18 July 2024, while iText 5's 5.5.13.6 arrived on 22 July 2026 as a security release that took the 9.7.0 fix for single-layered decompression bombs. Features such as WebP images and footnotes, added in 9.7.0 alongside a default 100 times growth limit on streams, only ship in 9.x. iText releases Core and pdfHTML under the AGPLv3 and also offers a commercial license. Codebases still on 7.x or 8.x have a migration to plan, and the table below sets the four lines side by side.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;iText release lines with the newest build of each on Maven Central, its status in iText's notes and the Bouncy Castle version its POM pins.&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Line&lt;/th&gt;
&lt;th&gt;Newest on Maven Central&lt;/th&gt;
&lt;th&gt;Status in iText's notes&lt;/th&gt;
&lt;th&gt;Bouncy Castle pinned&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;5.x&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;itextpdf&lt;/code&gt; 5.5.13.6, 22 Jul 2026&lt;/td&gt;
&lt;td&gt;Maintenance, security releases only&lt;/td&gt;
&lt;td&gt;1.84, optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7.x&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;kernel&lt;/code&gt; 7.2.6, 9 Jan 2024&lt;/td&gt;
&lt;td&gt;End of life, 7.2 since October 2025&lt;/td&gt;
&lt;td&gt;1.75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8.x&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;kernel&lt;/code&gt; 8.0.5, 18 Jul 2024&lt;/td&gt;
&lt;td&gt;End of life from October 2026&lt;/td&gt;
&lt;td&gt;1.78&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9.x&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;kernel&lt;/code&gt; 9.8.0, 30 Sep 2026&lt;/td&gt;
&lt;td&gt;Current line&lt;/td&gt;
&lt;td&gt;1.86&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For invoice templates that rely on scripts or on CSS that Chrome draws, IronPDF for Java is a commercial option that renders HTML on a Chromium engine. We ran an invoice with a script-computed total on 2026.11.3 and it printed &lt;code&gt;Total due 662.24&lt;/code&gt;, and a separate statement drew a canvas bar and printed its script's balance. The decorated invoice above came out with its 32-point red first letter, a wavy underline and a vertical &lt;code&gt;PAID&lt;/code&gt;, and a related page kept its text and box shadows and turned its blue card grey. A &lt;a href="https://ironpdf.com/java/object-reference/api/com/ironsoftware/ironpdf/render/WaitFor.html" rel="noopener noreferrer"&gt;&lt;code&gt;WaitFor&lt;/code&gt;&lt;/a&gt; render delay on &lt;code&gt;ChromePdfRenderOptions&lt;/code&gt; sets how long a page's scripts get before the capture.&lt;/p&gt;

&lt;p&gt;It comes from Maven Central as &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt;, with engine binaries that the docs say download on the first run or arrive through a platform artifact, and Central lists eleven releases published in 2026, up to 2026.11.3 on 3 November. Signing with a &lt;code&gt;.pfx&lt;/code&gt; or &lt;code&gt;.p12&lt;/code&gt; certificate goes through &lt;code&gt;getSignature().SignPdfWithSignature&lt;/code&gt; on the same &lt;code&gt;PdfDocument&lt;/code&gt;, and IronPDF's &lt;a href="https://ironpdf.com/java/examples/pdf-signatures/" rel="noopener noreferrer"&gt;signing example&lt;/a&gt; lists no separate signing module. Our run with the same self-signed key returned true from &lt;code&gt;VerifyPdfSignatures&lt;/code&gt; with none added, on a detached PKCS#7 signature (&lt;code&gt;adbe.pkcs7.detached&lt;/code&gt;). A &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; runs for 30 days.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the pdfHTML Runs Showed
&lt;/h2&gt;

&lt;p&gt;pdfHTML 6.3.4 skips page scripts and a long list of CSS effects, signing needs &lt;code&gt;sign&lt;/code&gt; plus a Bouncy Castle adapter, the Bouncy Castle records on iText's pinned versions clear only at 9.8.0, and Jackson 2.22.3 in that tree still wants 2.22.4. For HTML that depends on a browser, IronPDF for Java renders it in Chromium instead, with &lt;a href="https://ironpdf.com/java/examples/pdf-generation-settings/" rel="noopener noreferrer"&gt;script and CSS media settings&lt;/a&gt; on &lt;code&gt;ChromePdfRenderOptions&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;iText and pdfHTML are trademarks of their respective owners, we have no affiliation with iText or Apryse, and the details above come from NVD, CVE.org, the GitHub Advisory Database through OSV, iText's knowledge base and release notes, and the Maven Central record.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. Code run and claims checked by the Iron Software DevRel team against iText Core 9.8.0, pdfHTML 6.3.4 and &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3 on 4 November 2026.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>security</category>
      <category>itext</category>
    </item>
    <item>
      <title>OpenPDF in Java: Encryption Setup, CSS Support, Footers</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Wed, 04 Nov 2026 00:53:33 +0000</pubDate>
      <link>https://dev.to/ironsoftware/openpdf-in-java-encryption-setup-css-support-footers-3hhf</link>
      <guid>https://dev.to/ironsoftware/openpdf-in-java-encryption-setup-css-support-footers-3hhf</guid>
      <description>&lt;p&gt;Give OpenPDF's HTML module a two-column grid ledger whose total an inline script writes, and the PDF comes back with &lt;code&gt;Hosting120.00Support80.00&lt;/code&gt; on one line, a bold &lt;code&gt;Total&lt;/code&gt;, and no figure after it. That run used 3.0.5, released on 22 May 2026 by the LibrePDF project, whose library began as a fork of iText 4.2.0. The ledger leads this post and five more problems follow, each one run against those jars or traced to the source that documents it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Happens to Flexbox, Grid and Script in openpdf-html?
&lt;/h2&gt;

&lt;p&gt;They are ignored. The core library's &lt;code&gt;HTMLWorker&lt;/code&gt; parser has been deprecated since 2.1.0, and the &lt;code&gt;openpdf-html&lt;/code&gt; module built for HTML is a Flying Saucer fork from June 2025 whose README says Flying Saucer set out to render XHTML with CSS 2.1 in plain Java, simpler than a browser engine. That README still marks HTML5 as in progress and lists JavaScript as a roadmap item. In the 3.0.5 jar, the &lt;code&gt;CSSName&lt;/code&gt; property table holds 127 names, &lt;code&gt;display&lt;/code&gt;, &lt;code&gt;float&lt;/code&gt; and &lt;code&gt;border-collapse&lt;/code&gt; among them, with none for flexbox, grid or &lt;code&gt;gap&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.pdf.ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FlexGridScript&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// A flex row, a two-column grid and a script that writes the total, as a browser template would have them.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;".row { display: flex; gap: 16px; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;".card { flex: 1; border: 1px solid #999; padding: 8px; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;".ledger { display: grid; grid-template-columns: 3fr 1fr; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div class='row'&amp;gt;&amp;lt;div class='card'&amp;gt;North&amp;lt;/div&amp;gt;&amp;lt;div class='card'&amp;gt;South&amp;lt;/div&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div class='card' id='east'&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div class='ledger'&amp;gt;&amp;lt;span&amp;gt;Hosting&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;120.00&amp;lt;/span&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;span&amp;gt;Support&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;80.00&amp;lt;/span&amp;gt;&amp;lt;b&amp;gt;Total&amp;lt;/b&amp;gt;&amp;lt;b id='sum'&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;script&amp;gt;document.getElementById('east').textContent = 'East';"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"document.getElementById('sum').textContent = (120 + 80).toFixed(2);&amp;lt;/script&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"flex-grid-script.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;ITextRenderer&lt;/span&gt; &lt;span class="n"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setDocumentFromString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createPDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Opened in a viewer, the 1,233-byte page shows two boxes stacked down the left edge, North over South, with their text starting at x = 48.8 and their borders spanning the full text width, so the flex row never formed. Below them sits an empty bordered strip where East belonged, since no script ran, and the ledger reads as the single line quoted at the top. Browser-built templates and script-drawn charts end up the same way. The module's layout model stays CSS 2.1, so columns come from tables or floats and every total is computed in Java first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Encryption Throw NoClassDefFoundError?
&lt;/h2&gt;

&lt;p&gt;Because Bouncy Castle is optional in the POM and required at run time. The 3.0.5 core pulls in exactly one runtime library, Brotli4j at version 1.23.0, and leaves &lt;code&gt;bcprov-jdk18on&lt;/code&gt; to the application as optional. The class below reads an existing two-page statement, sets AES-128 encryption on a &lt;code&gt;PdfStamper&lt;/code&gt; and stamps every page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.Element&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.Font&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.FontFactory&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.Phrase&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.Rectangle&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.pdf.ColumnText&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.pdf.PdfContentByte&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.pdf.PdfGState&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.pdf.PdfReader&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.pdf.PdfStamper&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.pdf.PdfWriter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.awt.Color&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;StampAndEncrypt&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;PdfReader&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfReader&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"statement-table.pdf"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;PdfStamper&lt;/span&gt; &lt;span class="n"&gt;stamper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfStamper&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"statement-copy.pdf"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

        &lt;span class="c1"&gt;// The user password opens the file, and the owner password lifts the permission flags.&lt;/span&gt;
        &lt;span class="n"&gt;stamper&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setEncryption&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"view-2026"&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getBytes&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="s"&gt;"owner-2026"&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getBytes&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt;
                &lt;span class="nc"&gt;PdfWriter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ALLOW_PRINTING&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;PdfWriter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ENCRYPTION_AES_128&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="nc"&gt;Font&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FontFactory&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getFont&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FontFactory&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;HELVETICA_BOLD&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Font&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;NORMAL&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Color&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="nc"&gt;PdfGState&lt;/span&gt; &lt;span class="n"&gt;translucent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfGState&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;translucent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setFillOpacity&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.25f&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// getOverContent draws above the existing page, so the stamp lands on top of the table.&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getNumberOfPages&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;Rectangle&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getPageSize&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="nc"&gt;PdfContentByte&lt;/span&gt; &lt;span class="n"&gt;over&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stamper&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getOverContent&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;over&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;saveState&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;over&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setGState&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;translucent&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="nc"&gt;ColumnText&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;showTextAligned&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;over&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Element&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ALIGN_CENTER&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Phrase&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"COPY"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
                    &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getWidth&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getHeight&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;over&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;restoreState&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;stamper&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the declared dependencies alone, &lt;code&gt;setEncryption&lt;/code&gt; threw &lt;code&gt;NoClassDefFoundError&lt;/code&gt; for a Bouncy Castle ASN.1 class, &lt;code&gt;ASN1OctetString&lt;/code&gt; on some runs and &lt;code&gt;ASN1Encodable&lt;/code&gt; on others, from inside the &lt;code&gt;PdfEncryption&lt;/code&gt; constructor, and a 0-byte &lt;code&gt;statement-copy.pdf&lt;/code&gt; was left on disk. With &lt;code&gt;bcprov-jdk18on&lt;/code&gt; 1.84 added, the same class produced a copy of about 4.5 KB, encrypted at revision 4 with the &lt;code&gt;AESV2&lt;/code&gt; filter, opening with &lt;code&gt;view-2026&lt;/code&gt;, with a translucent &lt;code&gt;COPY&lt;/code&gt; across both pages. Because the error only appears when the code path runs, a test suite that never encrypts will not catch it. The fix is &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/what-is-maven-in-java/" rel="noopener noreferrer"&gt;an explicit Maven dependency&lt;/a&gt; on Bouncy Castle, and the next section explains why 1.84 is not the version to pick.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which Advisories Touch an OpenPDF Build?
&lt;/h2&gt;

&lt;p&gt;A query to OSV on 3 November 2026 found no record for either OpenPDF artifact at version 3.0.5, the core or the HTML module. The records that do come up sit one step away.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-8763 scores 9.1 Critical under CVSS 3.1 (NIST):&lt;/strong&gt; A Name Constraints bypass in Bouncy Castle 1.84, the version the OpenPDF 3.0.5 build declares.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-13506 scores 7.5 High under CVSS 3.1 (NIST):&lt;/strong&gt; Forcing a lazy ASN.1 sequence resets the nesting-depth guard, again in 1.84. Both records are fixed in &lt;code&gt;bcprov-jdk18on&lt;/code&gt; 1.85, released on 12 July 2026, and the &lt;code&gt;master&lt;/code&gt; branch of OpenPDF still pins 1.84 on 3 November 2026. Bouncy Castle's October records, such as CVE-2026-18036, also list 1.85 and are fixed in 1.86.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2017-9096 scores 8.8 High under CVSS 3.0 (NIST):&lt;/strong&gt; XML external entities in iText before 5.5.12, and GHSA-86p9-x5pw-94qx widens it to the &lt;code&gt;com.lowagie:itext&lt;/code&gt; artifact up to 4.2.2, whose 4.2.0 tag is where OpenPDF started. The &lt;code&gt;com.github.librepdf&lt;/code&gt; coordinates are not listed, and the 3.0.5 &lt;code&gt;XmlParser&lt;/code&gt; disables external entities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rest of the exposure comes from intended behavior. OpenPDF's security policy calls the library neither sandboxed nor hardened, and the project leaves every check on HTML, fonts, image locations and paths to whoever calls it, naming local file access, server-side request forgery and path traversal among the cases it does not block. In a test run, an &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; whose &lt;code&gt;src&lt;/code&gt; was a &lt;code&gt;file:&lt;/code&gt; URI pulled a PNG off the local disk into the PDF. Because the project asks that no CVEs be filed for such behavior, an advisory scan will not list it, and the remedy it gives is jsoup sanitizing, whitelisted &lt;code&gt;src&lt;/code&gt; and &lt;code&gt;href&lt;/code&gt; values and generation inside a container or sandbox. Licensing is &lt;code&gt;MPL-2.0 OR LGPL-2.1+&lt;/code&gt; for the core and the LGPL 2.1 or later for &lt;code&gt;openpdf-html&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who Is Affected by the Java 21 Floor?
&lt;/h2&gt;

&lt;p&gt;Any team whose services run on Java 17 or below. The README sets Java 21 as the minimum for the 2.1.x line and later, and javac from JDK 17 stops on the first OpenPDF import of a 3.0.5 example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;error: cannot access Document
  bad class file: openpdf-3.0.5.jar(/org/openpdf/text/Document.class)
    class file has wrong version 65.0, should be 61.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Java 17 option is the 2.0.x branch, last released as 2.0.5 on 26 May 2025, which is older than &lt;code&gt;openpdf-html&lt;/code&gt; itself (first shipped as 2.1.0 in June 2025) and than the move to the &lt;code&gt;org.openpdf&lt;/code&gt; packages in 3.0.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Much Layout Code Does a Simple Invoice Need?
&lt;/h2&gt;

&lt;p&gt;Every placed element is a coordinate in points from the bottom-left corner of the page. A one-page US Letter invoice with a logo, a right-aligned title and a rule under the letterhead takes the class below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.Document&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.Element&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.Font&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.Image&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.PageSize&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.Paragraph&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.pdf.BaseFont&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.pdf.PdfContentByte&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openpdf.text.pdf.PdfWriter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;InvoiceLayout&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// US Letter is 612 x 792 points, and the 120-point top margin leaves room for the letterhead.&lt;/span&gt;
        &lt;span class="nc"&gt;Document&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PageSize&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;LETTER&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;PdfWriter&lt;/span&gt; &lt;span class="n"&gt;writer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PdfWriter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getInstance&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"invoice-layout.pdf"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;open&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="nc"&gt;BaseFont&lt;/span&gt; &lt;span class="n"&gt;sans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BaseFont&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createFont&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"fonts/LiberationSans-Regular.ttf"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BaseFont&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;IDENTITY_H&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BaseFont&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;EMBEDDED&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;BaseFont&lt;/span&gt; &lt;span class="n"&gt;sansBold&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BaseFont&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createFont&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"fonts/LiberationSans-Bold.ttf"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BaseFont&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;IDENTITY_H&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BaseFont&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;EMBEDDED&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Absolute positions count from the bottom-left corner, so y = 792 is the top edge.&lt;/span&gt;
        &lt;span class="nc"&gt;Image&lt;/span&gt; &lt;span class="n"&gt;logo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getInstance&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"img/logo.png"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;logo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;scaleToFit&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;logo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setAbsolutePosition&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;792&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;36&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;logo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getScaledHeight&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logo&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="nc"&gt;PdfContentByte&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;writer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getDirectContent&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;beginText&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setFontAndSize&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sansBold&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;showTextAligned&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Element&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ALIGN_RIGHT&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Invoice 4471"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;576&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;730&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;endText&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setLineWidth&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.75f&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;moveTo&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;684&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;lineTo&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;576&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;684&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stroke&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// Flowing elements start at the top margin and wrap between the side margins.&lt;/span&gt;
        &lt;span class="nc"&gt;Font&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Font&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sans&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Paragraph&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Bill to: Ève Lefèvre, Rue du Rhône 12, Genève"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Paragraph&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Consulting, October 2026: CHF 3,200.00"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The run produced a 25,786-byte Letter page with the logo scaled to 150 by 60 points at y = 696, &lt;code&gt;Invoice 4471&lt;/code&gt; ending at x = 576 and the rule at y = 684. Each of those numbers was chosen by hand, so a switch to A4, a taller logo or a new margin means recalculating them. Developers coming from HTML and CSS templates feel this most.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does a Page X of Y Footer Take an Event Class?
&lt;/h2&gt;

&lt;p&gt;OpenPDF's &lt;code&gt;HeaderFooter&lt;/code&gt; class can print the current page number but not the total, so a footer reading &lt;code&gt;Page 2 of 3&lt;/code&gt; takes a &lt;code&gt;PdfPageEventHelper&lt;/code&gt;, a &lt;code&gt;PdfTemplate&lt;/code&gt; placed empty on each page and a write in &lt;code&gt;onCloseDocument&lt;/code&gt;, once the total is known. In the test run, &lt;code&gt;getPageNumber()&lt;/code&gt; returned 4 inside &lt;code&gt;onCloseDocument&lt;/code&gt; for a three-page file, so the count written into the template has to subtract one. The three pages then shared a single 30 by 12 point form object for the total, and each read &lt;code&gt;Page 1 of 3&lt;/code&gt; through &lt;code&gt;Page 3 of 3&lt;/code&gt;. Any report with running footers needs this class or the library's other route, stamping the numbers afterwards through &lt;code&gt;PdfStamper&lt;/code&gt; when the total is already fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving the Ledger to IronPDF for Java
&lt;/h2&gt;

&lt;p&gt;For teams that would rather keep that ledger in HTML, IronPDF for Java is a commercial option that renders with Chromium, through an engine it downloads on first run or takes from a platform &lt;code&gt;ironpdf-engine&lt;/code&gt; artifact. Our 2026.11.3 run of the first section's page laid the three cards out side by side, kept the ledger in two columns and printed the script's &lt;code&gt;200.00&lt;/code&gt;. It is added from Maven Central as one dependency, &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt;, that runs on Java 8 and later, and the 2026 line there has reached 2026.11.3, published on 3 November.&lt;/p&gt;

&lt;p&gt;With IronPDF for Java, page numbers become a &lt;a href="https://ironpdf.com/java/examples/headers-and-footers/" rel="noopener noreferrer"&gt;&lt;code&gt;TextHeaderFooter&lt;/code&gt;&lt;/a&gt; passed to &lt;code&gt;addTextFooter&lt;/code&gt; with &lt;code&gt;Page {page} of {total-pages}&lt;/code&gt;, and a &lt;a href="https://ironpdf.com/java/examples/security-and-metadata/" rel="noopener noreferrer"&gt;&lt;code&gt;SecurityOptions&lt;/code&gt;&lt;/a&gt; object sets the user and owner passwords before &lt;code&gt;saveAs&lt;/code&gt; writes the file. Markup from users still needs sanitizing before any renderer sees it.&lt;/p&gt;

&lt;p&gt;To run your own templates through IronPDF for Java, there is a &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five Checks Before Shipping OpenPDF
&lt;/h2&gt;

&lt;p&gt;OpenPDF 3.0.5 needs Java 21, an explicit and current Bouncy Castle, sanitized input, CSS 2.1 templates and hand-placed layout, and IronPDF for Java answers the &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/how-to-create-table-in-pdf-java/" rel="noopener noreferrer"&gt;HTML rendering&lt;/a&gt;, layout and Java-version items with a Chromium renderer on Java 8 and later.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;OpenPDF, Flying Saucer, iText and Bouncy Castle are trademarks of their respective owners, we have no affiliation with any of them, and the facts above are drawn from their public repositories, Maven Central records and advisory databases.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. OpenPDF code run and claims checked by the Iron Software DevRel team against &lt;code&gt;com.github.librepdf:openpdf&lt;/code&gt; 3.0.5 and &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3 on 3 November 2026.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>security</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Using Flying Saucer 10.7.0: Grid, @font-face and Java 21</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Wed, 04 Nov 2026 00:49:21 +0000</pubDate>
      <link>https://dev.to/ironsoftware/using-flying-saucer-1070-grid-font-face-and-java-21-3j05</link>
      <guid>https://dev.to/ironsoftware/using-flying-saucer-1070-grid-font-face-and-java-21-3j05</guid>
      <description>&lt;p&gt;A dashboard template with a two-column CSS grid and a net total that a script writes after load prints as one column with no total when Flying Saucer renders it. The renderer ships for Java as &lt;code&gt;org.xhtmlrenderer:flying-saucer-pdf&lt;/code&gt;, and 10.7.0, released 24 October 2026, is its current version. We ran into that grid while testing the library for this post, so it comes first, and later sections draw on more 10.7.0 runs, the R8 user's guide, the code and what NVD, GHSA and OSV record.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Does Flying Saucer Do With CSS Grid and a Script-Written Total?
&lt;/h2&gt;

&lt;p&gt;It lays the grid items out as ordinary blocks and drops the script. The engine targets CSS 2.1, extended with its own &lt;code&gt;-fs-&lt;/code&gt; print properties and some later CSS. A set in the code, &lt;code&gt;CSSName.UNSUPPORTED_CSS3_PROPERTIES&lt;/code&gt;, names 52 CSS3 properties that layout passes over, grid and flexbox among them, and the R8 user's guide says script tags are ignored.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.xhtmlrenderer.pdf.ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GridScriptCards&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// A two-column grid with a total that a script writes after load, as many dashboards do.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;xhtml&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;".grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;".tile { padding: 10px; border: 1px solid #999; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div class='grid'&amp;gt;&amp;lt;div class='tile'&amp;gt;Orders 412&amp;lt;/div&amp;gt;&amp;lt;div class='tile'&amp;gt;Returns 9&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;p id='total'&amp;gt;&amp;lt;/p&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;script&amp;gt;document.getElementById('total').textContent = 'Net orders 403';&amp;lt;/script&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="nc"&gt;ITextRenderer&lt;/span&gt; &lt;span class="n"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setDocumentFromString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xhtml&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"grid-script-cards.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createPDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;grid-script-cards.pdf&lt;/code&gt; is a single US Letter page with &lt;code&gt;Orders 412&lt;/code&gt; above &lt;code&gt;Returns 9&lt;/code&gt; at the same left margin, and the text layer has no &lt;code&gt;Net orders 403&lt;/code&gt;. During the run the &lt;code&gt;Html5Support&lt;/code&gt; logger printed one warning naming &lt;code&gt;display: grid&lt;/code&gt;, &lt;code&gt;grid-template-columns&lt;/code&gt; and &lt;code&gt;gap&lt;/code&gt; as unsupported, then the PDF was written as normal. That warning, first logged in 10.2.0, is the only sign of the problem. Any template a front-end team designs in a browser is affected, and the routes around it are a float and table layout or the project's separate Chrome module, covered below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does @font-face Embed the Font in the PDF?
&lt;/h2&gt;

&lt;p&gt;Not with the CSS a browser accepts. A plain &lt;code&gt;@font-face&lt;/code&gt; rule resolves the font for layout, but the PDF only names it, so the reader's viewer has to supply the face.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.xhtmlrenderer.pdf.ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.nio.file.Path&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FontFaceCss&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// The same @font-face rule a browser would use, with the TTF resolved against the base URL.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;xhtml&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"@font-face { font-family: 'Brand'; src: url('georgia.ttf'); }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"h1 { font-family: 'Brand'; }"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;Quarterly summary&amp;lt;/h1&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="nc"&gt;ITextRenderer&lt;/span&gt; &lt;span class="n"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setDocumentFromString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xhtml&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"fonts"&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;toUri&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"font-face.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createPDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The heading in &lt;code&gt;font-face.pdf&lt;/code&gt; references a TrueType font called &lt;code&gt;Georgia&lt;/code&gt; with no font file in its descriptor, so on a machine without Georgia the viewer substitutes another face. Adding the vendor property &lt;code&gt;-fs-pdf-font-embed: embed&lt;/code&gt; to the rule, which the user's guide documents, produced an embedded Georgia subset in a second run. Brand fonts depend on embedding. So does the &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/pdf-to-pdfa-java/" rel="noopener noreferrer"&gt;PDF/A archive format&lt;/a&gt;, an ISO preservation standard whose rule 6.2.11.4.1 requires all fonts embedded, and it has a second font catch. With a font registered as &lt;code&gt;BaseFont.IDENTITY_H&lt;/code&gt; and PDF/A-3b requested, veraPDF 1.30.3 failed the output on the CIDSet rule 6.2.11.4.2, while &lt;code&gt;BaseFont.CP1252&lt;/code&gt; passed for Western European text.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can CMS HTML Go Straight Into setDocumentFromString?
&lt;/h2&gt;

&lt;p&gt;No. The parser is XML, and the user's guide says most HTML found in the wild can't be rendered and should go through TagSoup, JTidy or a similar cleaner first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.xhtmlrenderer.pdf.ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.OutputStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RawCmsFragment&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Valid HTML5 as a browser reads it, with an unclosed &amp;lt;p&amp;gt; and &amp;lt;li&amp;gt; and a bare &amp;lt;br&amp;gt;.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;h1&amp;gt;Release notes&amp;lt;/h1&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;p&amp;gt;Version 3.2 ships today.&amp;lt;br&amp;gt;Highlights:"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Faster search&amp;lt;li&amp;gt;New export menu&amp;lt;/ul&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="nc"&gt;ITextRenderer&lt;/span&gt; &lt;span class="n"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ITextRenderer&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="c1"&gt;// The XML parser rejects the string here, before layout starts.&lt;/span&gt;
        &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setDocumentFromString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutputStream&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FileOutputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"release-notes.pdf"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createPDF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The run stopped in &lt;code&gt;setDocumentFromString&lt;/code&gt; with &lt;code&gt;XRRuntimeException&lt;/code&gt; wrapping a SAX error at line 1, column 24, saying the markup following the root element must be well-formed, and no file was written. Parsing with jsoup and passing its &lt;code&gt;W3CDom&lt;/code&gt; result to &lt;code&gt;setDocument&lt;/code&gt; rendered this fragment in a test run, and it adds a dependency and a step to every render.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which Advisories Show Up in a Dependency Scan?
&lt;/h2&gt;

&lt;p&gt;Mostly history rather than the current release, with one recent batch in a dependency.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Builds through 9.3.2:&lt;/strong&gt; A default &lt;code&gt;flying-saucer-pdf&lt;/code&gt; build resolves &lt;code&gt;com.lowagie:itext&lt;/code&gt; 2.1.7, and GitHub's GHSA-86p9-x5pw-94qx flags that artifact for CVE-2017-9096 at every version up to 4.2.2, with no fixed version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2017-9096 scores 8.8 High under CVSS 3.0 (NIST):&lt;/strong&gt; An XXE weakness in iText's XML parsing, which NIST also scores 6.8 on CVSS 2 and NVD doesn't tag as disputed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenPDF from 9.4.0:&lt;/strong&gt; It took over the PDF layer at that release, which came out at the end of December 2023.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XXE changes with no CVE:&lt;/strong&gt; Two hardening changes, one to &lt;code&gt;XMLResource&lt;/code&gt; in 9.12.1 (June 2025) and one to &lt;code&gt;DocumentBuilderFactory&lt;/code&gt; in 10.4.0 (July 2026), shipped with no CVE identifier, which leaves scanners blind to builds that lack them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advisories on the current tree:&lt;/strong&gt; Neither OSV nor GHSA lists any advisory for a Flying Saucer artifact, and OSV, queried for the libraries 10.7.0 pulls in on 3 November 2026, had nothing for them either. The exception is Apache's Batik page, which names seven medium-rated CVEs in 1.19, the version 10.7.0 pulls in, and everything older, all patched by the 1.20 release of 20 October 2026.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Teams still on 9.3.2 or earlier carry the iText finding. Moving to 10.4.0 or later picks up the iText and XXE changes, while the Batik fixes need a release that moves off 1.19, and none had reached Maven Central on 3 November 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Changes With the Chrome Module and the Java 21 Floor?
&lt;/h2&gt;

&lt;p&gt;The Chrome module trades the CSS gap for a browser to manage, and the 10.x line needs a recent JVM.&lt;/p&gt;

&lt;p&gt;The module, &lt;code&gt;flying-saucer-chrome-pdf&lt;/code&gt;, first shipped with 10.3.0 in June 2026 and hands each page to &lt;code&gt;chrome-headless-shell&lt;/code&gt;. Unless told otherwise it asks Google's chrome-for-testing feed for the current Stable build and refreshes that answer daily, so the browser doing the printing changes underneath the application, and on 5 November 2026 that answer was build 157.0.8103.38. Calling &lt;code&gt;setChromeVersion&lt;/code&gt; pins it. Two more details in the 10.7.0 source matter in production. The print call fires on &lt;code&gt;Page.loadEventFired&lt;/code&gt; with no dedicated delay setting in &lt;code&gt;ChromiumPdfOptions&lt;/code&gt; (a desktop Chrome run needed &lt;code&gt;addExtraArg("--virtual-time-budget=5000")&lt;/code&gt; in one-shot mode to print a late script's text), and on Linux arm64 the platform check throws even though the chrome-for-testing JSON offers &lt;code&gt;linux-arm64&lt;/code&gt; downloads for Stable. The exception suggests &lt;code&gt;setBinaryPath&lt;/code&gt;, yet the check runs before that path is read, and a test with &lt;code&gt;os.name&lt;/code&gt; Linux and &lt;code&gt;os.arch&lt;/code&gt; aarch64 still threw with a path supplied.&lt;/p&gt;

&lt;p&gt;Java is the other constraint. Since 10.0.0 in September 2025, every 10.x jar targets Java 21 (class file 65), and compiling against 10.7.0 with the JDK 17 javac failed with a wrong-version error in the test run. Java 17 projects are held to 9.x, where 9.13.4 is the newest build. Separately, the parent POM leaves &lt;code&gt;slf4j-api&lt;/code&gt; to the application as a provided dependency, and without it constructing the first renderer threw &lt;code&gt;NoClassDefFoundError&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Does IronPDF for Java Fit These Checks?
&lt;/h2&gt;

&lt;p&gt;If the trade-offs above don't fit a project, IronPDF for Java is a commercial library that prints HTML through Chromium. On 2026.11.3, our run of the grid above put &lt;code&gt;Orders 412&lt;/code&gt; and &lt;code&gt;Returns 9&lt;/code&gt; in two columns and printed &lt;code&gt;Net orders 403&lt;/code&gt; from the script. Scripts run by default, since &lt;a href="https://ironpdf.com/java/object-reference/api/com/ironsoftware/ironpdf/render/ChromePdfRenderOptions.html" rel="noopener noreferrer"&gt;&lt;code&gt;ChromePdfRenderOptions&lt;/code&gt;&lt;/a&gt; starts with &lt;code&gt;setEnableJavaScript&lt;/code&gt; on, a &lt;code&gt;WaitFor&lt;/code&gt; can pause the capture for a fixed delay, network idle or a named element, raw CMS HTML needs no jsoup pass, and PDF/A-3b output is one &lt;code&gt;saveAsPdfA&lt;/code&gt; call.&lt;/p&gt;

&lt;p&gt;The library itself is &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; on Maven Central, built as Java 8 bytecode, with eleven 2026 builds by 3 November 2026, numbered by month, the newest published that day. The &lt;a href="https://ironpdf.com/java/get-started/use-ironpdfengine/" rel="noopener noreferrer"&gt;engine&lt;/a&gt; it bundles or downloads is set by each IronPDF release rather than by a Stable feed, which keeps servers on one build matched, though a newer Chromium has to wait for an IronPDF version bump. A &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; is available for testing it against your own templates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summing Up the Flying Saucer Checklist
&lt;/h2&gt;

&lt;p&gt;Grid and script missing from the PDF, unembedded &lt;code&gt;@font-face&lt;/code&gt; fonts, an XML-only parser, a Chrome module that follows the Stable channel and a Java 21 floor are the checks this post ran on Flying Saucer 10.7.0, and the iText 2.1.7 dependency behind CVE-2017-9096 belongs to pre-9.4.0 builds. For pages built for a browser, IronPDF for Java renders them in Chromium from a single dependency, and our &lt;a href="https://ironpdf.com/java/examples/file-to-pdf/" rel="noopener noreferrer"&gt;HTML file example&lt;/a&gt; shows the call.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Flying Saucer, OpenPDF, iText, Apache Batik, Georgia, Chrome and veraPDF are trademarks of their respective owners, we have no affiliation with any of them, and the details above come from each project's source, documentation, release notes and the NVD, GHSA and OSV databases.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. Flying Saucer code run and claims checked by the Iron Software DevRel team on 3 November 2026, with IronPDF APIs checked against &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>security</category>
      <category>css</category>
    </item>
    <item>
      <title>JasperReports 7.1.1 PDFs: Fonts, Extra JARs and PDF/UA Tags</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Wed, 04 Nov 2026 00:49:03 +0000</pubDate>
      <link>https://dev.to/ironsoftware/jasperreports-711-pdfs-fonts-extra-jars-and-pdfua-tags-25p2</link>
      <guid>https://dev.to/ironsoftware/jasperreports-711-pdfs-fonts-extra-jars-and-pdfua-tags-25p2</guid>
      <description>&lt;p&gt;An HTML timesheet sent through a JasperReports text field came out as nine plain lines of 10-point Helvetica down the left margin. That run used JasperReports Library 7.1.1 (Maven Central, 1 November 2026, GNU LGPL v3), the Java engine that compiles JRXML band designs, fills them and writes PDF among other outputs. What follows is a checklist of what tripped up a Java 17 build on its way to a PDF, with every item reproduced in a run or traced to the changelog and the advisory databases.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What an HTML Timesheet Looks Like in a JasperReports Text Field
&lt;/h2&gt;

&lt;p&gt;HTML enters only as the content of a text element flagged &lt;code&gt;markup="html"&lt;/code&gt;, where a Swing &lt;code&gt;JEditorPane&lt;/code&gt; parses it, per the markup sample in the vendor's docs. The test template is one such field, fed a timesheet the way a web app would serve it, &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; block and all.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.JREmptyDataSource&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.JRException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.JasperCompileManager&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.JasperExportManager&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.JasperFillManager&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.JasperPrint&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.HashMap&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Map&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TimesheetMarkupReport&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;JRException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// A stylesheet rule, a CSS grid and a table, as a web app would serve the timesheet.&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;style&amp;gt;.over { color: #c00; font-weight: bold }&amp;lt;/style&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;h2&amp;gt;Timesheet, week 42&amp;lt;/h2&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;div style='display:grid;grid-template-columns:1fr 1fr'&amp;gt;&amp;lt;div&amp;gt;A. Novak&amp;lt;/div&amp;gt;&amp;lt;div&amp;gt;R. Osei&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;table border='1'&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Engineer&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Hours&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;A. Novak&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;38.5&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;"&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;R. Osei&amp;lt;/td&amp;gt;&amp;lt;td class='over'&amp;gt;44.0&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;parameters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HashMap&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
        &lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;put&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Html"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// html-markup.jrxml holds one text field with markup="html" that prints the Html parameter.&lt;/span&gt;
        &lt;span class="nc"&gt;JasperPrint&lt;/span&gt; &lt;span class="n"&gt;print&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;JasperFillManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fillReport&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                &lt;span class="nc"&gt;JasperCompileManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;compileReport&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"html-markup.jrxml"&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JREmptyDataSource&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="nc"&gt;JasperExportManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;exportReportToPdfFile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"timesheet-markup.pdf"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read with pypdf, the content stream of the 1,147-byte &lt;code&gt;timesheet-markup.pdf&lt;/code&gt; holds nine text runs at x = 40, each about 12.58 points below the last and all in 10-point Helvetica, so the &lt;code&gt;h2&lt;/code&gt; is the size of a table cell. A. Novak and R. Osei, meant to sit side by side in the grid, follow each other down the page. Engineer, Hours and the four cell values do the same with no border drawn around them, and 44.0 prints in black because the &lt;code&gt;.over&lt;/code&gt; class never took effect. There is not a single rectangle or line operator on the page.&lt;/p&gt;

&lt;p&gt;Script never runs here, and the 7.0.2 release deleted the old Chrome add-on for JavaScript visualizations. For HTML-first teams, the vendor's route is a rebuild of each layout in Jaspersoft Studio.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fonts That Stop a Report at Fill Time
&lt;/h2&gt;

&lt;p&gt;Point a style at a family the JVM has never seen, such as &lt;code&gt;fontName="Report Serif"&lt;/code&gt;, and &lt;code&gt;JasperFillManager&lt;/code&gt; throws &lt;code&gt;JRFontNotFoundException&lt;/code&gt; before any page exists. The trace passes through &lt;code&gt;TextMeasurer&lt;/code&gt;, since line breaking needs real glyph widths. According to the exception's Javadoc, refusing to guess is deliberate, because a stand-in font shifts the metrics and may clip text.&lt;/p&gt;

&lt;p&gt;Leaving the font unset has a cost too. An invoice template that marks its title &lt;code&gt;bold="true"&lt;/code&gt; and names no font exported a file with one font, Helvetica, and drew that title in the regular weight. The recommended route for bold faces and custom families is a font extension, registered in a properties file at the classpath root, though a &lt;code&gt;pdfFontName&lt;/code&gt; attribute on each element also printed bold in a test run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="py"&gt;net.sf.jasperreports.extension.registry.factory.simple.font.families&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory&lt;/span&gt;
&lt;span class="py"&gt;net.sf.jasperreports.extension.simple.font.families.reportserif&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;fonts/reportserif/fonts.xml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add a &lt;code&gt;fonts.xml&lt;/code&gt; mapping the family to DejaVu Serif regular and bold, and the export embeds both as subsets. A house typeface means maintaining that bundle alongside the templates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Encryption, PDF Export and the Extra JARs They Need
&lt;/h2&gt;

&lt;p&gt;Since 7.0.0 the PDF writer lives in &lt;code&gt;jasperreports-pdf&lt;/code&gt;, and leaving it out produced a &lt;code&gt;JRRuntimeException&lt;/code&gt; naming that artifact. The writer runs on &lt;code&gt;1.3.43.jaspersoft.2&lt;/code&gt;, a Jaspersoft fork of OpenPDF hosted in a Jaspersoft repository and absent from Central, so a Central-only mirror cannot resolve it as declared. Since 7.0.8 the writer also accepts stock OpenPDF 1.3.43 from Central in its place, and a swapped-in run exported both timesheet reports with one warning that link annotation tagging for PDF/UA was off. Its OpenPDF 3 sibling from 7.1.0, &lt;code&gt;jasperreports-openpdf&lt;/code&gt;, pulls in a Jaspersoft build of OpenPDF 3.0.5 compiled for Java 21, and that build raised &lt;code&gt;UnsupportedClassVersionError&lt;/code&gt; on Java 17.&lt;/p&gt;

&lt;p&gt;Encryption brings in one more JAR, as this export of a compiled &lt;code&gt;timesheet.jasper&lt;/code&gt; with two passwords shows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.JRException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.JasperFillManager&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.JasperPrint&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.engine.data.JRMapCollectionDataSource&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.export.SimpleExporterInput&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.export.SimpleOutputStreamExporterOutput&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.pdf.JRPdfExporter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.sf.jasperreports.pdf.SimplePdfExporterConfiguration&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.HashMap&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Map&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EncryptedTimesheet&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;JRException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;parameters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HashMap&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
        &lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;put&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Week"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"week 43"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Map rows need no bean class, and each key matches a field in the template.&lt;/span&gt;
        &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="o"&gt;?&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"project"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Billing API"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"engineer"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"A. Novak"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"hours"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;30.0&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
                &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"project"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Data platform"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"engineer"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"R. Osei"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"hours"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;38.5&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

        &lt;span class="nc"&gt;JasperPrint&lt;/span&gt; &lt;span class="n"&gt;print&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;JasperFillManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fillReport&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                &lt;span class="s"&gt;"timesheet.jasper"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JRMapCollectionDataSource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

        &lt;span class="nc"&gt;JRPdfExporter&lt;/span&gt; &lt;span class="n"&gt;exporter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JRPdfExporter&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;exporter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setExporterInput&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SimpleExporterInput&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;exporter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setExporterOutput&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SimpleOutputStreamExporterOutput&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"timesheet-week-43.pdf"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

        &lt;span class="c1"&gt;// A user password to open the file, an owner password to change it, and printing as the one permission.&lt;/span&gt;
        &lt;span class="nc"&gt;SimplePdfExporterConfiguration&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SimplePdfExporterConfiguration&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setEncrypted&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;set128BitKey&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setUserPassword&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"week43"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setOwnerPassword&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"payroll-admin"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setAllowedPermissionsHint&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"PRINTING"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;exporter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setConfiguration&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;exporter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;exportReport&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run with only the JasperReports JARs, &lt;code&gt;exportReport&lt;/code&gt; threw &lt;code&gt;NoClassDefFoundError&lt;/code&gt; naming an &lt;code&gt;org.bouncycastle.asn1&lt;/code&gt; class (&lt;code&gt;ASN1OctetString&lt;/code&gt; or &lt;code&gt;ASN1Encodable&lt;/code&gt;, varying between runs) and left a 0-byte &lt;code&gt;timesheet-week-43.pdf&lt;/code&gt; behind. Bouncy Castle does not arrive with the PDF extension, and the vendor's PdfEncrypt sample adds &lt;code&gt;bcprov-jdk18on&lt;/code&gt; itself. With version 1.86 added at runtime, the result needed &lt;code&gt;week43&lt;/code&gt; to open, used 128-bit RC4 (V 2, R 3), and allowed printing and nothing else. That matches the usual &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/password-protect-pdf-java/" rel="noopener noreferrer"&gt;password-protection&lt;/a&gt; split of an open password and a change password.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advisories That Still Apply to 6.x and Early 7.x
&lt;/h2&gt;

&lt;p&gt;The table lists the records in NVD, CVE.org, OSV and the GitHub Advisory Database on 3 November 2026 for the library and for the Jackson version its last 6.x release declares.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Advisory&lt;/th&gt;
&lt;th&gt;Score and scorer&lt;/th&gt;
&lt;th&gt;Affected&lt;/th&gt;
&lt;th&gt;Fixed in&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CVE-2025-10492, deserialization&lt;/td&gt;
&lt;td&gt;9.8 NIST (CVSS 3.1), 8.7 Jaspersoft (CVSS 4.0)&lt;/td&gt;
&lt;td&gt;Library 7.0.3 and earlier&lt;/td&gt;
&lt;td&gt;7.0.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CVE-2026-6009, deserialization&lt;/td&gt;
&lt;td&gt;8.7 Jaspersoft (CVSS 4.0), NVD analysis pending&lt;/td&gt;
&lt;td&gt;Library 7.0.6 and earlier&lt;/td&gt;
&lt;td&gt;7.0.7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 &lt;code&gt;jackson-core&lt;/code&gt; advisories&lt;/td&gt;
&lt;td&gt;3 high and 1 moderate (GitHub)&lt;/td&gt;
&lt;td&gt;Jackson 2.17.1, declared by 6.21.5&lt;/td&gt;
&lt;td&gt;Jackson 2.22.3, and 7.1.1 uses 2.22.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12 &lt;code&gt;jackson-databind&lt;/code&gt; advisories&lt;/td&gt;
&lt;td&gt;5 high and 7 moderate (GitHub)&lt;/td&gt;
&lt;td&gt;Jackson 2.17.1, declared by 6.21.5&lt;/td&gt;
&lt;td&gt;Jackson 2.22.3, and 7.1.1 uses 2.22.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CVE-2026-110879, &lt;code&gt;jackson-databind&lt;/code&gt; type validator bypass&lt;/td&gt;
&lt;td&gt;9.8 HeroDevs (CVSS 3.1), NVD analysis pending&lt;/td&gt;
&lt;td&gt;Jackson 2.10.0 to before 2.18.12, which covers 2.17.1&lt;/td&gt;
&lt;td&gt;2.18.12, 2.21.8 and 2.22.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CVE-2026-68498, &lt;code&gt;jackson-core&lt;/code&gt; memory exhaustion&lt;/td&gt;
&lt;td&gt;7.5 HeroDevs (CVSS 3.1), NVD analysis deferred&lt;/td&gt;
&lt;td&gt;Jackson 2.16.0 to before 2.18.10, which covers 2.17.1&lt;/td&gt;
&lt;td&gt;2.18.10, 2.21.6 and 2.22.2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both library records describe Java deserialization with a path to remote code execution, and neither is marked disputed. Of the Jackson entries, CVE-2026-91776 is one of the high ones, about &lt;code&gt;jackson-databind&lt;/code&gt; keeping every unknown raw type ID. OSV holds CVE-2026-110879 and CVE-2026-68498 with no affected package attached, so a query for Jackson 2.17.1 does not return them, and their ranges come from CVE.org. The last 6.x release, 6.21.5, dates from 4 July 2025, before either library fix, and no later 6.x release is on Maven Central. A 7.1.1 build with the PDF extension and Bouncy Castle came back with zero OSV matches across its 34 JARs, and the move there runs through the template change below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Version 7 Template Conversion and the PDF/UA Tagging Change
&lt;/h2&gt;

&lt;p&gt;Version 7 swapped the Commons Digester parsers for Jackson XML, and its changelog says the 7.x library on its own cannot open &lt;code&gt;.jrxml&lt;/code&gt; or &lt;code&gt;.jrtx&lt;/code&gt; files saved by 6.x or earlier. Jaspersoft Studio 7 or newer converts them. Every &lt;code&gt;.jasper&lt;/code&gt; file needs a fresh compile, imports change where packages moved into separate JARs, and the 3D pie, bar and stacked bar charts come out flat because the 7.1.1 chart theme hands each 3D type to its flat chart method. Since 7.0.6, &lt;code&gt;jasperreports-maven-plugin&lt;/code&gt; can run the update and compile steps inside a build.&lt;/p&gt;

&lt;p&gt;Accessibility work meets an edition line in the same changelog. Release 7.0.8 put PDF tagging behind a &lt;code&gt;PdfTagger&lt;/code&gt; interface and moved its newest, fullest implementation into the JasperReports Library Professional extensions, and tagging is what PDF/UA and &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/pdf-to-pdfa-java/" rel="noopener noreferrer"&gt;PDF/A files&lt;/a&gt; rely on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where an HTML Renderer Fits
&lt;/h2&gt;

&lt;p&gt;Markup that loses its layout, fonts to package, extra JARs, a Jaspersoft repository, 6.x advisories and an edition line for tagging add up to a long list, and IronPDF for Java shortens it whenever the source is an HTML page.&lt;/p&gt;

&lt;p&gt;Our timesheet string went to &lt;code&gt;PdfDocument.renderHtmlAsPdf&lt;/code&gt; untouched on 2026.11.3, and the grid split the two names into columns while the &lt;code&gt;.over&lt;/code&gt; rule printed &lt;code&gt;44.0&lt;/code&gt; in bold red. The &lt;a href="https://ironpdf.com/java/examples/using-html-to-create-a-pdf/" rel="noopener noreferrer"&gt;&lt;code&gt;renderHtmlAsPdf&lt;/code&gt; example&lt;/a&gt; shows the call. For the &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/password-protect-pdf-java/" rel="noopener noreferrer"&gt;password step&lt;/a&gt;, &lt;code&gt;getSecurity().setPassword&lt;/code&gt; and &lt;code&gt;setOwnerPassword&lt;/code&gt; do the work, and the &lt;code&gt;ironpdf&lt;/code&gt; POM declares no Bouncy Castle dependency to add. Tagged output comes from &lt;code&gt;convertToPdfUA&lt;/code&gt; and &lt;code&gt;convertToPdfA&lt;/code&gt; in that one &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; dependency, which has eleven 2026 builds on Maven Central, 2026.1.3 through 2026.11.3.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Means for HTML Reports on JasperReports
&lt;/h2&gt;

&lt;p&gt;For reports that start as HTML pages, IronPDF is where we would begin, since the timesheet above needed no JRXML rewrite. A &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; key is enough to run your own page through it.&lt;/p&gt;

&lt;p&gt;Did the version 7 template conversion or the font setup take your team longer?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JasperReports and Jaspersoft are trademarks of their owner, we have no affiliation with Actian or the Jaspersoft business, and the details above draw on the project's changelog, POMs and samples, NVD, CVE.org, OSV, Maven Central and our own runs.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. JasperReports code run and claims checked by the Iron Software DevRel team against &lt;code&gt;net.sf.jasperreports:jasperreports&lt;/code&gt; 7.1.1 on 3 November 2026, with the IronPDF details checked against the &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.11.3 API.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>reporting</category>
      <category>security</category>
    </item>
    <item>
      <title>PDFBox 3 in Java: Line Breaks, Page Breaks and Unicode</title>
      <dc:creator>IronSoftware</dc:creator>
      <pubDate>Tue, 03 Nov 2026 01:00:16 +0000</pubDate>
      <link>https://dev.to/ironsoftware/pdfbox-3-in-java-line-breaks-page-breaks-and-unicode-5d9h</link>
      <guid>https://dev.to/ironsoftware/pdfbox-3-in-java-line-breaks-page-breaks-and-unicode-5d9h</guid>
      <description>&lt;p&gt;A 60-row statement drawn with Apache PDFBox needs Java code to decide where page 1 ends, and a cover letter needs Java code to decide where each line breaks. Apache PDFBox is the Apache Software Foundation's PDF library for Java, and its 3.0.8 release has been on Maven Central since 11 July 2026. We wrote this for teams producing documents with it, and it covers the issues that show up once the first real templates go through it, each one with run output or the project's own documentation behind it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We work at Iron Software, and the end of this article covers our library, IronPDF.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Who Decides Where a Line Breaks?
&lt;/h2&gt;

&lt;p&gt;The calling code does. PDFBox accepts neither HTML nor CSS. The project FAQ calls it low-level, offering text and image drawing but no API above that for laying out pages or flowing paragraphs. A paragraph is therefore a list of lines the program builds itself by measuring words with &lt;code&gt;getStringWidth&lt;/code&gt;, which returns widths in 1/1000 units of text space.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.PDDocument&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.PDPage&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.PDPageContentStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.common.PDRectangle&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.font.PDType0Font&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.File&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.IOException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.ArrayList&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DrawWrappedLetter&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Thank you for your order. The parcel left our warehouse in Gdańsk this morning "&lt;/span&gt;
                &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"and should reach you within three working days. Reply to this letter if any item is missing."&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PDDocument&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PDDocument&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;PDPage&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PDPage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PDRectangle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;LETTER&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addPage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="nc"&gt;PDType0Font&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PDType0Font&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"fonts/NotoSans-Regular.ttf"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
            &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;fontSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;margin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;72&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;maxWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getMediaBox&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;getWidth&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

            &lt;span class="c1"&gt;// Each showText call draws one line, so the program measures words and decides the breaks itself.&lt;/span&gt;
            &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;
            &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;split&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;" "&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;candidate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;isEmpty&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getStringWidth&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;candidate&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;fontSize&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;maxWidth&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                    &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;candidate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
            &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

            &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PDPageContentStream&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PDPageContentStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;beginText&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
                &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setFont&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fontSize&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setLeading&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fontSize&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1.4f&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

                &lt;span class="c1"&gt;// PDF coordinates start at the bottom left, so the first baseline sits one margin below the top edge.&lt;/span&gt;
                &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;newLineAtOffset&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getMediaBox&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;getHeight&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;showText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;newLine&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
                &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;endText&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
            &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"letter.pdf"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Lines: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It printed &lt;code&gt;Lines: 3&lt;/code&gt; and saved a 7,336-byte &lt;code&gt;letter.pdf&lt;/code&gt; on a 612 by 792 point US Letter page, the paragraph broken into three lines inside one-inch margins. A dozen lines of Java do the job a browser does for a &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; element, and they handle only plain words, with no hyphenation, justification, bold runs or links. For richer layouts the FAQ sends readers elsewhere, to Apache FOP when the source is XML, or to add-on layout projects like Boxable and easytable that sit on top of PDFBox.&lt;/p&gt;

&lt;h2&gt;
  
  
  Page Breaks Are Tracked by Hand
&lt;/h2&gt;

&lt;p&gt;The same applies one level up. &lt;code&gt;newLine&lt;/code&gt; moves the baseline down by the leading and nothing more, so a table longer than the page keeps drawing below the bottom edge unless the program opens a new page itself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.PDDocument&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.PDPage&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.PDPageContentStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.common.PDRectangle&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.font.PDType1Font&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.pdmodel.font.Standard14Fonts&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.IOException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ManualPagination&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;margin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;leading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="nc"&gt;PDType1Font&lt;/span&gt; &lt;span class="n"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PDType1Font&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Standard14Fonts&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;FontName&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;HELVETICA&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PDDocument&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PDDocument&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;PDPageContentStream&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="c1"&gt;// The program tracks the baseline itself and opens a new page once it has dropped below the bottom margin.&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                        &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;endText&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
                        &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
                    &lt;span class="o"&gt;}&lt;/span&gt;
                    &lt;span class="nc"&gt;PDPage&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PDPage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PDRectangle&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;A4&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                    &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addPage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PDPageContentStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;beginText&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
                    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setFont&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setLeading&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;leading&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                    &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getMediaBox&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;getHeight&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
                    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;newLineAtOffset&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;newLine&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
                    &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;leading&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
                &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;showText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Line "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"    "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%.2f"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1.25&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;

            &lt;span class="c1"&gt;// Each page's content stream has to be closed before the document is saved.&lt;/span&gt;
            &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;endText&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"paginated-statement.pdf"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Pages: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getNumberOfPages&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The run printed &lt;code&gt;Pages: 2&lt;/code&gt;, with rows 1 to 48 on the first A4 page and rows 49 to 60 on the second, all inside the page bounds. Repeating a header row, keeping a row's cells together or adding a page number would each be more code of the same kind. Without the &lt;code&gt;y &amp;lt; margin&lt;/code&gt; check, rows keep going below the bottom edge of the first page, still present in the content stream and invisible in a viewer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Names Like Łódź and Gdańsk Need PDType0Font
&lt;/h2&gt;

&lt;p&gt;The letter above loads Noto Sans through &lt;code&gt;PDType0Font.load&lt;/code&gt; for a reason. With the Standard 14 Helvetica, which needs no font file and is created in 3.x through &lt;code&gt;new PDType1Font(Standard14Fonts.FontName.HELVETICA)&lt;/code&gt;, &lt;code&gt;showText&lt;/code&gt; on the word Gdańsk threw an &lt;code&gt;IllegalArgumentException&lt;/code&gt; reporting that U+0144 ('nacute') is not available in Helvetica's WinAnsiEncoding, and Łódź failed the same way on U+0141. The FAQ's fix for that message is the Type 0 font, which &lt;code&gt;PDType0Font.load(PDDocument, File)&lt;/code&gt; embeds as a subset of the TrueType file. Any service printing customer names or addresses with letters like these has to load a font that covers them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Moving From 2.x to 3.x Changes
&lt;/h2&gt;

&lt;p&gt;The 3.0 migration guide lists the API changes that stop 2.x code compiling. &lt;code&gt;PDDocument&lt;/code&gt; lost its load methods to the new &lt;code&gt;Loader&lt;/code&gt; class, the Standard 14 fonts lost their static fields, and a &lt;code&gt;StreamCacheCreateFunction&lt;/code&gt; took the place of the &lt;code&gt;MemoryUsageSetting&lt;/code&gt; parameter. Merging shows the new signature.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.io.IOUtils&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.apache.pdfbox.multipdf.PDFMergerUtility&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.File&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.IOException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MergeInvoicePack&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;PDFMergerUtility&lt;/span&gt; &lt;span class="n"&gt;merger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PDFMergerUtility&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;merger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addSource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"invoice.pdf"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;merger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addSource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"statement.pdf"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="n"&gt;merger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setDestinationFileName&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"invoice-pack.pdf"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// The stream cache argument arrived in 3.x, and a memory-only cache suits small inputs.&lt;/span&gt;
        &lt;span class="n"&gt;merger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;mergeDocuments&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;IOUtils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createMemoryOnlyStreamCache&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a one-page invoice and a three-page statement as sources, it wrote a four-page, 10,381-byte &lt;code&gt;invoice-pack.pdf&lt;/code&gt;. &lt;code&gt;IOUtils&lt;/code&gt; lives in the separate &lt;code&gt;pdfbox-io&lt;/code&gt; module that 3.0 introduced, which Maven pulls in with &lt;code&gt;pdfbox&lt;/code&gt; alongside &lt;code&gt;fontbox&lt;/code&gt; and &lt;code&gt;commons-logging&lt;/code&gt; 1.4.0. A 2.x codebase has to rewrite every &lt;code&gt;PDDocument.load&lt;/code&gt; call, font field and memory setting before it compiles against 3.0.8, or stay on the 2.0 line, which published 2.0.37 to Maven Central on 15 July 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Advisories by Version
&lt;/h2&gt;

&lt;p&gt;Ten CVE records appear on the PDFBox security page, and a fixed release exists for each. Scores are the ones NVD displays, from NIST for the older records and from CISA's ADP program for the 2026 pair.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-33929, CVSS 4.3 from CISA ADP:&lt;/strong&gt; A path traversal in the &lt;code&gt;ExtractEmbeddedFiles&lt;/code&gt; example and an incomplete fix for CVE-2026-23907, affects 2.0.24 to 2.0.36 and 3.0.0 to 3.0.7 and is fixed in 2.0.37 and 3.0.8.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-23907, CVSS 5.3 from CISA ADP:&lt;/strong&gt; The original path traversal in that example, affects 2.0.24 to 2.0.35 and 3.0.0 to 3.0.6 and is fixed in 2.0.36 and 3.0.7.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2019-0228, CVSS 9.8 from NIST:&lt;/strong&gt; XML external entity processing through a crafted XFDF file in 2.0.14, fixed in 2.0.15.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2016-2175, CVSS 7.8 from NIST:&lt;/strong&gt; XML external entity processing through a crafted PDF in 1.8.0 to 1.8.11 and 2.0.0, fixed in 1.8.12 and 2.0.1.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2018-8036 and CVE-2018-11797, CVSS 6.5 and 5.5 from NIST:&lt;/strong&gt; A parser loop and a long page-tree computation on crafted files, fixed in 2.0.11 and 2.0.12.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2021-27807, CVE-2021-27906, CVE-2021-31811 and CVE-2021-31812, CVSS 5.5 each from NIST:&lt;/strong&gt; Infinite loops and out-of-memory errors on crafted files, fixed in 2.0.23 for the first two and 2.0.24 for the last two.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project footnotes the 2026 pair as affecting only the examples module, but the NVD record for the later one lists the main &lt;code&gt;apache:pdfbox&lt;/code&gt; CPE as vulnerable below 2.0.37 and 3.0.8, which is why NVD-based scanners raise it on the core artifact. Upgrading &lt;code&gt;pdfbox&lt;/code&gt; to 3.0.8 or 2.0.37 clears all ten, and code copied from &lt;code&gt;ExtractEmbeddedFiles&lt;/code&gt; needs the change from pull request 427. Maven Central has no fixed build of &lt;code&gt;pdfbox-examples&lt;/code&gt;, though, since that artifact ends at 3.0.7 and 2.0.36. One more point from the same page affects upload services. Under the project's policy, crafted files that throw unchecked exceptions, loop without end or use memory out of proportion fall outside its security scope, and applications reading untrusted PDFs in volume are expected to set their own timeouts and memory caps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rendering the Statement From HTML Instead
&lt;/h2&gt;

&lt;p&gt;Teams whose letters and statements already live as HTML can hand them to IronPDF for Java, Iron Software's commercial PDF library, which takes the layout and font work above off the Java side. It renders HTML with a full Chromium engine, so line breaks, &lt;a href="https://ironpdf.com/java/blog/using-ironpdf-for-java/how-to-create-table-in-pdf-java/" rel="noopener noreferrer"&gt;table widths&lt;/a&gt; and page breaks follow the markup and its CSS, a TrueType file named in an &lt;code&gt;@font-face&lt;/code&gt; rule of an HTML file embedded in our 2026.10.1 run with Łódź and Gdańsk intact, and page JavaScript runs when &lt;code&gt;setEnableJavaScript&lt;/code&gt; is on, with &lt;code&gt;setWaitFor&lt;/code&gt; delaying the render for a set time or a network-idle signal. The calls are &lt;code&gt;PdfDocument.renderHtmlFileAsPdf&lt;/code&gt; for an HTML file or &lt;code&gt;renderHtmlAsPdf&lt;/code&gt; for a string, then &lt;code&gt;PdfDocument.merge&lt;/code&gt;, &lt;code&gt;extractAllText&lt;/code&gt; or &lt;code&gt;getSecurity()&lt;/code&gt; on the result before &lt;code&gt;saveAs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The Maven coordinate is &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt;, and Maven Central lists eleven 2026 releases of it up to 2026.11.3 from 3 November 2026. A &lt;a href="https://ironpdf.com/java/licensing/#trial-license" rel="noopener noreferrer"&gt;free trial&lt;/a&gt; key covers a test against your own templates, and the &lt;a href="https://ironpdf.com/java/examples/pdf-generation-settings/" rel="noopener noreferrer"&gt;generation settings example&lt;/a&gt; walks through the render options.&lt;/p&gt;

&lt;h2&gt;
  
  
  The PDFBox Checklist in Short
&lt;/h2&gt;

&lt;p&gt;PDFBox 3.0.8 leaves line wrapping, page breaks and Unicode font loading to the calling code, takes no HTML or CSS, asks 2.x code to be rewritten for its 3.x API and carries ten CVE records that 3.0.8 and 2.0.37 fix. For teams with HTML templates, we point to IronPDF for Java as the solution, with guides to &lt;a href="https://ironpdf.com/java/how-to/java-merge-pdf-tutorial/" rel="noopener noreferrer"&gt;merging PDFs&lt;/a&gt; and &lt;a href="https://ironpdf.com/java/how-to/java-fill-pdf-form-tutorial/" rel="noopener noreferrer"&gt;filling PDF forms&lt;/a&gt; on the same document object.&lt;/p&gt;

&lt;p&gt;What reached your team first with PDFBox, the layout code, the fonts or the scanner report?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Apache PDFBox, PDFBox and Apache FOP are trademarks of The Apache Software Foundation, we have no affiliation with the foundation, and the details here rest on the project's own pages and on NVD and Maven Central records.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI. Code run and claims checked by the Iron Software DevRel team against Apache PDFBox 3.0.8, with IronPDF method names checked against &lt;code&gt;com.ironsoftware:ironpdf&lt;/code&gt; 2026.10.1, on 2 November 2026.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>security</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
