Closed dan-tang-ssd closed 1 year ago
As discussed, I refer to "Add Browsershot" PR #51 to add a config file ".puppeteerrc.cjs" to specify cache folder for Windows env. It can now generate PDF file.
However, the pdf content looks like 70% transparent, and there is no spider chart in pdf... I tried the printing function in browswer, it has spider chart...
Screen shot:
Click "Generate PDF" button
The generated pdf, content is 70% transparent, no spider chart here
Broswer printing function, it has spider chart
By using ->preventUnsuccessfulResponse() when generaring pdf file, transparency changed from 70% to 50%.
Without ->preventUnsuccessfulResponse(), e.g. $pdf = Browsershot::html($htmlContent)->pdf();
With ->preventUnsuccessfulResponse(), e.g. $pdf = Browsershot::html($htmlContent)->preventUnsuccessfulResponse()->pdf();
I am struggled now... the generated pdf can have different level of transparency by running same code... I will leave this item here now and work on other items first.
Describe the bug Generate PDF does not generate PDF file, nothing happened
To Reproduce Initiatives > Click Expand button > Click Show Initiative Information button > Click Generate PDF button
Expected behavior PDF file generated and triggered file download in browser
Screenshots