Documentation ¶
Index ¶
- func ConvertHTMLtoPDF(htmlFilePath string, pdfFilePath string, pageSize string) error
- func CopyAllAssetsToTempDir(tempDir string, template string) error
- func DecodeRequestBody(rbody io.ReadCloser) (map[string]interface{}, error)
- func GenerateHTMLFromData(data interface{}, tempDir string, templateName string, htmlPath string) error
- func GetPdfBytes(pdfPath string) ([]byte, error)
- func GetTempDirAndPaths(filename string) (string, string, string, error)
- func OptimizePDF(pdfPath string, metadata interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertHTMLtoPDF ¶
ConvertHTMLtoPDF converts the supplied HTML file to a PDF file
func CopyAllAssetsToTempDir ¶
CopyAllAssetsToTempDir stages HTML, CSS, and images to the temp directory for templating
func DecodeRequestBody ¶
func DecodeRequestBody(rbody io.ReadCloser) (map[string]interface{}, error)
DecodeRequestBody takes the http.Request body and decodes it to a map
func GenerateHTMLFromData ¶
func GenerateHTMLFromData(data interface{}, tempDir string, templateName string, htmlPath string) error
GenerateHTMLFromData takes a map of data and performs the HTML templating
func GetPdfBytes ¶
GetPdfBytes returns a []byte of the requested file to return in the http.ResponseWriter
func GetTempDirAndPaths ¶
GetTempDirAndPaths creates a temp directory and HTML and PDF filepaths in that order: TempDir, HTMLPath, PDFPath
func OptimizePDF ¶
OptimizePDF optimizes the PDF, reusing images, and reducing the overall size and applies metadata & bookmarks
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.