pdfjet seems must create a pdf file and save it to disk firstly.then use pdfviewer loading this file. how to draw qrcode directly in webpage.
regards
regards
write the B4J code using an ABMCustomComponent similar as we wrote the Google Charts.
Hey, you once instructed me to go to bed cause I was off the rails... (which I truly was)...@Harris Stay alert, you'll getting to much sleep!
https://www.b4x.com/android/forum/t...stion-about-abmcustomcomponent.71076/#content
'Class module
Sub Class_Globals
Public ABMComp As ABMCustomComponent
Public myText As String
Public myWidth As Int
Public myHeight As Int
Public myColorDark As String
Public myColorLight As String
Public myCorrectLevel As String
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(InternalPage As ABMPage, ID As String, text As String, width As Int, height As Int, colorDark As String, colorLight As String, correctLevel As String)
ABMComp.Initialize("ABMComp", Me, InternalPage, ID)
myText = text
myWidth = width
myHeight = height
myColorDark = colorDark
myColorLight = colorLight
myCorrectLevel = correctLevel
End Sub
Sub ABMComp_Build(internalID As String) As String
Return $"<div id="${internalID}svg"/></div><script>var qrcode${internalID};</script>"$
End Sub
' Is useful to run some initalisation script.
Sub ABMComp_FirstRun(InternalPage As ABMPage, internalID As String)
Dim script As String = $"qrcode${internalID} = new QRCode(document.getElementById("${internalID}svg"), {
text: "${myText}",
width: ${myWidth},
height: ${myHeight},
colorDark : "${myColorDark}",
colorLight : "${myColorLight}",
correctLevel : ${myCorrectLevel}
});"$
InternalPage.ws.Eval(script, Array As Object(ABMComp.ID))
' flush not needed, it's done in the refresh method in the lib
End Sub
' runs when a refresh is called
Sub ABMComp_Refresh(InternalPage As ABMPage, internalID As String)
Dim script As String = $"qrcode${internalID}.clear();
qrcode${internalID}.makeCode("${myText}");"$
InternalPage.ws.Eval(script, Array As Object(ABMComp.ID))
End Sub
' do the stuff needed when the object is removed
Sub ABMComp_CleanUp(InternalPage As ABMPage, internalID As String)
End Sub
Dim QRCode As CompQRCode
page.AddExtraJavaScriptFile("custom/qrcode.min.js")
QRCode.Initialize(page, "qrcode", "Alwaysbusy's ABMaterial", 128,128, "#000000", "transparent", "QRCode.CorrectLevel.H")
page.Cell(3,1).AddComponent(QRCode.ABMComp)