empira / PDFsharp-1.5

A .NET library for processing PDF
MIT License
1.28k stars 589 forks source link

XTextFormatter vertical alignment support #132

Closed bradlis7 closed 1 year ago

bradlis7 commented 4 years ago

I can't find an issue to document this request, though I'm sure it's known.

https://github.com/empira/PDFsharp/blob/3205bd933b464d150c0f42e8bcdff3314b6c6164/src/PdfSharp/Drawing.Layout/XTextFormatter.cs#L141

Expected Behavior

Full alignment support. Currently, horizontal alignment is possible with the XTextFormatter.Alignment, but there doesn't seem to be a way to specify the vertical alignment within the box. I need both text wrapping and vertical alignment support.

Actual Behavior

Error is thrown if you don't use XStringFormats.Center.

bradlis7 commented 4 years ago

Looks like there was a rejected PR (#106). Not sure why this isn't something that can be included in the project, but if you want to close this, others can take the PR changes and implement them in the current XTextFormatter class.

ThomasHoevel commented 1 year ago

The XTextFormatter class is meant to get you started and will not be enhanced. Enhanced versions can be found on the forum: https://forum.pdfsharp.net/viewtopic.php?f=8&t=3192