java - how to specify the pdfbox.apache filename when downloading/exporting? -
just wondering there way name document after specify doc.name template
pddocument doc = pddocument.load(play.play.application().resource("/templates/" + filename)); bytearrayoutputstream bytearrayoutputstream = new bytearrayoutputstream(); doc.save(bytearrayoutputstream); doc.close();
therefore, when download pdfbox rendered file, name of pdf file can not specified. there other way it?
i not familiar play framework.
if want enable users download file , provide filename, need set http header
content-disposition: attachment; filename=myfile.pdf
when browser sees header, user dialog box save file , suggest name myfile.pdf.
Comments
Post a Comment