Please give a brief summary of your issue:
the document is loaded, but when we click on print it is loading empty document.
Please provide a link to a minimal sample where the issue is reproducible:
the document is loaded, but when we click on print it is loading empty document. but when we click on download it is downloading
Hello, Iâm AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
It sounds like youâre encountering an issue where the document appears empty when trying to print from the WebViewer, despite it displaying correctly when downloaded. This could be due to several issues related to document rendering or the print setup.
Some things you can try:
Ensure that the document is fully loaded before attempting to print. You can listen for the document load event to confirm.
Check if there are any errors in the console that might indicate issues with rendering or resources not being loaded properly.
Verify that the print functionality is correctly implemented according to the WebViewer API guidelines.
Consider using the pre-rendering features to ensure that all pages are ready for rendering before printing.
Test with different browsers to see if the issue is specific to a particular one.
Is this file specific? Do you have a sample file? - not spwcific file i am loading the blob getting as response from api
Can you reproduce this on our viewing sample? JavaScript PDF Viewer Demo - No
Which browsers and devices does this occur on? What are the details? - we tried different details.
Are there any console/network errors - No
Can you provide your WebViewer constructor?
WebViewer({
path: â../../lib/webviewerâ,
licenseKey: this.commonService.aspyreKey,
initialDoc: ââ,
// enableFilePicker: true,
fullAPI: true,
css: âassets/css/webviewer.cssâ
}, this.viewer.nativeElement).then(instance => {
this.viewerInstance = instance;
const { UI } = instance;
UI.disableElements([
âtoolbarGroup-Viewâ, // entire View menu
âtoolbarGroup-Editâ, // entire Edit menu
âtoolbarGroup-Annotateâ, // entire Annotate menu
âtoolbarGroup-FillAndSignâ,
âtoolbarGroup-Shapesâ,
âtoolbarGroup-Insertâ,
âmenuOverlayâ, // context menu
âdownloadButtonâ, // single button
âtoolbarGroup-Editâ,
âtoolbarGroup-Formsâ,
âpanToolButtonâ
]);
if (this.file) {
if(this.commonService.printTypeFile){
const file = new File([this.file], âdocument.xlsxâ, { type: this.file.type });
instance.UI.loadDocument(file);
}
else{
instance.UI.useEmbeddedPrint(true);
instance.UI.loadDocument(this.file);
this.commonService.printTypeFile = true;
}
// UI.print();
}
})
Can you reproduce this issue with embedded print? - Embeded it is working, but it is taking time to open the print module. ant print setting model is not closing
Iâm not able to reproduce this issue when loading an xlsx file as a blob.
Steps I took to reproduce the issue:
Copied as much of your sample code into my project as possible
Used fetch to get an XLSX file and turn it into a blob
Called instance.UI.loadDocument on the blob
Opened the print modal and pressed print on Chrome
This is done v11.7.1.
Can you provide a sample project to reproduce the issue? You can download a sample from the site below as a template. The sample project can then be uploaded to GitHub.