ststeiger / PdfSharpCore

Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
Other
1.08k stars 237 forks source link

Solution for margins : DrawString and XStringFormat #397

Open tossnet opened 1 year ago

tossnet commented 1 year ago

Hi, How can I add an inner margin with DrawString? Currently you can only use TopLeft alignment.

"Error: System.ArgumentException: Only TopLeft alignment is currently implemented. at PdfSharpCore.Drawing.Layout.XTextFormatter.DrawString(String text, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format)"

image

image