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

V2 example crash. #345

Closed
MiyamuraMiyako opened this issue Oct 14, 2023 · 2 comments
Closed

V2 example crash. #345

MiyamuraMiyako opened this issue Oct 14, 2023 · 2 comments

Comments

@MiyamuraMiyako
Copy link

Describe the bug
图片

To Reproduce

Related code:

import (
	"log"

	"github.com/johnfercher/maroto/v2"
	"github.com/johnfercher/maroto/v2/pkg/components/text"
	"github.com/johnfercher/maroto/v2/pkg/config"
	"github.com/johnfercher/maroto/v2/pkg/props"
)

func C() {
	cfg := config.NewBuilder().
		WithPageNumber("Page {current} of {total}", props.South).
		Build()

	mrt := maroto.New(cfg)
	m := maroto.NewMetricsDecorator(mrt)

	m.AddRows(
		text.NewRow(20, "Main features", props.Text{Size: 15, Top: 6.5}),
	)

	document, err := m.Generate()
	if err != nil {
		log.Fatal(err.Error())
	}

	err = document.Save("docs/assets/pdf/v2.pdf")
	if err != nil {
		log.Fatal(err.Error())
	}

	err = document.GetReport().Save("docs/assets/text/v2.txt")
	if err != nil {
		log.Fatal(err.Error())
	}
}

Expected behavior

Stacktrace

Additional details (please complete the following information):

  • OS: Win 11 x64 22H2
  • Python Version []
  • HEAD Commit hash []

Additional context

@johnfercher
Copy link
Owner

johnfercher commented Oct 17, 2023

Try the new version v2.0.0-alpha.41

@MiyamuraMiyako
Copy link
Author

Ok, solved, Thank you~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants