1

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?

snumpy
  • 2,808
  • 6
  • 24
  • 39
Joe Smith
  • 53
  • 2
  • 6

2 Answers2

3

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"

2

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.

Urbycoz
  • 7,247
  • 20
  • 70
  • 108
  • Create an XImage object to obtain the dimensions of your image, set the Rect based on this, then call Doc.AddImage(XImage). – AffineMesh Apr 11 '11 at 05:48