The following code adds a transparent PNG to a document.
[C#]
Doc theDoc = new
Doc(); string thePath =
Server.MapPath("../mypics/mypic.png"); Bitmap bm = new
Bitmap(thePath); theDoc.Rect.Inset(20,
20); theDoc.Color.String = "0 0
200"; theDoc.FillRect(); theDoc.AddImageBitmap(bm,
true); bm.Dispose();
theDoc.Save(Server.MapPath("docaddimagebitmap.pdf")); theDoc.Clear();
[Visual Basic]
Dim theDoc As Doc =
New Doc() Dim thePath As String =
Server.MapPath("../mypics/mypic.png") Dim bm As Bitmap = New
Bitmap(thePath) theDoc.Rect.Inset(20, 20) theDoc.Color.String
= "0 0 200" theDoc.FillRect() theDoc.AddImageBitmap(bm,
True) bm.Dispose()
theDoc.Save(Server.MapPath("docaddimagebitmap.pdf")) theDoc.Clear()
docaddimagebitmap.pdf
|
|
|