6

I am generating a pdf invoice with visualforce, but when it downloads there is no file extension. I have read other questions on SE and tried to simplify the content. Right now the code is simplified to

<apex:page standardController="Invoice__c" renderAs="pdf">

   hello

</apex:page>

and the file extension is still not added to the file.

3
  • What browser is it? Commented Sep 4, 2014 at 10:27
  • I use firefox 24.2.0
    – dnbrobin
    Commented Sep 4, 2014 at 10:37
  • Are you on the beta programme for PDF2?
    – Francis
    Commented Sep 4, 2014 at 11:44

1 Answer 1

11

You can set the name and extension of the PDF explicitly as follows, for example

Apexpages.currentPage().getHeaders().put('content-disposition', 'attachment; filename=AccountReport.pdf');

Unfortunately this is directly not supported in tag in Visualforce.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .