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

906
Views
Titiritero - ProtocolError: Error de protocolo (Page.printToPDF): la impresión no está disponible

Recibo el siguiente error cuando intento imprimir PDF con Puppetter. No he podido encontrar mucha información sobre este error en línea. ¿Significa esto que esta página en particular simplemente no es compatible con PDF o hay una configuración en mi código que podría modificar esto? Cualquier ayuda sería apreciada.

ingrese la descripción de la imagen aquí

 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 answers
Answer question

0

La creación de PDF solo se admite en el modo headless encabezado.

Así que esto debería funcionar.:

 const browser = await Puppeteer.launch({ headless: true });
over 4 years ago · Santiago Trujillo Report
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!