Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

219
Vistas
¿Cómo corregir `URIError: no se pudo decodificar el cuerpo del pdf del parámetro` recibido del backend?

Entonces, desde el backend recibo un binario pdf como este:

 "%PDF-1.3\r%����\r%PDF-Writer.NET dbAutoTrack Ltd.\r2 0 obj\r<<\r/Creator (Online)\r/CreationDate (D:20220411184728+02'00')\r/ModDate (D:20220411184728+02'00')\r>>\rendobj\r3 0 obj\r[/PDF /Text /ImageC]\rendobj\r7 0 obj\r<<\r/Type /XObject \r/Subtype /Image \r/Name /I0 \r/Length 76843 \r/Width 1545 \r/Height 2000 \r/Filter /DCTDecode \r/ColorSpace /DeviceRGB \r/Decode [0.0 1.0 0.0 1.0 0.0 1.0]\r/BitsPerComponent 8\r>>\rstream\r\n����\u0000\u0010JFIF\u0000\u0001\u0001\u0001\u0000`\u0000`\u0000\u0000��\u0000C\u0000\b\u0006\u0006\u0007\u0006\u0005\b\u0007\u0007\u0007\t\t\b\n\f\u0014\r\f\u000B\u000B\f\u0019\u0012\u0013\u000F\u0014\u001D\u001A\u001F\u001E\u001D\u001A\u001C\u001C $.' \",#\u001C\u001C(7),01444\u001F'9=82<.342��\u0000C\u0001\t\t\t\f\u000B\f\u0018\r\r\u00182!\u001C!22222222222222222222222222222222222222222222222222��\u0000\u0011\b\u0007�\u0006\t\u0003\u0001\"\u0000\u0002\u0011\u0001\u0003\u0011\u0001��\u0000\u001F\u0000\u0000\u0001\u0005\u0001\u0001\u0001

Luego, en mi aplicación de interfaz angular, hago esto:

 this.api .GetPrintedInvoice(invoiceID) .then((res) => { console.log("RES",res) window.open(res); }); }

EDITAR:

Así es como lo analizo en la respuesta de ejemplo anterior:

 parser.parseString(body, function(err, result) { request.get({ url: result.feed.entry[0].content[0]['m:properties'][0]['d:Url'][0], headers: { 'Authorization': auth.Item.token_type + " " + auth.Item.access_token, "Content-Type": "text/pdf" } }, async function(err, httpResponse, body) { console.log(body); console.log(typeof body) callback(null, body); }); });

Esto me devuelve el error del título. Quiero poder obtener esta respuesta y mostrarla como PDF y eventualmente poder descargarla, pero no estoy seguro de cómo hacerlo.

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda