2 Commits

Author SHA1 Message Date
Adrian Zürcher
ce3d0b36da ignore dst and assets 2025-12-18 16:16:18 +01:00
Adrian Zürcher
783fddf433 remove .git 2025-12-18 16:14:31 +01:00
3 changed files with 5 additions and 27 deletions

4
.gitignore vendored
View File

@@ -1 +1,3 @@
*.pdf *.pdf
assests
dst

2
go.mod
View File

@@ -1,4 +1,4 @@
module gitea.tecamino.com/paadi/html2pdf.git module gitea.tecamino.com/paadi/html2pdf
go 1.25.4 go 1.25.4

View File

@@ -1,32 +1,8 @@
package html2pdf package html2pdf
import "gitea.tecamino.com/paadi/html2pdf.git/converter" import "gitea.tecamino.com/paadi/html2pdf/converter"
func Convert(chromePath, inputFile, outputFile string) error { func Convert(chromePath, inputFile, outputFile string) error {
c := converter.NewConverter(chromePath) c := converter.NewConverter(chromePath)
return c.Convert(inputFile, outputFile) 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,
// )
} }