daandesmedt / phpheadlesschrome Goto Github PK
View Code? Open in Web Editor NEWA PHP wrapper for using Google Chrome Headless mode. Convert URL or HTML to a PDF / screenshot. Easy to use and OOP interfaced.
License: MIT License
A PHP wrapper for using Google Chrome Headless mode. Convert URL or HTML to a PDF / screenshot. Easy to use and OOP interfaced.
License: MIT License
Hi,
i'm testing PDF production from an html page with a large amount of data loaded by javascript after first html load of the page (ex Simphony o Vue).
By converting my example page to pdf as shown in the example, I only see the raw html without javascript outcome
is there a way to say PHPHeadlessChrome to wait some seconds o to wait until a selected element is loaded?
I have a somewhat unique situation with our software host regarding disabled php functions. While it'd be ideal not to use either proc_open() or exec(), the mikehaertl/php-shellcommand does allow the option to switch between the two.
It'd be great for that option to bubble up into the toPDF and toScreenShot commands.
I am trying to pdf a url with several variables e.g.
https://example.com/index.html?rand=19699&cid=Sample_03&rid=38&stid=Bbage
but it is just throwing a mysql error on the pdf page. the url opens in a browser fine.
Hi,
I am using chrome version 84 on my MacBook and when I export pdf it exports blank pdf with header and footer. Even I used no header footer tag, still, it prints header and footer and the rest page is blank. I went ahead and downloaded the older version of chrome 71 and it works (it exporting webpage perfectly). However, here also screen size, no footer header tags won't work.
Can anyone help me here, please?
is there some argument that can be added to remove the printed header and footer information on the pdf, like the date at the top and the url at the bottom.
$PDFFilename variable at line 236 of the HeadlessChrome class is incorrect.
Some OS are case sensitive.
Check it out because it is giving you trouble when calling the toPDF() method without entering the file name.
Hi
I wish to use this library to scrape webpage content, but also wish to use a proxy, so how can I do it
Thanks
hello...thank you for this nice library.
i am trying to build a spider to pull as-near-perfect-as-possible website mirrors for potential legal actions (scam websites and the like) and i have found i need the ability to automate the finding and clicking of javascript-based buttons on the pages...i've looked and don't see that functionality anywhere in the examples.
I like the fact that this lib is build in PHP and not node.js (i will use Puppeteer if necessary but am exploring options before diving into that) and i know headless chrome supports in-page navigation and click actions...any chance you already support them too or plan on adding that in the future?
Hi, when i tried to print to pdf local HTML :
$headlessChrome = new HeadlessChrome();
$headlessChrome->setBinaryPath('chromium-browser');
$headlessChrome->setOutputDirectory($this->pdfDir);
$headlessChrome->setHTML($this->renderView($htmlAndParams[0], $htmlAndParams[1]));
$headlessChrome->setArgument('--no-sandbox', '');
$headlessChrome->disablePDFHeader();
$filename = $headlessChrome->toPDF();
Thanks for any help
Hi, is there any way to disable javascript? It's because I always get cookies bar on pages on sites, thx
Can the linux operating system be effectively supported? How to solve the chrome path
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.