2014-09-19 60 views
1

我想要創建一個PDF文件,該文件應該包含一個表格,並在此表格下包含三個圖像;圖像應該有一個水平佈局(它們應該在同一條線上)。 如何對齊MigraDoc中的三個圖像? 如果我以這種方式在MigraDoc中對齊圖像

document.LastSection.AddImage("path1"); 
    document.LastSection.AddImage("path2"); 
    document.LastSection.AddImage("path2"); 

添加圖片我獲得與桌下垂直佈局三個圖像。 如果我使用的

document.LastSection.AddImage("...") 

document.LastSection.LastParagraph.AddImage("..."); 

,而不是我解決這個問題,但是我介紹一個新的問題。 我添加的表格使用

var table1 = new Table(); 
    ..... 
    document.LastSection.Add(table1); 

出現在三個圖像下。

我能做些什麼來獲得表格和表格下的三個水平佈局的圖像?

+0

你需要使用migradoc還是可以使用itextsharp?只是我知道itext,可以幫助它,但不會與migradoc。 – ZoomVirus 2014-09-19 13:43:05

+0

Migradoc,無論如何謝謝你 – MartinaLabMath 2014-09-19 13:48:52

回答

3

var para=document.LastSection.AddParagraph();然後調用para.AddImage(...);將三個圖像添加到一個段落?

MigraDoc是動態的 - 而document.LastSection.LastParagraph顯然返回表格前的最後一段。爲了解決這個問題,只需在表格後添加一段,然後將圖像添加到該段落。

+0

它解決了這個問題,謝謝。 – MartinaLabMath 2014-09-23 10:36:29