afterRender of accessible PDFs removes all accessibility tags



  • Hello,

    We're running into an issue when we are merging 2 generated PDFs. We have accessibility active on both the template and PDF that is being appended (trough base64).

    Both PDFs pass accessibility requirements (using Adobe Acrobat Pro), but when they're merged it fails completely

    Code used for merging:

    async function afterRender(req, res) {
        if(req.data.ShowAnnex){
            const base64String = req.data.AnnexPDF;
            try {
                // Decode Base64 string to a buffer
                const pdfBuffer = Buffer.from(base64String, 'base64');
    
                // Append the Base64-decoded PDF to the existing report
                const concatenated = await jsreport.pdfUtils.append(res.content, pdfBuffer);
    
                res.content = concatenated;
            } catch (e) {
                console.error('Failed to append Base64 PDF.');
                console.error(e);
            }
        }
    }
    

    pdfUtils for both PDF templates:
    0_1759755777600_upload-03693e90-f9b8-4544-a5ad-1c169762a50a
    0_1759755793245_upload-e43a0020-5a1f-4f69-aaed-c1d97f939070

    amongst other things the document title is also removed during the merger:
    0_1759755971728_upload-633ae72b-2137-47b6-a452-b1b28c5fbf0f



  • Would you be able to email me the mentioned pdfs?



  • I've sent it to the email linked to your account on the Forum


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.