Introduction
There are two ways of disabling printing inside the Viewer:
- The first would be to remove the print button directly from a viewer template file.
- The second option would be to pass it in as a configuration parameter to the jQuery plugin.
Let’s have a closer look at how both of these options can be used.
Modifying the Printing Template
In order to remove printing from a template, you will need to open the "viewerTemplate.html" file that can be found inside a Samples folder. The exact location will depend on the type of sample you are using. For example, in the .NET/Webforms sample it will be located at:
...Prizm\Samples\dotnet\webforms\full-viewer-sample\viewer-assets\src\templates
Once you’ve opened the file, search for an element with the attribute data-pcc-print="launch" and delete it.
You will then need to build the Viewer assets by running "npm install" and "gulp build". Copy the output /dist/viewer-assets/js/viewerCustomizations.js file over the /viewer-assets/js/viewerCustomizations.js file in the sample. For more information on building the Viewer assets, see the README file in the viewer-assets folder.
Configuring Viewer Parameters
In order to disable printing via the Viewer parameters options object, that is passed to the Viewer, add the following uiElements parameter to the options object:
Example
var pluginOptions = {
uiElements: {
printing: false
}
};
For example, in the .NET/Webforms sample this options object is being created in the ‘Default.aspx’ file.
Additional Resources
- Design Basics - This topic gives you an overview of how to customize the Viewer.
- Available Parameters for the UI - This topic provides a list of available UI configuration options.
- Interactive Code Examples - These live code examples allow you to see how to customize the Viewer.