• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

177
Vistas
Can't get stdout of execSync(`pdftk ${fileName} dump_data_fields`)

I'm trying to get the output of pdftk command with execSync. Here is the code:

const { execSync } = require('child_process');
const result = execSync(`pdftk ${fileName} dump_data_fields`);

After execution result contains an empty Buffer. At the same time if I set the output option to inherit {stdio: 'inherit'} the output of the command will be printed to console, so the command works fine. Here is a full code of such case:

const { execSync } = require('child_process');
execSync(`pdftk ${fileName} dump_data_fields`,{stdio: 'inherit'});

Also simple commands like echo Hello world works fine and it's output stored in result.

What I'm doing wrong with the pdftk command?

almost 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda