Customize print options

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

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 to programmatically print.

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

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

@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

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

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

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

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