Dim A4Width As Int = 595
Dim A4Height As Int = 842
Dim pdf As PdfDocument
pdf.Initialize
pdf.StartPage(A4Width, A4Height) 'A4 size
Dim Rect1 As Rect
Rect1.Initialize(50, 60, 545, 90)
pdf.Canvas.DrawRect(Rect1, Colors.Black, False, 0.8)
pdf.Canvas.DrawText("NAME OF THE USER", 300, 80, Typeface.DEFAULT_BOLD, 14 / GetDeviceLayoutValues.Scale , Colors.Black, "CENTER")
Dim Bitmap1 As Bitmap
Bitmap1 = LoadBitmap(File.DirAssets, "smiley.png")
Dim DestRect As Rect
DestRect.Initialize(100, 150, 80, 250)
pdf.Canvas.DrawBitmap(Bitmap1, Null, DestRect) 'draws the bitmap to the destination rectangle.
pdf.FinishPage