pdf

package
v0.0.0-...-54be6e2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package PDF contains functionality to draw data onto a PDF and render said PDF to a file or string buffer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoFpdf

type GoFpdf struct {
	// contains filtered or unexported fields
}

func NewGoFpdf

func NewGoFpdf(l layouts.Layout) (pdf *GoFpdf)

NewGoFpdf generates a new layout based on a Layout interface and uses the jung-kurt/gofpdf library to process all the information.

func (*GoFpdf) Bytes

func (f *GoFpdf) Bytes(buffer *bytes.Buffer) []byte

Bytes sends back a buffer of bytes which can be used to stream to a webpage.

func (*GoFpdf) Document

func (f *GoFpdf) Document() documents.Document

Document returns the actual PDF Document instance which is responsible for rendering all the blocks on the page.

func (GoFpdf) Layout

func (f GoFpdf) Layout() layouts.Layout

Layout returns the current layout that is used to render the PDF document.

func (*GoFpdf) LoadFonts

func (f *GoFpdf) LoadFonts(name string, styles map[string]string)

AddFont adds a font to the PDF.

type Pdf

type Pdf interface {
	Bytes(buffer *bytes.Buffer) []byte
	LoadFonts(name string, styles map[string]string)
	Layout() layouts.Layout
	Document() documents.Document
}

Pdf houses all the wrapper functionality about our actual PDF instance. It has a Document which it uses to wrypte all the data to and render the pages. The Layout represents the page layout.

Jump to

Keyboard shortcuts

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