pdf

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChromeRunner

type ChromeRunner struct {
	Options              *config.Options
	ChromeDevToolsRunner func(ctx context.Context, actions ...chromedp.Action) error
}

ChromeRunner is a wrapper around chromedp.run

func (*ChromeRunner) GeneratePDFData

func (chromeRunner *ChromeRunner) GeneratePDFData() (buf []byte, err error)

Generates the PDF data

type ChromeRunnerInterface

type ChromeRunnerInterface interface {
	GeneratePDFData() (buf []byte, err error)
}

type File

type File struct {
	Filename string
}

File handles writing the PDF to disk, and implements the io.Writer interface

func (*File) Write

func (f *File) Write(p []byte) (n int, err error)

Write the File to disk

type FromURIGenerator

type FromURIGenerator struct {
	ChromeRunner ChromeRunnerInterface
	FileWriter   io.Writer
}

FromURIGenerator represents a PDF writer that takes a URI as its input

func (*FromURIGenerator) Generate

func (fromURIGenerator *FromURIGenerator) Generate() error

Jump to

Keyboard shortcuts

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