开发者

How can I add a Rect without a border?

开发者 https://www.devze.com 2023-02-15 03:22 出处:网络
Is it possible to create开发者_开发技巧 a Rect text area with black font and no boarder or at least a white border?

Is it possible to create开发者_开发技巧 a Rect text area with black font and no boarder or at least a white border?

Also, is it possible to add an image and not have it scale to fit the Rect?


To make a white border

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

Per their documentation, "the line color is determined by the current color"


Create rect text area with black font:

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)

But be careful. If the text is bigger than the rect then it will not appear.

There will be no border by default. If you need one, use:

PDFDoc.FrameRect()

To add an image:

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)

However, I don't think it's possible to make it not fit the Rect. As I understand it, that's kind of the point of having the Rect anyway.

Also, I recommend having a look at websupergoo's documentation. It's pretty good.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号