Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/metadata not set #486

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions maroto.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ func (m *Maroto) RegisterFooter(rows ...core.Row) error {
// Generate is responsible to compute the component tree created by
// the usage of all other Maroto methods, and generate the PDF document.
func (m *Maroto) Generate() (core.Document, error) {
m.provider.SetProtection(m.config.Protection)
m.provider.SetCompression(m.config.Compression)
m.provider.SetMetadata(m.config.Metadata)

m.fillPageToAddNew()
m.setConfig()

Expand Down Expand Up @@ -392,5 +388,9 @@ func getConfig(configs ...*entity.Config) *entity.Config {

func getProvider(cache cache.Cache, cfg *entity.Config) core.Provider {
deps := gofpdf.NewBuilder().Build(cfg, cache)
return gofpdf.New(deps)
provider := gofpdf.New(deps)
provider.SetMetadata(cfg.Metadata)
provider.SetCompression(cfg.Compression)
provider.SetProtection(cfg.Protection)
return provider
}
Loading