Migradoc 在文本旁边设置图像

dar*_*e2k 1 pdf pdf-generation image pdfsharp migradoc

我想在表格单元格中的某些文本的右侧浮动图像。

cell.AddParagraph("some text");
cell.AddParagraph("next line other text");

Paragraph p = cell.AddParagraph();
p.Format.Alignment = ParagraphAlignment.Right;
p.Format.RightIndent = 12;
Image image = p.AddImage("image.png");
image.ScaleWidth = 0.07;
Run Code Online (Sandbox Code Playgroud)

此代码将图像放在右侧,但我无法将其向上移动。

p.Format.Linespacing = -10;

image.WrapFormat.DistanceTop = -10;
Run Code Online (Sandbox Code Playgroud)

这些设置不起作用。

dar*_*e2k 5

可以使用 SpaceBefore 和 SpaceAfter 来向上或向下移动元素。在这种情况下:

p.Format.SpaceBefore = - 20;
Run Code Online (Sandbox Code Playgroud)