I use the printing library to convert html to pdf files. It works fine, but the user always has to change the page orientation to landscape and to define a useful filename. I'm searching for a way to preset these defaults by my program.
I found this old thread :
https://www.b4x.com/android/forum/threads/android-printing-framework.38796/page-2
where Erel shows how to change the printer.attributes :
But I can't see where the defined mediaSize is used.
I was hoping I could adapt this snippet, but I doesn't work.
I found this old thread :
https://www.b4x.com/android/forum/threads/android-printing-framework.38796/page-2
where Erel shows how to change the printer.attributes :
B4X:
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
But I can't see where the defined mediaSize is used.
I was hoping I could adapt this snippet, but I doesn't work.