22 lines
564 B
Go
22 lines
564 B
Go
package html2pdf
|
|
|
|
import (
|
|
"gitea.tecamino.com/paadi/html2pdf/converter"
|
|
"gitea.tecamino.com/paadi/html2pdf/models"
|
|
)
|
|
|
|
// Convert converts one .html file to .pdf
|
|
func Convert(chromePath, inputFile, outputFile string) error {
|
|
input := models.File{
|
|
Input: inputFile,
|
|
Output: outputFile,
|
|
}
|
|
c := converter.NewConverter(chromePath)
|
|
return c.Convert(input)
|
|
}
|
|
|
|
// NewConverterInstance start new chrome headless shell instance
|
|
func NewConverterInstance(chromePath string) *converter.Converter {
|
|
return converter.NewConverter(chromePath)
|
|
}
|