Add header values in EJ2 JavaScript Pdfviewer control

8 May 20231 minute to read

To add header values to an AJAX request made by a Syncfusion PDF Viewer, you can use the ajaxHeaders property available in the ajaxRequestSettings module of the PDF Viewer. This property allows you to specify custom headers for the AJAX request.

Here is an example of how you can use the ajaxRequestSettings property to add a custom header to an AJAX request made by the PDF Viewer:

viewer.ajaxRequestSettings = {
   ajaxHeaders: [
      {
         headerName: "Authorization",

         headerValue: "Bearer 64565dfgfdsjweiuvbiuyhiueygf"
      }
   ],

   withCredentials: false
};

Find the sample how to add custom headers in AjaxRequestSettings