pkg

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

orcgen generates files from HTML - any static webpage can be informed, or even an HTML file. The file will be generated according the choosen extension.

Index

Constants

View Source
const (
	// PDF const.
	PDF = internal.PDF
	// PNG const.
	PNG = internal.PNG
	// JPEG const.
	JPEG = internal.JPEG
)

Valid extension types constants.

Variables

This section is empty.

Functions

func ConvertHTML added in v1.0.1

func ConvertHTML(ext internal.Ext, html []byte, output string) error

ConvertWebpage converts the informed bytes to the ext format, and saves the file.

ext is the extension to be converted to (use the defined constants above). html is the html byte array (if it's a filepath, use os.ReadFile(filepath)). output is a filepath containing the extension.

The connection is automatically closed.

func ConvertWebpage added in v1.0.1

func ConvertWebpage(ext internal.Ext, url string, output string) error

ConvertWebpage converts the url to the ext format, and saves the file.

ext is the extension to be converted to (use the defined constants above). url is the url to convert. output is a filepath containing the extension.

The connection is automatically closed.

func New

func New(ext internal.Ext) *director.Director

New starts a new Director - the Director contains the available methods for file conversion.

ext is the extension to be converted to (use the defined constants above).

Connect and Close are used for the Browser connection control. ConvertWebpage and ConvertHTML are used for page conversion.

There are a set of setters for specific config.

Types

This section is empty.

Directories

Path Synopsis
package director provides functionality for generating files from HTML using the Rod package.
package director provides functionality for generating files from HTML using the Rod package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL