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

905
Vistas
Puppeteer - ProtocolError: Protocol error (Page.printToPDF): Printing is not available

I get the below error when trying to print PDF with Puppetter. I've not been able to find much information about this error online. Does this mean this particular page just doesn't support PDF or is there a setting in my code that could ammend this? Any help would be appreciated.

enter image description here

export const create = async (dev: boolean = true) => {
        
        const username = process.env.USERNAME;
        const password = process.env.PASSWORD;
    
        const options = dev
            ? {
                    headless: false,
                    slowMo: 25, 
              }
            : {};
    
        const browser = await Puppeteer.launch(options);
        const page = await browser.newPage();
    
        await page.goto(LOGIN_URL, {
            waitUntil: "networkidle2",
        });
    
        await page.type(USERNAME_INPUT_ID, username);
        
        const passwordInputHandle = await page.$(PASSWORD_INPUT_ID);
        await passwordInputHandle.type(password);
        await passwordInputHandle.press("Enter");
    
        await page.pdf({ path: path.join(TEMP_FOLDER, "hn.pdf"), format: "a4" });
    
        await browser.close();
    };
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

PDF creation is only supported in headless mode.

So this should work.:

const browser = await Puppeteer.launch({ headless: true });

over 4 years ago · Santiago Trujillo Denunciar
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