Sub CreatePrinterAttributes As JavaObject
Dim builder As JavaObject
builder.InitializeNewInstance("android.print.PrintAttributes.Builder", Null)
Dim mediaSize As JavaObject
mediaSize = mediaSize.InitializeStatic("android.print.PrintAttributes.MediaSize").GetField("ISO_A6")
Return builder.RunMethod("build", Null)
End Sub
Sub CreateWebPrintJob (wv As WebView)
DIm jwv As JavaObject = wv
Dim jPrintManager As JavaObject = jwv.RunMethodJO("getContext", null).RunMethod("getSystemService", Array As Object("print"))
Dim jPrintAdapter As JavaObject = jwv .RunMethod("createPrintDocumentAdapter", null)
dim jobName as String = "Document"
jPrintManager.RunMethod("print", Array As Object(jobName, jPrintAdapter, CreatePrinterAttributes ))
End Sub