Documentation
¶
Overview ¶
Package paper builds PDF documents from a grid of rows and columns.
A document is assembled by adding rows to a Paper instance and then calling Generate. Components such as text, images, barcodes, and signatures are placed into columns, which share a fixed number of grid units per row. HTML input is supported through FromHTML and its variants.
Index ¶
- Variables
- func FromHTML(ctx context.Context, htmlStr string, cfgs ...*entity.Config) (*core.Pdf, error)
- func FromHTMLReader(ctx context.Context, r io.Reader, cfgs ...*entity.Config) (*core.Pdf, error)
- func FromHTMLWithOptions(ctx context.Context, htmlStr string, opts []html.Option, ...) (*core.Pdf, error)
- type Paper
- func (m *Paper) AddAnnotation(annotation entity.PageAnnotation)
- func (m *Paper) AddAttachment(attachment entity.FileAttachment)
- func (m *Paper) AddAutoRow(cols ...core.Col) core.Row
- func (m *Paper) AddHTML(ctx context.Context, htmlStr string) error
- func (m *Paper) AddHighlight(pageIndex int, rect [4]float64, color [3]float64, quadPoints [][8]float64)
- func (m *Paper) AddInternalLinkAnnotation(pageIndex int, rect [4]float64, destName string)
- func (m *Paper) AddLinkAnnotation(pageIndex int, rect [4]float64, uri string)
- func (m *Paper) AddNamedDestination(destination entity.NamedDestination)
- func (m *Paper) AddPageLinkAnnotation(pageIndex int, rect [4]float64, destPage int)
- func (m *Paper) AddPages(pages ...core.Page)
- func (m *Paper) AddRow(rowHeight float64, cols ...core.Col) core.Row
- func (m *Paper) AddRows(rows ...core.Row)
- func (m *Paper) AddSquiggly(pageIndex int, rect [4]float64, color [3]float64, quadPoints [][8]float64)
- func (m *Paper) AddStrikeOut(pageIndex int, rect [4]float64, color [3]float64, quadPoints [][8]float64)
- func (m *Paper) AddTextAnnotation(pageIndex int, rect [4]float64, text, icon string)
- func (m *Paper) AddTextAnnotationOpen(pageIndex int, rect [4]float64, text, icon string)
- func (m *Paper) AddTextMarkup(pageIndex int, markupType entity.MarkupType, rect [4]float64, color [3]float64, ...)
- func (m *Paper) AddUnderline(pageIndex int, rect [4]float64, color [3]float64, quadPoints [][8]float64)
- func (m *Paper) FitInCurrentPage(heightNewLine float64) bool
- func (m *Paper) Generate(ctx context.Context) (*core.Pdf, error)
- func (m *Paper) GetCurrentConfig() *entity.Config
- func (m *Paper) GetStructure() *node.Node[core.Structure]
- func (m *Paper) RegisterFooter(rows ...core.Row) error
- func (m *Paper) RegisterHeader(rows ...core.Row) error
- func (m *Paper) SetAcroForm(form *entity.AcroForm)
- func (m *Paper) SetArtBox(pageIndex int, box [4]float64)
- func (m *Paper) SetBleedBox(pageIndex int, box [4]float64)
- func (m *Paper) SetCropBox(pageIndex int, box [4]float64)
- func (m *Paper) SetDeterministic(deterministic bool)
- func (m *Paper) SetFileID(id []byte)
- func (m *Paper) SetLanguage(language string)
- func (m *Paper) SetPageGeometry(geometry entity.PageGeometry)
- func (m *Paper) SetPageLabels(labels ...entity.PageLabelRange)
- func (m *Paper) SetPageRotation(pageIndex, degrees int)
- func (m *Paper) SetPdfA(config entity.PdfAConfig)
- func (m *Paper) SetTagged(enabled bool)
- func (m *Paper) SetTrimBox(pageIndex int, box [4]float64)
- func (m *Paper) SetViewerPreferences(prefs entity.ViewerPreferences)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrCannotGenerateInLowMemoryMode = errors.New("an error has occurred while trying to generate PDFs in low memory mode") ErrCannotGenerateInParallelMode = errors.New("an error has occurred while trying to generate PDFs concurrently") ErrHeaderHeightIsGreaterThanUsefulArea = errors.New("header height is greater than page useful area") // ErrHTMLHeaderAfterContent is returned by AddHTML when the HTML contains // a top-level <header>/<footer> but the document already has rows or a // registered header/footer: late registration would not reserve space on // already-built pages. ErrHTMLHeaderAfterContent = errors.New("html top-level header/footer must be added before any other content") )
Errors reported while generating a document.
Functions ¶
func FromHTML ¶
FromHTML converts an HTML string directly into a PDF document. It is the shortest path for callers that only need HTML-to-PDF output. It observes ctx while parsing/translating HTML and while generating the PDF. Optional configs are the same configs accepted by New.
When no config argument is given, a plain `@page { size; margin }` rule in the HTML configures the page; an explicit config argument disables @page handling entirely (documented precedence rule, no field-level merging).
Example ¶
ExampleFromHTML demonstrates the shortest path from HTML to PDF.
package main
import (
"context"
"log"
"github.com/avdoseferovic/paper"
)
func main() {
doc, err := paper.FromHTML(context.Background(), `<h1>Hello</h1><p>World</p>`)
if err != nil {
log.Fatal(err)
}
_ = doc.GetBytes()
}
Output:
func FromHTMLReader ¶
FromHTMLReader reads HTML from r and converts it directly into a PDF document. It observes ctx before and after reading, while translating HTML, and while generating the PDF. Optional configs are the same configs accepted by New.
func FromHTMLWithOptions ¶ added in v0.2.2
func FromHTMLWithOptions(ctx context.Context, htmlStr string, opts []html.Option, cfgs ...*entity.Config) (*core.Pdf, error)
FromHTMLWithOptions is FromHTML with additional html conversion options (e.g. html.WithImageBaseDir, html.WithStrictAssets) appended to the config-derived defaults.
Types ¶
type Paper ¶
type Paper struct {
// contains filtered or unexported fields
}
Paper builds a document. Add rows to it, then call Generate to produce the PDF.
func New ¶
New creates a concrete Paper instance. It's optional to provide an *entity.Config with customizations those customization are created by using the config.Builder.
Example ¶
ExampleNew demonstrates how to create a paper instance.
package main
import (
"context"
"github.com/avdoseferovic/paper"
"github.com/avdoseferovic/paper/pkg/config"
)
func main() {
// optional
b := config.NewBuilder()
cfg := b.Build()
m := paper.New(cfg) // cfg is an optional
// Do things and generate
_, _ = m.Generate(context.Background())
}
Output:
func (*Paper) AddAnnotation ¶ added in v0.2.2
func (m *Paper) AddAnnotation(annotation entity.PageAnnotation)
AddAnnotation adds a page annotation to the generated PDF.
func (*Paper) AddAttachment ¶ added in v0.2.2
func (m *Paper) AddAttachment(attachment entity.FileAttachment)
AddAttachment embeds a file in the generated PDF.
func (*Paper) AddAutoRow ¶
AddAutoRow is responsible for adding a line with automatic height to the current document. The row height will be calculated based on its content.
func (*Paper) AddHTML ¶
AddHTML parses an HTML string into Paper rows and adds them to the current document. It observes ctx while parsing and translating the HTML. Headers, footers, and pagination continue to work as with manually constructed rows. For advanced options (e.g. html.WithImageBaseDir for safe <img> loading), call html.FromString directly and append the returned rows via m.AddRows(rows...). Supported HTML subset is documented in docs/html-support.md.
func (*Paper) AddHighlight ¶ added in v0.2.2
func (m *Paper) AddHighlight(pageIndex int, rect [4]float64, color [3]float64, quadPoints [][8]float64)
AddHighlight adds a highlight text-markup annotation.
func (*Paper) AddInternalLinkAnnotation ¶ added in v0.2.2
AddInternalLinkAnnotation adds an internal named-destination link annotation.
func (*Paper) AddLinkAnnotation ¶ added in v0.2.2
AddLinkAnnotation adds an external URI link annotation to a generated page.
func (*Paper) AddNamedDestination ¶ added in v0.2.2
func (m *Paper) AddNamedDestination(destination entity.NamedDestination)
AddNamedDestination defines a named location in the generated PDF.
func (*Paper) AddPageLinkAnnotation ¶ added in v0.2.2
AddPageLinkAnnotation adds an internal link annotation to a zero-based page index.
func (*Paper) AddPages ¶
AddPages is responsible for add pages directly in the document. By adding a page directly, the current cursor will reset and the new page will appear as the next. If the page provided have more rows than the maximum useful area of a page, paper will split that page in more than one.
Example ¶
ExamplePaper_AddPages demonstrates how to add a new page in paper.
package main
import (
"github.com/avdoseferovic/paper"
"github.com/avdoseferovic/paper/pkg/components/code"
"github.com/avdoseferovic/paper/pkg/components/page"
)
func main() {
m := paper.New()
p := page.New()
p.Add(code.NewBarRow(10, "barcode"))
m.AddPages(p)
// Do things and generate
}
Output:
func (*Paper) AddRow ¶
AddRow is responsible for add one row in the current document. By adding a row, if the row will extrapolate the useful area of a page, paper will automatically add a new page. Paper use the information of PageSize, PageMargin, FooterSize and HeaderSize to calculate the useful area of a page.
Example ¶
ExamplePaper_AddRow demonstrates how to add a new row in paper.
package main
import (
"github.com/avdoseferovic/paper/pkg/components/text"
"github.com/avdoseferovic/paper"
)
func main() {
m := paper.New()
m.AddRow(10, text.NewCol(12, "text"))
// Do things and generate
}
Output:
func (*Paper) AddRows ¶
AddRows is responsible for add rows in the current document. By adding a row, if the row will extrapolate the useful area of a page, paper will automatically add a new page. Paper use the information of PageSize, PageMargin, FooterSize and HeaderSize to calculate the useful area of a page.
Example ¶
ExamplePaper_AddRows demonstrates how to add new rows in paper.
package main
import (
"github.com/avdoseferovic/paper/pkg/components/text"
"github.com/avdoseferovic/paper"
"github.com/avdoseferovic/paper/pkg/components/code"
)
func main() {
m := paper.New()
m.AddRows(
code.NewBarRow(12, "barcode"),
text.NewRow(12, "text"),
)
// Do things and generate
}
Output:
func (*Paper) AddSquiggly ¶ added in v0.2.2
func (m *Paper) AddSquiggly(pageIndex int, rect [4]float64, color [3]float64, quadPoints [][8]float64)
AddSquiggly adds a squiggly text-markup annotation.
func (*Paper) AddStrikeOut ¶ added in v0.2.2
func (m *Paper) AddStrikeOut(pageIndex int, rect [4]float64, color [3]float64, quadPoints [][8]float64)
AddStrikeOut adds a strikeout text-markup annotation.
func (*Paper) AddTextAnnotation ¶ added in v0.2.2
AddTextAnnotation adds a sticky-note annotation to a generated page.
func (*Paper) AddTextAnnotationOpen ¶ added in v0.2.2
AddTextAnnotationOpen adds an initially open sticky-note annotation.
func (*Paper) AddTextMarkup ¶ added in v0.2.2
func (m *Paper) AddTextMarkup( pageIndex int, markupType entity.MarkupType, rect [4]float64, color [3]float64, quadPoints [][8]float64, )
AddTextMarkup adds a text-markup annotation to a generated page.
func (*Paper) AddUnderline ¶ added in v0.2.2
func (m *Paper) AddUnderline(pageIndex int, rect [4]float64, color [3]float64, quadPoints [][8]float64)
AddUnderline adds an underline text-markup annotation.
func (*Paper) FitInCurrentPage ¶
FitInCurrentPage reports whether a row of the given height fits in the remaining useful area of the current page.
Example ¶
ExamplePaper_FitInCurrentPage demonstrates how to check if the new line fits on the current page.
package main
import (
"github.com/avdoseferovic/paper"
)
func main() {
m := paper.New()
m.FitInCurrentPage(12)
// Do things and generate
}
Output:
func (*Paper) Generate ¶
Generate is responsible to compute the component tree created by the usage of all other Paper methods, and generate the PDF document. It observes ctx between pages and generation phases.
Example ¶
ExamplePaper_Generate demonstrates how to generate a file.
package main
import (
"context"
"log"
"github.com/avdoseferovic/paper"
)
func main() {
m := paper.New()
// Add rows, pages and etc.
doc, err := m.Generate(context.Background())
if err != nil {
log.Fatal(err)
}
// You can retrieve as Base64, Save file, Merge with another file or GetReport.
_ = doc.GetBytes()
}
Output:
func (*Paper) GetCurrentConfig ¶
GetCurrentConfig is responsible for returning the current settings from the file
Example ¶
ExamplePaper_GetCurrentConfig demonstrates how to get the current paper configuration.
package main
import (
"github.com/avdoseferovic/paper"
)
func main() {
m := paper.New()
m.GetCurrentConfig()
// Do things and generate
}
Output:
func (*Paper) GetStructure ¶
GetStructure is responsible for return the component tree, this is useful on unit tests cases.
Example ¶
ExamplePaperGetStruct demonstrates how to get paper component tree
package main
import (
"github.com/avdoseferovic/paper/pkg/components/text"
"github.com/avdoseferovic/paper"
)
func main() {
m := paper.New()
m.AddRow(40, text.NewCol(12, "text"))
m.GetStructure()
// Do things and generate
}
Output:
func (*Paper) RegisterFooter ¶
RegisterFooter is responsible to define a set of rows as a footer of the document. The footer will appear in every new page of the document. The footer cannot occupy an area greater than the useful area of the page, it this case the method will return an error.
func (*Paper) RegisterHeader ¶
RegisterHeader is responsible to define a set of rows as a header of the document. The header will appear in every new page of the document. The header cannot occupy an area greater than the useful area of the page, it this case the method will return an error.
Example ¶
ExamplePaper_RegisterHeader demonstrates how to register a header to me added in every new page. An error is returned if the area occupied by the header is greater than the page area.
package main
import (
"github.com/avdoseferovic/paper/pkg/components/text"
"github.com/avdoseferovic/paper"
"github.com/avdoseferovic/paper/pkg/components/code"
)
func main() {
m := paper.New()
err := m.RegisterHeader(
code.NewBarRow(12, "barcode"),
text.NewRow(12, "text"))
if err != nil {
panic(err)
}
// Do things and generate
}
Output:
func (*Paper) SetAcroForm ¶ added in v0.2.2
SetAcroForm attaches interactive form fields to the generated PDF. The form is cloned so later mutations of the input do not leak into the document.
func (*Paper) SetBleedBox ¶ added in v0.2.2
SetBleedBox sets a generated page BleedBox.
func (*Paper) SetCropBox ¶ added in v0.2.2
SetCropBox sets a generated page CropBox.
func (*Paper) SetDeterministic ¶ added in v0.2.2
SetDeterministic makes repeated builds of the same document byte-identical.
func (*Paper) SetFileID ¶ added in v0.2.2
SetFileID sets an explicit trailer /ID for the generated PDF.
func (*Paper) SetLanguage ¶ added in v0.2.2
SetLanguage sets the document language written to the catalog /Lang entry.
func (*Paper) SetPageGeometry ¶ added in v0.2.2
func (m *Paper) SetPageGeometry(geometry entity.PageGeometry)
SetPageGeometry configures generated PDF page dictionary geometry entries.
func (*Paper) SetPageLabels ¶ added in v0.2.2
func (m *Paper) SetPageLabels(labels ...entity.PageLabelRange)
SetPageLabels defines the labels viewers show instead of physical page numbers.
func (*Paper) SetPageRotation ¶ added in v0.2.2
SetPageRotation sets a generated page rotation in degrees.
func (*Paper) SetPdfA ¶ added in v0.2.2
func (m *Paper) SetPdfA(config entity.PdfAConfig)
SetPdfA configures PDF/A conformance metadata and output intent at runtime.
func (*Paper) SetTagged ¶ added in v0.2.2
SetTagged enables or disables tagged (accessible) PDF output at runtime.
func (*Paper) SetTrimBox ¶ added in v0.2.2
SetTrimBox sets a generated page TrimBox.
func (*Paper) SetViewerPreferences ¶ added in v0.2.2
func (m *Paper) SetViewerPreferences(prefs entity.ViewerPreferences)
SetViewerPreferences configures catalog viewer hints at runtime.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
docs
module
|
|
|
examples
module
|
|
|
internal
|
|
|
assert
Package assert provides lightweight test assertions used by the root module.
|
Package assert provides lightweight test assertions used by the root module. |
|
cache
Package cache stores image bytes that have already been read from disk, so a document that reuses the same image does not read it again.
|
Package cache stores image bytes that have already been read from disk, so a document that reuses the same image does not read it again. |
|
cmd/mockfix
command
Command mockfix rewrites generated mocks in internal/mocks so they import the vendored mock runtime (internal/mocktest) instead of testify.
|
Command mockfix rewrites generated mocks in internal/mocks so they import the vendored mock runtime (internal/mocktest) instead of testify. |
|
code
Package code generates barcode images: linear (Code 128), QR, and Data Matrix.
|
Package code generates barcode images: linear (Code 128), QR, and Data Matrix. |
|
cssparse
Package cssparse provides the small, bounded CSS rule/declaration parser shared by Paper's HTML and SVG renderers.
|
Package cssparse provides the small, bounded CSS rule/declaration parser shared by Paper's HTML and SVG renderers. |
|
dependency
Package dependency holds the guard test that keeps the root module free of third-party imports.
|
Package dependency holds the guard test that keeps the root module free of third-party imports. |
|
fixture
Package fixture provides pre-filled entities and props for tests, so test cases only have to state the fields they actually care about.
|
Package fixture provides pre-filled entities and props for tests, so test cases only have to state the fields they actually care about. |
|
goleak
Package goleak provides a small goroutine leak check for this repository's tests.
|
Package goleak provides a small goroutine leak check for this repository's tests. |
|
htmllimits
Package htmllimits holds the size limits applied when rendering HTML, such as maximum image and stylesheet sizes.
|
Package htmllimits holds the size limits applied when rendering HTML, such as maximum image and stylesheet sizes. |
|
imagecodec
Package imagecodec converts images into a form the PDF writer can embed, decoding the source bytes and re-encoding them when the original format is not directly supported.
|
Package imagecodec converts images into a form the PDF writer can embed, decoding the source bytes and re-encoding them when the original format is not directly supported. |
|
layout
Package layout turns column weights into whole grid units and applies cell margins.
|
Package layout turns column weights into whole grid units and applies cell margins. |
|
listnum
Package listnum formats the CSS numbering systems shared by list markers (<ol>) and CSS counters (counter(), counters()).
|
Package listnum formats the CSS numbering systems shared by list markers (<ol>) and CSS counters (counter(), counters()). |
|
math
Package math resizes inner dimensions to fit inside outer ones while keeping the original aspect ratio.
|
Package math resizes inner dimensions to fit inside outer ones while keeping the original aspect ratio. |
|
merror
Package merror holds the default text style used to draw error messages onto a generated page.
|
Package merror holds the default text style used to draw error messages onto a generated page. |
|
mocktest
Package mock provides the small mock API subset used by generated internal test mocks.
|
Package mock provides the small mock API subset used by generated internal test mocks. |
|
pdf
Package pdf contains Paper's internal PDF runtime.
|
Package pdf contains Paper's internal PDF runtime. |
|
pdfscan
Package pdfscan holds a minimal byte scanner for the subset of PDF syntax that paper's reader, form filler and signer need in order to walk object dictionaries in place, without building a full object model.
|
Package pdfscan holds a minimal byte scanner for the subset of PDF syntax that paper's reader, form filler and signer need in order to walk object dictionaries in place, without building a full object model. |
|
pngcodec
Package pngcodec encodes PNG images with pooled encoder state.
|
Package pngcodec encodes PNG images with pooled encoder state. |
|
providers
Package providers contains repository-wide provider guard tests.
|
Package providers contains repository-wide provider guard tests. |
|
providers/paper
Package paper implements the drawing provider that the document builder calls into.
|
Package paper implements the drawing provider that the document builder calls into. |
|
providers/paper/cellwriter
Package cellwriter draws the background and border of a single cell.
|
Package cellwriter draws the background and border of a single cell. |
|
require
Package require provides fail-fast test assertions used by the root module.
|
Package require provides fail-fast test assertions used by the root module. |
|
svg
Package svg provides pure-Go SVG rasterisation helpers for PDF embedding.
|
Package svg provides pure-Go SVG rasterisation helpers for PDF embedding. |
|
test
Package test compares a generated document tree against a stored JSON snapshot, and reports the first field that differs.
|
Package test compares a generated document tree against a stored JSON snapshot, and reports the first field that differs. |
|
time
Package time measures how long a closure takes to run and reports it as a metrics.Time value.
|
Package time measures how long a closure takes to run and reports it as a metrics.Time value. |
|
pkg
|
|
|
barcode
Package barcode provides named barcode constructors over Paper's component model.
|
Package barcode provides named barcode constructors over Paper's component model. |
|
components/checkbox
Package checkbox implements creation of checkboxes.
|
Package checkbox implements creation of checkboxes. |
|
components/code
Package code implements creation of Barcode, MatrixCode and QrCode.
|
Package code implements creation of Barcode, MatrixCode and QrCode. |
|
components/col
Package col implements creation of columns.
|
Package col implements creation of columns. |
|
components/html
Package html implements a component wrapper for Paper's HTML translator.
|
Package html implements a component wrapper for Paper's HTML translator. |
|
components/htmllist
Package htmllist implements HTML-style bullet and numbered list components.
|
Package htmllist implements HTML-style bullet and numbered list components. |
|
components/image
Package image implements creation of images from file and bytes.
|
Package image implements creation of images from file and bytes. |
|
components/line
Package line implements creation of lines.
|
Package line implements creation of lines. |
|
components/list
Package list implements creation of lists (old tablelist).
|
Package list implements creation of lists (old tablelist). |
|
components/page
Package page implements creation of pages.
|
Package page implements creation of pages. |
|
components/richtext
Package richtext implements a PDF component for paragraphs with mixed inline styling.
|
Package richtext implements a PDF component for paragraphs with mixed inline styling. |
|
components/row
Package row implements creation of rows.
|
Package row implements creation of rows. |
|
components/signature
Package signature implements creation of signatures.
|
Package signature implements creation of signatures. |
|
components/table
Package table implements a PDF table component with colspan, rowspan, and per-cell styling.
|
Package table implements a PDF table component with colspan, rowspan, and per-cell styling. |
|
components/text
Package text implements creation of texts.
|
Package text implements creation of texts. |
|
config
Package config implements custom configuration builder.
|
Package config implements custom configuration builder. |
|
consts
Package consts groups the small enumeration types used across Paper: alignment, orientation, line styles, break-line strategies, font families, barcode types, generation modes, and provider types.
|
Package consts groups the small enumeration types used across Paper: alignment, orientation, line styles, break-line strategies, font families, barcode types, generation modes, and provider types. |
|
consts/border
Package border contains all border types.
|
Package border contains all border types. |
|
consts/extension
Package extension contains all image extensions.
|
Package extension contains all image extensions. |
|
consts/fontstyle
Package fontstyle contains all default font styles.
|
Package fontstyle contains all default font styles. |
|
consts/pagesize
Package pagesize contains all default page sizes.
|
Package pagesize contains all default page sizes. |
|
consts/protection
Package protection contains all protection types.
|
Package protection contains all protection types. |
|
core
Package core contains all core interfaces and basic implementations.
|
Package core contains all core interfaces and basic implementations. |
|
core/entity
Package entity contains all core entities.
|
Package entity contains all core entities. |
|
decorator
Package decorator provides decorators over the core.Paper interface.
|
Package decorator provides decorators over the core.Paper interface. |
|
fontrepository
Package fontrepository implements font repository.
|
Package fontrepository implements font repository. |
|
forms
Package forms provides AcroForm support for generated Paper PDFs.
|
Package forms provides AcroForm support for generated Paper PDFs. |
|
html
Package html converts HTML strings into Paper rows so they can be added to a Paper document.
|
Package html converts HTML strings into Paper rows so they can be added to a Paper document. |
|
html/css
Package css parses CSS declarations and resolves them into a ComputedStyle that the HTML translator can read.
|
Package css parses CSS declarations and resolves them into a ComputedStyle that the HTML translator can read. |
|
html/dom
Package dom provides a Paper-friendly wrapper over golang.org/x/net/html.
|
Package dom provides a Paper-friendly wrapper over golang.org/x/net/html. |
|
html/translate
Package translate converts a parsed HTML DOM into a slice of Paper rows.
|
Package translate converts a parsed HTML DOM into a slice of Paper rows. |
|
image
Package image provides standalone image decoding helpers that can be adapted into Paper image components.
|
Package image provides standalone image decoding helpers that can be adapted into Paper image components. |
|
merge
Package merge implements PDF merge.
|
Package merge implements PDF merge. |
|
metrics
Package metrics contains metrics models, constants and formatting.
|
Package metrics contains metrics models, constants and formatting. |
|
props
Package props contain the public properties of paper.
|
Package props contain the public properties of paper. |
|
reader
Package reader parses existing PDF files and exposes basic page metadata, content streams, text extraction, and merge conveniences.
|
Package reader parses existing PDF files and exposes basic page metadata, content streams, text extraction, and merge conveniences. |
|
sign
Package sign provides signing primitives used by PDF signature workflows.
|
Package sign provides signing primitives used by PDF signature workflows. |
|
svg
Package svg parses SVG markup and adapts it to Paper components.
|
Package svg parses SVG markup and adapts it to Paper components. |
|
test
Package test exposes Paper's golden-structure test helper for library consumers.
|
Package test exposes Paper's golden-structure test helper for library consumers. |
|
tmpl
Package tmpl renders Go html/templates through Paper's HTML-to-PDF pipeline.
|
Package tmpl renders Go html/templates through Paper's HTML-to-PDF pipeline. |
|
tree/node
Package node provides a small generic tree node used to describe Paper document structure.
|
Package node provides a small generic tree node used to describe Paper document structure. |