How can an arbitrary file (eg a XLSX) be attached/embedded to a PDF file using only client-side browser JavaScript?
If it matters, the XLSX is given by the user using a input file button and the PDF received from an external web service and encoded in base64.
I am not looking for a complete solution (it would be great if it exists), but how would you approach this problem in a higher level way
Files are attached using binary file streams, that looks like this in the PDF file:
32 0 obj
<</Type /EmbeddedFile /Subtype /{mimetype} /Length 72>>
stream
{file data}
endstream
endobj