2016-09-28 61 views
-1

我試圖修改現有的PDF,並希望在一個Table in PDF放置文本的PDF

我想下面的代碼頂部添加新的文本:

ColumnText ct = new ColumnText(); 
      // write the text in the pdf content 
      cb.BeginText(); 
      Phrase p = new Phrase(BrokerName);    
      ct.SetSimpleColumn(p, lxValue, lyValue, uxValue, uyValue, leadingValue, textAlign); 

但是當試圖用新的文本編輯PDF。我可以插入新的文本,但它在表格下方顯示,如下圖所示。

Because Body section of table is encrypted. So I is it possible to Edit/Remove that portion? 
+0

你在哪裏得到您的值LX,LY,UX,UY? –

回答

1

我假設你cb是你使用它的方法GetUnderContent(int pageNum)PdfStamper檢索PdfContentByte實例。

正如方法名GetUnderContent已經表明,它是有已經存在的東西在添加內容,如果現有的內容不透明佔地面積,你不會看到你的補充。

如果要添加新的內容以上現有的內容,你應該使用GetOverContent(int pageNum)而不是返回的PdfContentByte實例。


如果上述假設是錯誤的,請擴展您的問題提供足夠的信息,而無需猜測回答...