<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Adding an attachment to a PDF while keeping pdf accessbility (pdfUA) doesnt seem to work?]]></title><description><![CDATA[<p>Hi!</p>
<p>I am trying to render a PDF which is PDF/A-3b compliant - I know that's not fully supported, but if I enable pdf accessbility pdfUA the PDF gets almost compliant. Without it, I get errors like missing color schemes for example. With pdfAccessbility/pdfUA enabled those are resolved. That's really nice.</p>
<p>But I also have a case where the same PDF gets a file attached. And then it seems pdfUA &amp; attachment are somewhat mutual exclusive. If I first set pdfUA and then add the attachment, pdfUA isn't applied. If I first add the attachment and then run pdfUA, the attachment is gone.</p>
<p>That's the code trying to apply both:</p>
<pre><code>async function afterRender(req, res) {
    if(res.meta.contentType === 'application/pdf') {

        // enable pdfUA
        res.content = await jsreport.pdfUtils.postprocess(res.content, {
            pdfMeta: {
                title: 'Report  ' + getCurrentDateFormatted()
            },
            pdfAccessibility: {
                pdfUA: true
            }
        });

        // add attachment(s)
        for (var attachmentName in req.data.pdfAttachments) {
            const base64DecodedAttachment = Buffer.from(req.data.pdfAttachments[attachmentName], 'base64');
            res.content = await jsreport.pdfUtils.addAttachment(res.content, base64DecodedAttachment, {
                name: attachmentName
            });
        }
    }
}
</code></pre>
<p>WIth the code above, the attachments survive. If i flip the two blocks, only pdfUA survives.</p>
<p>Also enabling pdfUA directly on the template in the UI and having the snippet only add the attachment doesn't solve the issue, the attachment survives, pdfUA is gone.</p>
]]></description><link>https://forum.jsreport.net/topic/3540/adding-an-attachment-to-a-pdf-while-keeping-pdf-accessbility-pdfua-doesnt-seem-to-work</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 06:05:03 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/3540.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 Aug 2026 06:20:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Adding an attachment to a PDF while keeping pdf accessbility (pdfUA) doesnt seem to work? on Invalid Date]]></title><description><![CDATA[<p>Hi!</p>
<p>I am trying to render a PDF which is PDF/A-3b compliant - I know that's not fully supported, but if I enable pdf accessbility pdfUA the PDF gets almost compliant. Without it, I get errors like missing color schemes for example. With pdfAccessbility/pdfUA enabled those are resolved. That's really nice.</p>
<p>But I also have a case where the same PDF gets a file attached. And then it seems pdfUA &amp; attachment are somewhat mutual exclusive. If I first set pdfUA and then add the attachment, pdfUA isn't applied. If I first add the attachment and then run pdfUA, the attachment is gone.</p>
<p>That's the code trying to apply both:</p>
<pre><code>async function afterRender(req, res) {
    if(res.meta.contentType === 'application/pdf') {

        // enable pdfUA
        res.content = await jsreport.pdfUtils.postprocess(res.content, {
            pdfMeta: {
                title: 'Report  ' + getCurrentDateFormatted()
            },
            pdfAccessibility: {
                pdfUA: true
            }
        });

        // add attachment(s)
        for (var attachmentName in req.data.pdfAttachments) {
            const base64DecodedAttachment = Buffer.from(req.data.pdfAttachments[attachmentName], 'base64');
            res.content = await jsreport.pdfUtils.addAttachment(res.content, base64DecodedAttachment, {
                name: attachmentName
            });
        }
    }
}
</code></pre>
<p>WIth the code above, the attachments survive. If i flip the two blocks, only pdfUA survives.</p>
<p>Also enabling pdfUA directly on the template in the UI and having the snippet only add the attachment doesn't solve the issue, the attachment survives, pdfUA is gone.</p>
]]></description><link>https://forum.jsreport.net/post/14958</link><guid isPermaLink="true">https://forum.jsreport.net/post/14958</guid><dc:creator><![CDATA[Hashmap]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>