I try to create a PDF document using this library, based in the example of the post.
It is a profile form, with a title in a rectangle and an image,
The title with the rectangle is printing, but the image don't.
What could be happen? How can I fix this?
The code is below and the example is in attached.
Thanks in advance for any tip.
It is a profile form, with a title in a rectangle and an image,
The title with the rectangle is printing, but the image don't.
What could be happen? How can I fix this?
The code is below and the example is in attached.
Thanks in advance for any tip.
B4X:
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