How can I help you?
Document Loading Issues in Version 23.1 or Newer
12 Feb 20261 minute to read
If a document does not render in the viewer when using version 23.1 or newer, follow these steps:
- Call
viewer.dataBind()beforeload(). Starting with v23.1, an explicitdataBind()call is required to initialize data binding and render correctly. EnsuredataBind()is invoked afterappendTo()and beforeload()as shown in the example.
var viewer = new ej.pdfviewer.PdfViewer ({
serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'});
ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.BookmarkView, ej.pdfviewer.ThumbnailView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.Annotation, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner);
viewer.appendTo('#pdfViewer');
viewer.dataBind();
viewer.load('https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', null);- Verify the document source: ensure the document URL or file path is correct and reachable.
- Check network connectivity: the viewer requires network access to fetch remote documents.
- Inspect console errors using browser developer tools to identify runtime or network failures.
- Confirm initialization order: instantiate the viewer, call
dataBind(), then callload(). - Upgrade to the latest viewer release; the issue may be fixed in newer versions.
- Configure CORS correctly for cross-origin documents so the viewer can retrieve remote files.
- Review Content Security Policy (CSP) settings and permit any external resources required by the viewer. See the Content Security Policy troubleshooting guide in the Syncfusion documentation for details.
NOTE
For v23.1 and later, ensure
dataBind()is called beforeload(); earlier releases may not require this call.
Following this checklist typically resolves document loading issues in v23.1 and later.