【问题标题】:Migradoc setting an image next to textMigradoc 在文本旁边设置图像
【发布时间】:2015-06-15 22:11:06
【问题描述】:

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

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;

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

p.Format.Linespacing = -10;

image.WrapFormat.DistanceTop = -10;

这些设置不起作用。

【问题讨论】:

    标签: image pdf pdf-generation pdfsharp migradoc


    【解决方案1】:

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

    p.Format.SpaceBefore = - 20;
    

    【讨论】:

      猜你喜欢
      • 2016-01-06
      • 1970-01-01
      • 2015-06-15
      • 1970-01-01
      • 2013-05-10
      • 2021-05-06
      • 2016-12-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多