hossein etezadi
Member
HI Erel
I have a problem with Reflector
please tell me the solution
my code is this:
Dim PC As Printer = GetPrinter(myLabelPrinter)
Log("PC") : Log(PC)
Dim myResult As Boolean = False
For Each SP As JavaObject In PC.GetPrinterAttributes.GetSupportedPapers
Dim PP As Paper : PP.Initialize
PP=Paper_static.C
PP.SetObject(SP)
Log("PP") : Log(PP)
Try
Dim VAL As String=PP.tostring
Log("VAL") : Log(VAL)
If VAL.contains("2 x 4")=True Then
Log("PP2") : Log(PP) : Log(PP.GetWidth) : Log(PP.GetHeight)
Dim r As Reflector
r.Target = SP
Log("GetField")
r.setField2("width", 60)
r.SetField2("height", 30)
PP.SetObject(SP)
myResult = True
Exit
End If
Catch
Log(LastException)
End Try
Next
but I got java error on SetField2 in release mode not in debug mode
java.lang.reflect.InaccessibleObjectException: Unable to make field private double javafx.print.Paper.width accessible: module javafx.graphics does not "opens javafx.print" to unnamed module @537c850b
Best Regards
HosseinEtezadi
I have a problem with Reflector
please tell me the solution
my code is this:
Dim PC As Printer = GetPrinter(myLabelPrinter)
Log("PC") : Log(PC)
Dim myResult As Boolean = False
For Each SP As JavaObject In PC.GetPrinterAttributes.GetSupportedPapers
Dim PP As Paper : PP.Initialize
PP=Paper_static.C
PP.SetObject(SP)
Log("PP") : Log(PP)
Try
Dim VAL As String=PP.tostring
Log("VAL") : Log(VAL)
If VAL.contains("2 x 4")=True Then
Log("PP2") : Log(PP) : Log(PP.GetWidth) : Log(PP.GetHeight)
Dim r As Reflector
r.Target = SP
Log("GetField")
r.setField2("width", 60)
r.SetField2("height", 30)
PP.SetObject(SP)
myResult = True
Exit
End If
Catch
Log(LastException)
End Try
Next
but I got java error on SetField2 in release mode not in debug mode
java.lang.reflect.InaccessibleObjectException: Unable to make field private double javafx.print.Paper.width accessible: module javafx.graphics does not "opens javafx.print" to unnamed module @537c850b
Best Regards
HosseinEtezadi