I have multiple pdfs stored in my database as blobs and I need to merge them to create a single pdf that needs to be streamed to the user.
I understand that it is fairly easy to do this if I am rendering a single pdf from blob, but I cannot figure how to merge multiple blobs.
<cfheader name="Content-Disposition" value="inline; filename=#document.name#.#document.ext#">
<cfcontent type="application/pdf" variable="#document.content#">
I see that CFPDF helps with this functionality, but cant seem to be able to get my blob into a cfpdf variable. A similar question has been asked here before, but it doesnt have the answer I seek.
Thanks!
Try converting the blob data to a file (in-memory using
ram://
if possible to save writing to disk) and then use that as thecfpdf
merge source. You can do it for each blob as you loop over your query within thecfpdf action="merge"
tag:Note you can use a single temp file - no need to create a different one for each blob in the query.