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:
amongst other things the document title is also removed during the merger:
-
Would you be able to email me the mentioned pdfs?
-
I've sent it to the email linked to your account on the Forum