Hello friends I use this library to create PDF.
www.b4x.com
When I want to insert a signature, it does not fit on different devices.
The signature is read in as a PNG.
That's how I'm using it at the moment, where it fits reasonably well on different devices.
I'm probably not doing it right.
How do you solve this problem?
Translated with DeepL.com (free version)
Printing and Pdf creation
This is an Android 4.4+ (API 19+) library. Its two main features are: 1. Creating Pdf documents with the PdfDocument object. 2. Printing with the Printer object. Lets start with PdfDocument. Dim pdf As PdfDocument pdf.Initialize pdf.StartPage(595, 842) 'A4 size pdf.Canvas.DrawLine(2, 2, 593...

When I want to insert a signature, it does not fit on different devices.
The signature is read in as a PNG.
That's how I'm using it at the moment, where it fits reasonably well on different devices.
I'm probably not doing it right.
How do you solve this problem?
Translated with DeepL.com (free version)
B4X:
If File.Exists(xui.DefaultFolder, "unterschrift1.png") = True Then' Bild einfügen
Dim Bitmap1 As Bitmap
Bitmap1.Initialize(xui.DefaultFolder, "unterschrift1.png")
Dim r As Rect
If (Bitmap1.Width/GetDeviceLayoutValues.Scale) >500 Then
r.Initialize(310, 751, Bitmap1.Width/2/GetDeviceLayoutValues.Scale+140, Bitmap1.Height/2/GetDeviceLayoutValues.Scale+699) 'von links,von oben,bis rechts,bis unten
Else
r.Initialize(310, 751, Bitmap1.Width/GetDeviceLayoutValues.Scale+140, Bitmap1.Height/GetDeviceLayoutValues.Scale+699) 'von links,von oben,bis rechts,bis unten
End If
Log("Unterschrift-Breite "&(Bitmap1.Width/GetDeviceLayoutValues.Scale))
pdf1.Canvas.DrawBitmap(Bitmap1, Null,r)
End If