Change default zoom level

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version
3.7.107

Detailed description of issue
Is it possible to load a pdf with a different zoom level than the default? Or even better to say that the pdf should take up the full width of the page.
THANKS.

Hi there,

Thank you for contacting pdf.js express forums,

You can use the setFitMode to set the fit mode of the viewer:
https://pdfjs.express/api/UI.html#.setFitMode__anchor

WebViewer(...)
  .then(function(instance) {
    var docViewer = instance.Core.documentViewer;
    var FitMode = instance.UI.FitMode;

    // you must have a document loaded when calling this api
    docViewer.addEventListener('documentLoaded', function() {
      instance.UI.setFitMode(FitMode.FitWidth);
    });
  });

If you want to set the zoom level of the viewer, you can use the setZoomLevel API:
https://pdfjs.express/api/UI.html#.setZoomLevel__anchor

Best regards,
Kevin Kim