Dim pdf As PdfDocument
pdf.Initialize
pdf.StartPage(595, 842) 'A4 size
pdf.Canvas.DrawText("Hello", 100, 100, Typeface.DEFAULT_BOLD, 35 / GetDeviceLayoutValues.Scale, Colors.Black, "LEFT")
pdf.Canvas.DrawText("Testing: 123", 100, 140, Typeface.DEFAULT_BOLD, 15 / GetDeviceLayoutValues.Scale, Colors.Black, "LEFT")
pdf.FinishPage
Dim out As OutputStream = File.OpenOutput(rp.GetSafeDirDefaultExternal(""), "testing.png", False)
pdf.Canvas.Bitmap.WriteToStream(out, 100, "PNG")
out.Close
Log("Wrote bitmap to file")
out = File.OpenOutput(rp.GetSafeDirDefaultExternal(""), "testing.pdf", False)
pdf.WriteToStream(out)
out.Close
pdf.Close
Log("Wrote pdf to file")