Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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? –  mast0r 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

1 Answer 1

up vote 9 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.