add new instance and provide multiple converting files close #2
This commit is contained in:
17
html2pdf.go
17
html2pdf.go
@@ -1,8 +1,21 @@
|
||||
package html2pdf
|
||||
|
||||
import "gitea.tecamino.com/paadi/html2pdf/converter"
|
||||
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(inputFile, outputFile)
|
||||
return c.Convert(input)
|
||||
}
|
||||
|
||||
// NewConverterInstance start new chrome headless shell instance
|
||||
func NewConverterInstance(chromePath string) *converter.Converter {
|
||||
return converter.NewConverter(chromePath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user