Closed laice closed 5 years ago
I'm having a hard time understanding the output I'm getting - mainly the way newlines and page breaks work.
I don't understand your results either. When I ran your code (using the Deja Vu Font instead of the agency font which I don't have) the newlines are placed right where they should be. You may want to try the Deja Vu font to see if there is a change.
Unfortunately unless I'm mistaken the Deja Vu fonts don't offer the same thin styled font that Agency FB is, it allows fitting more information in the same space, which is at a premium in my use case. Thank you for making me aware this is part of the problem space, however
I did find a Deja Vu Serif Condensed, but it's not quite small enough - for example the Total THC line fits on one line in Agency FB. Is there something special about these extra thin fonts? Guess I'll look into that. Also, I guess newlines are being made into page breaks? Here's my output with the same code but the font changed to Deja Vu Serif Condensed
Is there something special about these extra thin fonts?
I wouldn't think so, but it's worth a look.
Also, I guess newlines are being made into page breaks?
No. I think because of the really small page size you are running into the 2 cm default page break margin. Note that pdf.SetMargins()
only sets the left, top, and right margins. The bottom margin is specified separately because it is used for automatic page breaking. See SetAutoPageBreak()
. You may want to disable automatic page breaks entirely and keep track of positions manually.
If you are looking for text that is very thin, you may want to try using the TransformScaleY()
method to stretch text vertically.
Please reopen if this is still an issue
Hi, I'm having a hard time understanding the output I'm getting - mainly the way newlines and page breaks work. Why does this page break to the next page? Why does it seem like sometimes newline works and sometimes it doesn't? I've also tried multiple calls to WriteAligned instead of concatenating strings, but I still get confusing output with page breaks that I don't understand. Thanks for any advice.
Example output:![gofpdf_output](https://user-images.githubusercontent.com/1814384/57564123-0a67a800-7364-11e9-9176-3dfb80622053.PNG)
`
`