我想创建一个应该包含一个表的PDF文件,在这个表下面有三个图像; 图像应该有一个水平布局(它们应该在同一条线上).如何在MigraDoc中对齐三幅图像?如果我以这种方式添加图像
document.LastSection.AddImage("path1");
document.LastSection.AddImage("path2");
document.LastSection.AddImage("path2");
Run Code Online (Sandbox Code Playgroud)
我在桌子下面获得了三张垂直布局的图像.如果我使用
document.LastSection.LastParagraph.AddImage("...");
Run Code Online (Sandbox Code Playgroud)
代替
document.LastSection.AddImage("...")
Run Code Online (Sandbox Code Playgroud)
我解决了这个问题但是我引入了一个新问题.我添加的表格
var table1 = new Table();
.....
document.LastSection.Add(table1);
Run Code Online (Sandbox Code Playgroud)
出现在三张图片下面.
我该怎么做才能获得桌子和桌子下面的水平布局三幅图像?
如何var para=document.LastSection.AddParagraph();然后调用para.AddImage(...);将三个图像添加到一个段落?
MigraDoc是动态的 - document.LastSection.LastParagraph显然会返回表格前的最后一段.要解决此问题,只需在表格后面添加一个段落,然后将图像添加到此段落中.