title: how to get file content through c# in node js
body: <blockquote>
  <p>I am getting blob of pdf file from other server which is on C# in node server when I am converting it to array buffer it's size is different from C# array buffer size and when I am opening it to browser it gives error &quot;Failed to load PDF document.&quot;</p>
  </blockquote>
  <blockquote>
  <p>This is my server side code</p>
  </blockquote>
  <pre><code>async post(param: any, body: any, endPoint: string, queryParams: string = '') 
    {    
      try 
      {
        if(queryParams == '') queryParams = param.destinationSlug + '/' + param.mainBranchId;
        const url = splendidAccountsEndPointsEnum.baseUrl + queryParams + endPoint;
        const offset = new Date().getTimezoneOffset().toString();
        const headerConfig = { headers: { 'X-Api-Key': param.apiKey, 'X-Api-Secret': param.apiSecret, 'X-App-Id': config.get&lt;string&gt;(&quot;splendidXAppId&quot;), LocalDateTimeOffset: offset }}
        const response = await axios.post(url, body, headerConfig)      
          .then(function (response: any) 
          {
            return response?.data;
          })
          .catch(function (error: any) 
          {
            console.log(error);
            return error;
          });
        if (response?.status === 200) 
        { 
          console.log('success');
          return response?.data;
        }
  
        return response;
      }
      catch (err) 
      {
        console.error(err);
        console.log(err);
        return err;
      }    
    }
  </code></pre>
  <blockquote>
  <p>And this is my client side</p>
  </blockquote>
  <pre><code>
  let response = this.orderService.generateInvoicePrinting(this.selectedRows)
            .subscribe((res) =&gt; {
              var file = new Blob([res], {type: 'application/pdf'});
              var fileURL = URL.createObjectURL(file);
              saveAs(file, &quot;invoices.pdf&quot;);
              window.open(fileURL);
              this.pdfSrc = fileURL;
              this.showPdf = true;
              this.showSuccess('Invoices have been generated successfully.');
              this.selectedRows = [];
            },
            error =&gt; {
              this.showError('Invoices have not been generated successfully.');
            }); 
  
  generateInvoicePrinting(orders: any): Observable&lt;any&gt;
    {
      const url = `${environment.apiUrl}api/Order/printInvoices/pdf`;
      return this.http.post(url, orders, { headers: new HttpHeaders({ 'Content-Type': 'application/json' }), observe: 'response', responseType: 'blob' }).pipe(
        map(res =&gt; res.body),
      );
    }
  </code></pre>