# Customize print options

**URL:** https://pdfjs.community/t/customize-print-options/490
**Category:** Technical Support
**Tags:** pdfjs-express
**Created:** [February 12, 2021, 11:01am UTC](https://pdfjs.community/t/customize-print-options/490 "2021-02-12T11:01:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![torloneg](https://avatars.discourse-cdn.com/v4/letter/t/7bcc69/32.png) [@torloneg](https://pdfjs.community/u/torloneg)
#### Post date: [February 12, 2021, 11:01am UTC](https://pdfjs.community/t/customize-print-options/490/1 "2021-02-12T11:01:47Z")

</div>

**trial version downloaded from the site**

**Detailed description of issue**

I am evaluating the functionalities in particular the possibility to customize the pdf printing

**Expected behaviour**

is it possible to **hide** some print functions?  
hide all pages  
hide include comments  
hide include annotation  
hide print quality

other  
Is it possible to indicate a range of pages to print and have a combox to select them?

Thx  
GT

---

<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: [February 17, 2021, 3:25pm UTC](https://pdfjs.community/t/customize-print-options/490/2 "2021-02-17T15:25:10Z")

</div>

Hey there! Sorry for the delay in response, we had a long weekend.

Unfortunately, we don’t have APIs to customize the print modal. I would suggest creating your own modal instead and using our [print api](https://pdfjs.express/api/WebViewerInstance.html#printInBackground__anchor) to programmatically print.

You can overwrite the default functionality of that button like so:

```javascript
instance.updateElement('printButton', {
    onClick: () => {
      openYourCustomPrintModal()
    }
  })

```

Then, in your modal, you would display whatever UI you want, and pass whatever options the user chooses into the print API mentioned above.

Let me know if you run into any issues!

Thanks,  
Logan

---

<div class="post-metadata">

### Author: ![torloneg](https://avatars.discourse-cdn.com/v4/letter/t/7bcc69/32.png) [@torloneg](https://pdfjs.community/u/torloneg)
#### Post date: [February 17, 2021, 10:57pm UTC](https://pdfjs.community/t/customize-print-options/490/3 "2021-02-17T22:57:31Z")

</div>

@Logan  
thanks for the reply, I changed the interface by inserting a print button on the top header

However, I have a print quality problem when I use printInBackground

I tried to set a quality with  
instance.setPrintQuality (20);

but without success

seems to work only with the standard print panel

GT

---

<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: [February 22, 2021, 9:01pm UTC](https://pdfjs.community/t/customize-print-options/490/4 "2021-02-22T21:01:59Z")

</div>

Hey there,

Try setting the print quality to `2` instead of 20. Also make sure you are using the latest version of Express, there was a bug in previous versions where print quality didn’t work.

Thanks!  
Logan

---

<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: [February 22, 2021, 11:00pm UTC](https://pdfjs.community/t/customize-print-options/490/5 "2021-02-22T23:00:52Z")

</div>

Hey again,

I just realized this was a known issue that will be fixed in 7.3 which will be released very soon. Keep an eye on #announcements .

Thanks!  
Logan

---

<div class="post-metadata">

### Author: ![silvan.blank](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@silvan.blank](https://pdfjs.community/u/silvan.blank)
#### Post date: [September 6, 2022, 12:11pm UTC](https://pdfjs.community/t/customize-print-options/490/6 "2022-09-06T12:11:13Z")

</div>

Hello,  
I used the following code snippets, to print the current page in high quality by clicking on the printButton

```javascript
instance.UI.setPrintQuality(2);

var currentPageNumber = 1;
// Listener to get current Page
Core.documentViewer.addEventListener('pageNumberUpdated', (pageNumber) => {
	currentPageNumber = pageNumber;
});

instance.updateElement('printButton', {
	onClick: () => {
		printCurrentPage();
	}
})

function printCurrentPage(){
	instance.UI.printInBackground({
		pagesToPrint:[currentPageNumber],
		includeComments:false,
		includeAnnotations: false,
		maintainPageOrientation: true,
		onProgress: function(pageNumber, htmlElement) {},
	});
}

```

How can I modify the shortcuts CTRL+P and CMD+P to have the same behaviour, as I did with instance.updateElement(‘printButton’ and also execute the printCurrentPage()-Function?

Thx a lot,  
Silvan
