Private Sub ButtonEnvoyer_Click
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
CustomListView1.sv.Height=3000dip
Dim bmp As B4XBitmap=CustomListView1.sv.Snapshot
pdf.Initialize
pdf.StartPage(595, 842) 'A4 size
pdf.Canvas.DrawLine(2, 2, 593 , 840, Colors.Blue, 4)
pdf.Canvas.DrawText("Hello", 100, 100, Typeface.DEFAULT_BOLD, 30 / GetDeviceLayoutValues.Scale , Colors.Yellow, "CENTER")
DestRect.Initialize(30, 30, 0, 0)
DestRect.Width = bmp.Width / bmp.Scale
DestRect.Height = bmp.Height / bmp.Scale
pdf.Canvas.DrawBitmap(bmp, Null, DestRect)
pdf.FinishPage
Dim out As OutputStream = File.OpenOutput(File.DirInternal, "Ronde.pdf", False)
pdf.WriteToStream(out)
out.Close
pdf.Close
End If
End Sub