Forced Viewer layout mode with certain PDF files

Posted by: gpatyi_c on 27 October 2025, 12:30 pm EST

    • Post Options:
    • Link

    Posted 27 October 2025, 12:30 pm EST

    Hi,

    I have the package implemented in an Angular application. I want to edit PDF files in FormEditor layout mode. However, the editor gets forced into the Viewer layout mode with certain PDFs. Annotations cannot be added and modified. The toolbar also displays buttons that belong to the Viewer mode instead of the FormEditor mode. The toolbar’s first button is the Form Editor button. Our application defines custom buttons for the viewer mode and this button is not included in the definition; however, it is displayed regardless. If I click on it, then the editor’s layout mode is set to the FormEditor mode correctly. The toolbar buttons change to the proper ones and annotations can be added and modified, so the behavior is correct.

    I have attached one such PDF file. I created another version of the buggy file using Adobe Acrobat’s Print option to flatten the file and that seems to have worked in eliminating the bug. I have attached the flattened file as well. Additionally, I have uploaded the screenshot of the toolbar with the Form Editor button.

    I would like to ask what could be causing the issue exactly?

    Thank you in advance!

  • Posted 28 October 2025, 3:25 am EST

    Hi Gabor,

    It seems like the PDF files you mentioned are not attached. However, as per the screenshot and the behavior described by you, it can be caused by the metadata present in the confidential PDF files. To ignore this metadata, it is required to use the ignoreInitialView viewer option. Please refer to the code snippet below that demonstrates the usage of this property:

    const viewer = new DsPdfViewer("#viewer", { ignoreInitialView: true });

    In case the issue does not resolve on your end using the ignoreInitialView option, please share the following details with us:

    1. A stripped-down sample replicating the issue.
    2. The PDF files that cause the issue.

    In case the PDF files are confidential, you can share them on our private support portal available at: https://developer.mescius.com/my-account/my-support

    Best Regards,

    Chirag

    References:

    1. ignoreInitialView: https://developer.mescius.com/document-solutions/javascript-pdf-viewer/api/classes/ViewerOptions#ignoreinitialview
  • Posted 28 October 2025, 5:12 am EST

    Hi Chirag,

    Thank you for both the solution and the quick response. Using the ignoreInitialView option has solved the issue.

    Best Regards,

    Gabor

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels