PDF from HTML Transformation -error java.lang.IllegalArgumentException: null incompatible with Global antialiasing enable key

Certified Lead Developer

Context using XML data with html tags and XSLT:

Facing below error, however if i using generated html code from below xml and xslt into pdf from html ..its working

XML:

concat(
"<details>",
"<title>",
"PDF FROM HTML TRANSFPRMATION","</title>",
"<remarks>",
"<![CDATA[",
local!data.remarks,
"]]>",
"</remarks>",
"</details>")

XSLT file:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="">www.w3.org/.../Transform" version="1.0">
<xsl:output method="html" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<title>
<xsl:value-of select="details/title"/>
</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid black; padding: 8px; text-align: left; }
@page {
margin: 20mm;
@bottom-center {
content: "Page " counter(page) " of " counter(pages);
}
}
</style>
</head>
<body>
<h1>
<xsl:value-of select="details/title"/>
</h1>
<xsl:value-of select="details/remarks" disable-output-escaping="yes"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

  Discussion posts and replies are publicly visible

  • 0
    Certified Associate Developer

     

    Alright, so your PDF generator seems to have woken up on the wrong side of the codebase (Joy) and is throwing this super-friendly error: null incompatible with Global antialiasing enable key. Translation? “Something in your HTML/CSS/XML/XSLT combo is confusing me, and I’m not going to work until you fix it.”

    Let’s break this down:

    The <![CDATA[]]> Drama:

    If local!data.remarks contains special characters, invalid HTML, or even just some mood swings, the transformation could fail. Ensure the data doesn’t have anything fishy.
    Your Fancy CSS Might Be Too Fancy:

    That @page rule with @bottom-center? The PDF rendering engine might have taken one look at it and said, “Nope.” Start simple—ditch anything too complex for now.
    HTML Works Manually, But Not Dynamically:

    You’re saying the manually generated HTML works fine. That means the problem is likely in how the dynamic HTML (via XSLT) is being rendered. Something subtle is off.
    The PDF Engine and Its Antialiasing Quirk:

    The error is likely tied to unsupported rendering properties—fonts, styles, or CSS rules like @page. Think of it like asking someone who doesn’t like spicy food to eat a ghost pepper.
    What to Do Next (Rescue Mission Plan):
    Simplify and Debug:

    Strip your XSLT to basics—no CSS tricks, no fancy layouts. Keep it plain HTML and see if the error persists.
    Check Your XML Data:

    Make sure local!data.remarks isn’t sneaking in any nulls, weird characters, or broken HTML.
    Ditch the Fancy CSS:

    Remove the @page and @bottom-center styles for now. They might be too much for the PDF rendering engine to handle.
    Test Step-by-Step:

    Start with just the transformed HTML. If that works, add back CSS piece by piece until something breaks—then you’ve found the troublemaker.
    If none of this works, I’d suggest bribing the PDF generator with coffee Stuck out tongue winking eye. Or we can dig deeper together—your call! What do you think?