Android Question PrintAttributes

Robert Valentino

Well-Known Member
Licensed User
I am trying to use this code or something like it from this post by Erel:

The below code creates a PrintAttributes what I really need to do is obtain the current PrintAttributes
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
To be able to get the printer margins as described in this post:

For my post:

PrinterAttributes should allow me to get the MediaSize and Margins

public PrintAttributes.MediaSize getMediaSize ()
public PrintAttributes.Margins getMinMargins ()

According to the documentation getMinMargins should give me the minimal margins
These margins are physically imposed by the printer and they are not rotated, i.e. they are the same for both portrait and landscape. For example, a printer may not be able to print in a stripe on both left and right sides of the page
ANY Help?