# How to change the title of de PDFJS previewer

**URL:** <https://pdfjs.community/t/how-to-change-the-title-of-de-pdfjs-previewer/2355>\
**Category:** Technical Support\
**Created:** [February 9, 2023, 12:58pm UTC](https://pdfjs.community/t/how-to-change-the-title-of-de-pdfjs-previewer/2355 "2023-02-09T12:58:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jelle\_van\_lith](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@jelle\_van\_lith](https://pdfjs.community/u/jelle_van_lith)\
**Post date:** [February 9, 2023, 12:58pm UTC](https://pdfjs.community/t/how-to-change-the-title-of-de-pdfjs-previewer/2355/1 "2023-02-09T12:58:54Z")

</div>

Dear Sir/Madam,

I am trying to change the title of the PDFJS previewer to a user friendly name. At the moment the PDF is loaded by a stream. I do indicate the FileName via Content-Disposition, but for some reason the name of the controller method is constantly shown in the title.

How can I set the previewer title as a custom title?

```javascript
public ActionResult HandleVB_PdfViewerData()
        {
            Response.AddHeader("Content-Disposition", "inline; filename="+this);
            return FormManager.ProcessInstance.Blob != null ? File(FormManager.ProcessInstance.Blob, "application/pdf"): null;
        }

```

 ![wrong_name](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/b/b4b4849f8eef99517138bed9a731dc65c454b27a.png)

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [February 9, 2023, 10:03pm UTC](https://pdfjs.community/t/how-to-change-the-title-of-de-pdfjs-previewer/2355/2 "2023-02-09T22:03:50Z")

</div>

Hi there,

Thanks for contacting pdf.js express forums,

Does content-disposition: attachment with the file extension (.pdf) make a difference here?

How are you showing the previewer? Is this on pdf.js express pro?

Thanks in advance.

Best regards,  
Kevin Kim

---

<div class="post-metadata">

**Author:** ![jelle\_van\_lith](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@jelle\_van\_lith](https://pdfjs.community/u/jelle_van_lith)\
**Post date:** [February 10, 2023, 9:47am UTC](https://pdfjs.community/t/how-to-change-the-title-of-de-pdfjs-previewer/2355/3 "2023-02-10T09:47:03Z")

</div>

Dear Kevin Kim,

If I set the content disposition to attachment, I immediately get a download and the PDF is not shown in the previewer. Incidentally, the download name is correct, but it doesn’t show anything in the previewer.

```javascript
public ActionResult HandleVB_PdfViewerData()
        {
            var fileName = FormManager.ProcessInstance.Bestandsnaam;
            Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
            return FormManager.ProcessInstance.Blob != null ? File(FormManager.ProcessInstance.Blob, "application/pdf"): null;
        }

```

Or can I edit the viewer.js to set the title?

I am using pdf.js express.

Thank you in advance!

Kind regards,  
Jelle

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [February 10, 2023, 5:09pm UTC](https://pdfjs.community/t/how-to-change-the-title-of-de-pdfjs-previewer/2355/4 "2023-02-10T17:09:20Z")

</div>

Hi there,

Thank you for the response,

When you load the document into pdf.js express viewer, can you try setting the fileName attribute as shown here:

> **[Open PDF.js Express from Blob | Documentation](https://pdfjs.express/documentation/basic-operations/open-document/blob)**

Best regards,  
Kevin Kim
