Reputation: 51
I'm using puppeteer to generate pdf of a web page. But the issue is table heading is not appearing in all the pages. Please find the code below.
const browser = await puppeteer.launch({headless: true, windowSize: '1024,768'});
const page = await browser.newPage();
await page.goto('https://my.website.io/sample.php/647/26669?report_id=647&search_engine_id=26669&data_rows=45&view_type=summary,competition-wise,page-wise,competitor-landscape,advertisers&from_date=2018-8-4&pdf_view=yes&compare_to_date=&keyword_rankings_sort_by=search_volume&keyword_rankings_sort_order=asc&api-key=45454545454554545');
await page.setViewport({width:1024, height:768, isLandscape:true, deviceScaleFactor: 1});
await page.waitFor(15000);
await page.pdf({path: 'sample.pdf',printBackground: true,format:'A3',width:'1024px',height:'768px',landscape:true,margin:{top: "190px",bottom: "150px"}});
await browser.close();
The above code is not working in my server. But works fine with https://try-puppeteer.appspot.com/
Upvotes: 2
Views: 1439
Reputation: 51
I've got the solution. I had to upgrade puppeteer 1.5.0 to 1.7.0
Thanks
Upvotes: 3