2011-03-07 60 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 
... 

每它们的文档,