# How can I specify name for the pdf file that will be downloaded

**URL:** <https://pdfjs.community/t/how-can-i-specify-name-for-the-pdf-file-that-will-be-downloaded/681>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [April 5, 2021, 6:10am UTC](https://pdfjs.community/t/how-can-i-specify-name-for-the-pdf-file-that-will-be-downloaded/681 "2021-04-05T06:10:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ehtesham.ahmad.nadim](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/ehtesham.ahmad.nadim/32/425_2.png) [@ehtesham.ahmad.nadim](https://pdfjs.community/u/ehtesham.ahmad.nadim)\
**Post date:** [April 5, 2021, 6:10am UTC](https://pdfjs.community/t/how-can-i-specify-name-for-the-pdf-file-that-will-be-downloaded/681/1 "2021-04-05T06:10:36Z")

</div>

Hello there, I am using version 7.2.1

I am using `instance.downloadPdf();` to download pdf file. when I download a pdf file with this specified code the file is named as **document.pdf**. But I want to override the file name. How can I achieve that?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [April 5, 2021, 6:10am UTC](https://pdfjs.community/t/how-can-i-specify-name-for-the-pdf-file-that-will-be-downloaded/681/2 "2021-04-05T06:10:37Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

- [Annotations.FileAttachmentAnnotation - setFileData(data, mimeType, filename)](https://pdfjs.express/api/Annotations.FileAttachmentAnnotation.html#setFileData__anchor)
- [Actions~Named - onTriggered(owner, event, documentViewer)](https://pdfjs.express/api/Actions.Named.html#onTriggered__anchor)
- [Issue in new Pdfjs-express version 7.1.0](https://pdfjs.community/t/issue-in-new-pdfjs-express-version-7-1-0/292/6)
- [Customize print options](https://pdfjs.community/t/customize-print-options/490/1)
- [Override pdfjs?](https://pdfjs.community/t/override-pdfjs/652/3)

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [April 5, 2021, 2:26pm UTC](https://pdfjs.community/t/how-can-i-specify-name-for-the-pdf-file-that-will-be-downloaded/681/3 "2021-04-05T14:26:50Z")

</div>

Hi there!

As per the [documentation](https://pdfjs.express/api/WebViewerInstance.html#downloadPdf__anchor), you can pass a `filename` option like so:

```javascript
instance.downloadPdf({
   filename: 'myfilename.pdf'
})

```

Thanks!  
Logan
