I create a PDF document with this code.
However, I get this result
B4X:
Dim cvs As Canvas
cvs.InitializePDF(File.DirDocuments, "1.pdf", 612, 792)
cvs.DrawColor(Colors.White)
Dim lbl As Label
lbl.Initialize("")
lbl.SetLayoutAnimated(0, 1, 0, 0,100, 300)
lbl.Multiline = True
lbl.TextColor = Colors.Black
lbl.Text ="gfsdsfgdgdgsdgfdsgsdgdsgdsgdskgdsklgjdfslkdsjlkdslkdslkdskdskljskldskldskldsklgskldgsldkfgjkldsffgjfsldkgjskldgjsldkgjslkgjsklgjsk"
Dim r As Rect
r.Initialize(10, 10, 110, 310)
cvs.DrawView(lbl, r)
cvs.Release
WKWebView1.LoadUrl("file://" & File.Combine(File.DirDocuments, "1.pdf"))
Dim avc As ActivityViewController
avc.Initialize("avc", Array(CreateFileUrl(File.DirDocuments, "1.pdf")))
avc.Show(pg4, pg4.RootPanel)