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

180
Vistas
How to decode PDF binary data to Postscript readable text

I'm currently searching for a way to extract the code (PostScript) behind a PDF just from its binary data. I have an input of type file that has an onChange event handler attached. The event handler looks like this:


const handleFileChange = (e) => {
  const [file] = e.target.files

  const reader = new FileReader()
  
  reader.addEventListener("loadend", () => {
    const buffer = reader.result
    const view = new DataView(buffer)
    
    const decoder = new TextDecoder("ascii")
    const text = decoder.decode(view)
  })
  
  reader.readAsArrayBuffer(file)
}

This code produces text that looks like this %PDF-1.3 %Äåòåë§ó ÐÄÆ 3 0 obj << /Filter /FlateDecode /Length 4573 >> stream xµ\ëŽÜ¶þϧ жVwi‚ hìM The beginning is just fine, it's everything afterward is the issue - %Äåòåë§ó ÐÄÆ & µ\ëŽÜ¶þϧ жVwi‚ hìM. It's illegible. I'm not sure if I just have the wrong encoding selected or what I'm setting out to do is all but impossible. Am I missing something here? If yes, what exactly? I appreciate any and all help. Thank you!

(resources are also welcomed)

about 4 years ago · Juan Pablo Isaza
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