That is just a wrapper for wkhtmltopdf - I'd suggest looking into that 
library and tool https://wkhtmltopdf.org/ first. If you can get the 
wkhtmltopdf command line tool to convert your file happily, then getting 
the Go wrapper to do the same is probably possible. But if the command line 
tool can't do it, then adding Go is not going to change that. As the 
webpage for it says, it uses a patched Qt. https://wiki.qt.io/Handling_HTML 
says, about Qt apps handling html, 
"However, it only supports a limited subset of static HTML 4 / CSS 2.1"

https://www.w3.org/TR/CSS2/page.html

My suggestion, then, would be to try the approach described 
here: 
https://medium.com/compass-true-north/go-service-to-convert-web-pages-to-pdf-using-headless-chrome-5fd9ffbae1af
which uses a headless Chrome instance to do the rendering. I don't know 
that Chrome has better support, but that should be easy enough to test - 
just load your HTML+CSS doc in Chrome directly and save to PDF - if it 
looks good, then the above method might get the same result in Go.

Again, nothing about this is really Go related - just dependent on what 
backend is actually doing the HTML+CSS rendering.

Howard

On Thursday, March 21, 2019 at 10:24:29 AM UTC-5, nafisf...@gmail.com wrote:
>
> I try to make a pdf from my HTML and CSS. In CSS file there have 
> some Paged Media Models. 
> https://github.com/SebastiaanKlippert/go-wkhtmltopdf/ I use this library 
> to generate my pdf but the problem is the Print CSS didn't work well. I am 
> searching for some idea and feel free to suggest me if you have any 
> solution. Thank you for your time.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to