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

Metadata such as title, author, creator not set #485

Closed
vljukap98 opened this issue Oct 14, 2024 · 1 comment · Fixed by #486
Closed

Metadata such as title, author, creator not set #485

vljukap98 opened this issue Oct 14, 2024 · 1 comment · Fixed by #486
Labels
bug Something isn't working help wanted Extra attention is needed v2 will be solved in v2

Comments

@vljukap98
Copy link

Describe the bug
When creating the configuration with the Builder provided in the config package and using it to add title, author, creator, subject and creation date to the document in combination with concurrent mode and sequential low memory mode, output pdf doesn't contain set metadata. When I don't use the concurrent mode or sequential low memory mode, all above is set except for the creation date (I've not managed to set creation date in any way).

To Reproduce
Steps to reproduce the behavior:

  1. Run the code provided below (Related code section)
  2. Open test.pdf with any viewer (e.g. I used Mozilla's Firefox)
  3. Open properties
  4. Properties set (author, creator, subject, title) are empty

Related code:

func main() {
	m := getMaroto()
	document, err := m.Generate()
	if err != nil {
		log.Fatal(err.Error())
	}
	err = document.Save("test.pdf")
	if err != nil {
		log.Fatal(err.Error())
	}
}

func getMaroto() core.Maroto {
	cfg := config.NewBuilder().
		WithConcurrentMode(7).
		WithSequentialLowMemoryMode(7).
		WithTitle("custom_title", false).
		WithAuthor("custom_author", false).
		WithCreator("custom_creator", false).
		WithSubject("custom_subject", false).
		WithCreationDate(time.Now()).
		Build()

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

	m.AddRows(
		text.NewRow(30, "metadatas"),
	)

	return m
}

Expected behavior
Properties should contain set data. I managed to set it without using WithConcurrentMode(7) and WithSequentialLowMemoryMode(7).
image
Still creation date remains empty.

Stacktrace

Additional details (please complete the following information):

  • OS: Ubuntu 24.04.1
  • Maroto version 2.1.5

Additional context

@johnfercher johnfercher added bug Something isn't working help wanted Extra attention is needed v2 will be solved in v2 labels Oct 14, 2024
@Fernando-hub527 Fernando-hub527 linked a pull request Oct 15, 2024 that will close this issue
10 tasks
@Fernando-hub527
Copy link
Collaborator

Hello!
PR has been opened. I believe a fix will be available soon !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed v2 will be solved in v2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants