Frameworks
Integrations
Mendix
SharePoint
Modular UI
Legacy UI
AnnotationManager
Annotation Types
Customize
Version 11
Version 10
v10.12
v10.11
v10.10
v10.9
v10.8
v10.7
v10.6
v10.5
v10.4
v10.3
v10.2
v10.1
v10.0
Version 8
v8.12
v8.11
v8.10
v8.9
v8.8
v8.7
v8.6
v8.5
v8.4
v8.3
v8.2
v8.1
v8.0
Version 7
Version 6
v6.3
v6.2
v6.1
v6.0
Version 5
Version 4
Version 3
Version 2
WebViewer Server
WebViewer BIM
WebViewer allows users to print the currently viewed document and also provides APIs to trigger printing programmatically.
You can customize the CSS for the print modal just like any other UI component
For more advanced customizations you can modify the component directly.
Look for the PrintModal component in the WebViewer UI repository.
To display the print dialog programmatically you can use the instance.print API.
Browsers don't have an API to directly access the printer. Instead WebViewer will render each page and place it in the DOM so that the pages are visible for printing. This means that WebViewer needs to choose a resolution to render each page. If the resolution isn't high enough then the pages may appear blurry.
The setPrintQuality API allows you to increase the resolution of the rendered pages. Note that higher values will also take longer to complete because each page needs to be rendered at a higher quality.
The recommended values are 2 to 5. 2 or 3 is suitable for most purposes. Values higher than 5 will have diminishing returns in terms of increasing quality. Note that it has no effect on the printed document quality if using embedded printing.
WebViewer supports another mode of printing called "embedded printing" where the PDF will embedded in the page and the browser print function is triggered. This allows the native PDF printing capabilities of browsers like Chrome, Safari, and Firefox to be utilized. Since embedded printing embeds the actual PDF content this ensures that high quality text and graphics are preserved when printing to physical paper or printing as a PDF.
Rasterized (default) | Embedded | |
---|---|---|
Quality | Converting text and images into a raster format (pixels) | Preserves the original font and graphic information |
Speed and memory | Needs to render every page in JavaScript | Doesn't need to render pages |
Maintenance |
| Printing flow is entirely run using our own API |
Browser Support | All | Everything except Android Chrome |
When using embedded printing the grayscale and "include comments" options require the full API to be enabled.
You can enable it using the useEmbeddedPrint API
If you encounter quality or performance issues, an alternative approach is to open the PDF in a new browser tab when the user presses print. You can embed an auto-print action in the PDF along with the annotation on your server and generate a link to that PDF to be opened in a new tab. This is actually the approach used by WebViewer Server and is similar to the embedded print method described above.
This will open the PDF in the native browser PDF viewer and if supported by the viewer the print dialog will immediately appear. For browsers that don't support auto-print, the user can click the print button. This is the same approach used by Gmail when printing PDFs.
The benefit is that you're not constrained by JavaScript processing or memory, allowing the printing to start quickly and at high quality. The downside is that depending on the browser the user may need to press the print button a second time in the new tab.
This print output is the default behavior when using WebViewer Server. However, you can disable this by calling useClientSidePrint
. This option allows you to utilize rasterized or embedded custom print features, such as including annotations or printing the document in grayscale.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales