Print the document is showing the empty.

Product: Javascript WEB SDK

Product Version: 11.7.1

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 :robot:
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.




Here are some resources that might help you:



Hopefully, this helps you solve your problem while you wait for a human to get back to you.

1 Like

Hello Lokesh,

Thank you for contacting Apryse Forums.

I’m not able to reproduce this issue.

  1. Is this file specific? Do you have a sample file?
  2. Can you reproduce this on our viewing sample? JavaScript PDF Viewer Demo
  3. Which browsers and devices does this occur on? What are the details?
  4. Are there any console/network errors
  5. Can you provide your WebViewer constructor?
  6. Can you reproduce this issue with embedded print?
instance.UI.useEmbeddedPrint(true);

Best Regards,
Darian

1 Like
  1. Is this file specific? Do you have a sample file? - not spwcific file i am loading the blob getting as response from api
  2. Can you reproduce this on our viewing sample? JavaScript PDF Viewer Demo - No
  3. Which browsers and devices does this occur on? What are the details? - we tried different details.
  4. Are there any console/network errors - No
  5. 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();
    }
    })
  6. 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
1 Like

Hello Lokesh,

I’m not able to reproduce this issue when loading an xlsx file as a blob.

Steps I took to reproduce the issue:

  1. Copied as much of your sample code into my project as possible
  2. Used fetch to get an XLSX file and turn it into a blob
  3. Called instance.UI.loadDocument on the blob
  4. 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.

Best Regards,
Darian

1 Like