nimpdf
nimpdf copied to clipboard
Only first page have content
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:
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
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.
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!