2011-03-07 27 views

回答

2

用黑色字體創建矩形文本區域:

Dim PDFDoc As WebSupergoo.ABCpdf8.Doc 

'Dimensions 
PDFDoc.Rect.Left =100 
PDFDoc.Rect.Bottom = 100 
PDFDoc.Rect.Width = 100 
PDFDoc.Rect.Height = 100 
PDFDoc.Color.String = "0, 0, 0" 'black font 

PDFDoc.AddText(text) 

但要小心。如果文字大於矩形,則不會出現。

默認情況下不會有邊框。如果你需要一個,使用方法:

PDFDoc.FrameRect() 

要添加圖像:

Dim bm As Bitmap 

bm = New Bitmap(filename) 
'Dimensions 
PDFDoc.Rect.Left = 100 
PDFDoc.Rect.Bottom = 100 'N.B Measures from bottom, not top  
PDFDoc.Rect.Width = 100 
PDFDoc.Rect.Height = 100 

PDFDoc.FillRect() 
PDFDoc.AddImageBitmap(bm, True) 

不過,我不認爲這是可能使它不適合的矩形。據我所知,無論如何,這就是擁有Rect的點。

此外,我建議看看websupergoo's documentation。這個很不錯。

+0

創建一個XImage對象來獲取圖像的尺寸「線條顏色是由當前的顏色決定」,根據設定的矩形在此,然後調用Doc.AddImage(XImage)。 – AffineMesh 2011-04-11 05:48:22

2

把白色邊框

PDFDoc.Color.String = "255 255 255" 
PDFDoc.Rect.Left = 100 
... 

每它們的文檔,