1

是否可以创建一个黑色字体且没有边框或至少有白色边框的 Rect 文本区域?

此外,是否可以添加图像而不使其缩放以适合矩形?

4

2 回答 2

3

制作白色边框

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

根据他们的文档,“线条颜色由当前颜色决定”

于 2012-09-28T15:32:20.073 回答
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。据我了解,这就是拥有 Rect 的意义所在。

另外,我建议您查看websupergoo 的文档。这个很不错。

于 2011-04-05T09:33:31.160 回答