Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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">



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

share|improve this question
What browser is it? – Sergey Utko Sep 4 '14 at 10:27
I use firefox 24.2.0 – dnbrobin Sep 4 '14 at 10:37
Are you on the beta programme for PDF2? – Francis Sep 4 '14 at 11:44
up vote 11 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.