Files
html2pdf/html2pdf.go
Adrian Zürcher a5279190b4 first commit
2025-12-16 12:02:07 +01:00

33 lines
829 B
Go

package html2pdf
import "gitea.tecamino.com/paadi/html2pdf.git/converter"
func Convert(chromePath, inputFile, outputFile string) error {
c := converter.NewConverter(chromePath)
return c.Convert(inputFile, outputFile)
// chromePath := "chrome-headless-shell"
// htmlURL := "file://"
// switch runtime.GOOS {
// case "windows":
// chromePath += ".exe"
// htmlURL += "/"
// default:
// }
// // Convert to absolute path
// absPath, err := filepath.Abs(imputFile)
// if err != nil {
// return err
// }
// htmlURL += filepath.ToSlash(absPath)
// chromePath = filepath.Join(c.chromePath, chromePath)
// opts := append(chromedp.DefaultExecAllocatorOptions[:],
// chromedp.ExecPath(chromePath),
// chromedp.NoSandbox,
// chromedp.Headless,
// chromedp.DisableGPU,
// )
}