I've been researching the solution for this error here on the forum but no solution has been found so far.
This started when I downloaded library printing and used it in my project, like this:
B4X:
Private Sub lbSensorial_Click
Dim tela As B4XView = svw.Panel
Dim pdf As PdfDocument
Dim retn As Rect
Private rp As RuntimePermissions
retn.Initialize(0, 0, 400dip, 2400dip)
pdf.Initialize
pdf.StartPage(595, 842) 'A4 size
pdf.Canvas.DrawBitmap(tela.Snapshot,Null, retn)
pdf.FinishPage
Dim out As OutputStream = File.OpenOutput( rp.GetSafeDirDefaultExternal(""), "1.pdf", False)
pdf.WriteToStream(out)
out.Close
pdf.Close
End Sub