question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Only getting single page PDF

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.8.0
  • Platform / OS version: win10+64
  • Node.js version: 8.9.4 What steps will reproduce the problem?

Please include code that reproduces the issue.

'use strict';
const puppeteer = require('puppeteer');
(async() => {
  const browser = await puppeteer.launch({
        timeout:0,
        args: ['--disable-gpu', '--no-sandbox', '--disable-setuid-sandbox'],
        executablePath: './chromium/chrome.exe',
        headless: true,
  });
  const page = await browser.newPage();
  await page.goto('http://192.168.0.165:80', {waitUntil: 'networkidle0'});
  page.emulateMedia('screen');
  await page.pdf({
    path: 'hn.pdf',
    format: 'A4',
    printBackground: true,
  });
  await browser.close();
})();

What is the expected result? multiple pages

What happens instead? single page ,content lost

No matter how high the height , I can only print one pdf,the contents behind it are all lost. It should be multiple pages. Is it related to CSS print?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
colin-johnsoncommented, Mar 19, 2020

Was there a solution found for this? Dealing with the same thing

6reactions
februaryInkcommented, Jul 11, 2020

I also had this issue. It turned out that the html and body heights were being restricted by height: 100%. Using min-height instead seems to have resolved it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to save one page of a PDF - Adobe
One of the easiest ways to separate and save a single page in a PDF is to use a PDF splitter tool. Simply...
Read more >
How To Save One Page of a PDF File (With 5 Methods) - Indeed
1. Save one page of a PDF using a PDF editor · Open the PDF file in the editing application. · Select "File"...
Read more >
3 Ways to Save One Page of a PDF for Free - wikiHow
1. Open the Google Chrome browser. If you have Google Chrome on your computer, you can use it to create a new PDF...
Read more >
How to Save One Page of a PDF - Lifewire
Open the PDF file in your PDF editor. · Click File > Print. · Choose the page you want to save from the...
Read more >
Single page print fail on Microsoft PDF reader in Windows 10.
Under Programs in setting your default programs, my Adobe 8.1 is not listed, only Reader DC is. How do I get my Adobe...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found