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

Only first page have content #43

Open
ghost opened this issue Dec 19, 2023 · 3 comments
Open

Only first page have content #43

ghost opened this issue Dec 19, 2023 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 19, 2023

When trying to write text or content to any pages in a document after page 1, the pages turn out blank. I tried compiling the "pagelabels.nim" example file as well, having the same problem. The labels work as expected.

Using Nim 2.0.0 and nimPDF 0.4.3.

I have tried compiling the code on multiple computers, both running Debian 12, and tried opening the PDF's with both zathura and Brave.

Screenshot of zathura, PDF exported with pagelabels.nim:

1
2

@ThomasTJdev
Copy link
Contributor

You can see the raw output in the demo/ folder: https://github.com/jangko/nimpdf/blob/master/demo/pagelabels.pdf

Try with this to write text on specific pages: https://github.com/jangko/nimpdf/blob/master/demo/change_page.nim

@ghost
Copy link
Author

ghost commented Dec 19, 2023

Oh i see now that it's empty there aswell. I find it weird considering drawText() is used on the other pages aswell?

change_page.nim compiled without errors, so i'll change some of my code and give an update when i have tried it.

@ghost
Copy link
Author

ghost commented Dec 19, 2023

I located the issue now. I didn't set a font after adding a new page, only after adding the first page with doc.setFont(...).

It seems a bit counter intuitive having to specify the font for the doc variable each time after adding a page, but making a new proc with addPage() as well as setFont() works fine though.

Thanks for the quick reply!

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

1 participant