Forum


Replies: 1   Views: 103
Change filename of streamed pdf or get in memory pdf from transform

Posted by jwphp  · 11-10-2024 - 10:59

When transforming a DOCX to PDF with the native TransformDocAdvPDF I would like to avoid saving to the file system before returning the file to the user from the web app.

One way to do this is to do the transform with 'stream' set to true, but this always sets the filename the user sees in their browser via Content-Disposition to "document.pdf". Is there any way to change this?

Alternatively, is there any way to get an in memory PDF from the transform, which I can then add the relevant Content-Disposition to and return to the client myself?

I am using phpdocx 15.5 Premium.