Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

294
Views
cómo obtener el contenido del archivo a través de C# en el nodo js

Recibo un archivo pdf de otro servidor que está en C# en el servidor de nodos cuando lo convierto en un búfer de matriz, su tamaño es diferente del tamaño del búfer de matriz de C# y cuando lo abro en el navegador aparece el error "Error al cargar el PDF". documento."

Este es mi código del lado del servidor

 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<string>("splendidXAppId"), 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; } }

Y este es mi lado del cliente

 let response = this.orderService.generateInvoicePrinting(this.selectedRows) .subscribe((res) => { var file = new Blob([res], {type: 'application/pdf'}); var fileURL = URL.createObjectURL(file); saveAs(file, "invoices.pdf"); window.open(fileURL); this.pdfSrc = fileURL; this.showPdf = true; this.showSuccess('Invoices have been generated successfully.'); this.selectedRows = []; }, error => { this.showError('Invoices have not been generated successfully.'); }); generateInvoicePrinting(orders: any): Observable<any> { 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 => res.body), ); }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!