Skip to content

Commit

Permalink
Add Zugferd Opt
Browse files Browse the repository at this point in the history
  • Loading branch information
apardods committed Dec 20, 2024
1 parent da7011e commit c288bf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions goblhtml.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ func WithEmbeddedStylesheets() Option {
}
}

// WithZugferd adds the Zugferd XMP metadata to the HTML document.
func WithZugferd() Option {
return func(o *internal.Opts) {
o.Zugferd = true
}
}

// Render takes the GOBL envelope and attempts to render an HTML document
// from it.
func Render(ctx context.Context, env *gobl.Envelope, opts ...Option) ([]byte, error) {
Expand Down
2 changes: 2 additions & 0 deletions internal/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type Opts struct {
// are contained inside the HTML output. This is useful for PDF
// output or to avoid additional requests.
EmbedStylesheets bool
// Zugferd when true, adds the Zugferd XMP metadata to the PDF.
Zugferd bool
}

// WithOptions prepares the context with the options to use.
Expand Down

0 comments on commit c288bf7

Please sign in to comment.