0

I have an app that prints very small labels.

One thing I have noticed is that the printing (using DrawString with a rectangle) aligns text based on the TOP of the font ascender size. So when there are 2 font sizes on a line, you get this. Top Alignment Issue

The PrintDocument object apparently has no ability to do line spacing or vertical alignment.

In other words I guess I need to calculate all that myself.

My main question is:

Is there another object I should be using where I can align text on the baseline, and "tighten" the vertical spacing to prevent my content from overrunning the labels? You know, like Word and LibreOffice?

Libre Office Paragraph Settings

Or do I have to reverse engineer it all in my code.

Some_Yahoo
  • 509
  • 6
  • 9
  • 2
    It is not really an aspect of `PrintDocument` as it is just the "document" holder, its more related to `DrawString ` which has multiple layout and formatting options beyond the layout rect. You should post your code so we can see what the starting point is – Ňɏssa Pøngjǣrdenlarp Aug 30 '19 at 20:01
  • The notes here: [Properly draw text using Graphics Path](https://stackoverflow.com/a/53074638/7444103) and here: [I want to remove padding from top and bottom (...)](https://stackoverflow.com/a/54383828/7444103) may help. – Jimi Aug 30 '19 at 20:03
  • You will ned to calculate the baseline offset. There are posts that decribe how to do that.. – TaW Aug 30 '19 at 20:10
  • Thanks for the rapid answers. Any opinions on using the FixedDocument and FlowDocument objects? – Some_Yahoo Aug 30 '19 at 22:37

0 Answers0