When I run this suitelet it downloads the pdf inst...
# suitescript
n
When I run this suitelet it downloads the pdf instead of showing it on the screen. How can I get it to just display on the screen and not automatically download?
b
I use this solution to display on the screen, not sure if you need the middle line
response.addHeader({ name: 'Content-Type:', value: 'application/pdf', });
response.addHeader({ name: 'Content-Disposition', value: 'inline; filename="report.pdf"', });
renderer.renderPdfToResponse(response);
n
@Beau in regard to my code how would that fit in
never mind, that worked!!
thanks!
b
awesome glad it worked
I think this works too, i think the key is the addHeaders, so I think the middle line is critical after all
response.addHeader({ name: 'Content-Type:', value: 'application/pdf', });
response.addHeader({ name: 'Content-Disposition', value: 'inline; filename="report.pdf"', });
response.writeFile(pdfFile);
b
most direct is to use isInline