'DOMPDF loadHTML wait for vue.js finished
i try to generate a pdf out of HTML like that:
$viewcontr = new AssignmentViewController(AssignmentRepository::getInstance());
$pdf = App::make('dompdf.wrapper');
$pdf->loadHtml($viewcontr->edit($id, true));
the viewcontr->edit method returns a view:make , everything works fine but the generated PDF doesnt have the vue.js components because it generates before vue.js calls finished. Is there a way to generate a pdf after every call and request finished?
Solution 1:[1]
Use Promise.all to resolve all the requests before hand like so:
const promise1 = axios.get(URL1);
const promise2 = axios.get(URL2);
Promise.all([promise1, promise2]).then(function(values) {
// trigger generating PDF here
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ali Raza |
