I’m trying to use a service that allows a series of datafields to be sent and merges them into a pdf.
The result is returned in a json object with the actual file in base64. This seems to be a normal way of moving this kind of data.
I need to convert the response field into binary (which is no problem) and then output the whole json file as a pdf - This is where I am having issues. I just keep getting a blank pdf file which implies I am missing the data. I have the json file in a struct with the response field in binary. How do I get it to produce the pdf correctly?
First, stop saying you want to generate a PDF. You don’t want to do that. You want to take binary content from a service and display it to the browser. It just so happens the data represents a PDF, but you’re not using lucee to make one.
decode has your binary data in it, so that’s what you want to spray out to the browser. (I’m not sure why you’d want to reserialize after that)