Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra page or not full page, can get one full screan #454

Open
go-shafaq opened this issue Nov 2, 2023 · 0 comments
Open

extra page or not full page, can get one full screan #454

go-shafaq opened this issue Nov 2, 2023 · 0 comments

Comments

@go-shafaq
Copy link

hello every one!
I'm trying to get one and full page but it is not working as I want
what I got as you can see in pictures if it's single page I'm getting white line in the footer, if I add 1 px it goes away to next page as in picture how ever there is not white line.
issue2
issue1

how can I get single, full page and with no-white line pdf?
there is my html file : https://github.com/abdullayev13/ett-pdf-gen/blob/main/index.voucher.html

it is my code:
https://github.com/abdullayev13/ett-pdf-gen/blob/main/tmp.js
`const puppeteer = require('puppeteer');
const fs = require('fs');

(async () => {

// Create a browser instance
const browser = await puppeteer.launch();

// Create a new page
const page = await browser.newPage();

//Get HTML content from HTML file
const html = fs.readFileSync('index.voucher.html', 'utf-8');
await page.setContent(html, {waitUntil: 'domcontentloaded'});

// To reflect CSS used for screens instead of print
await page.emulateMediaType('screen');

// Downlaod the PDF
const pdf = await page.pdf({
    path: 'result.pdf',
    printBackground: true,
    width: '595px',
    height: '842px',
});

// Close the browser instance
await browser.close();

})();`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant