Android Question PDF Creation - Place Text in Filled Rectangle

mmieher

Active Member
Licensed User
Longtime User
Having trouble printing a on filled rectangle. In this case, the background is orange, and the text is black. However, even though I draw the rectangle first, the black text is not visible.

B4X:
    Dim tRect As Rect
    tRect.Initialize(10,currentY,585,currentY+15)
    pdf.Canvas.DrawRect(tRect,Colors.rgb(249,161,27),True,1)
   
    pdfColor = Colors.Black
    pdfFontSize = 8
    Outprint("Product",30,currentY+2,0)

Sub Outprint(inText As String, inX As Int, inY As Int, MaxWidth As Int)
   
    Dim subX As Int = inX
    Dim subY As Int = inY + 15
   
    Dim tFontSize As Int = pdfFontSize / GetDeviceLayoutValues.Scale
   
    pdf.Canvas.DrawText(inText,subX,subY,pdfFontFace,tFontSize,pdfColor,pdfFontAlign)
   
End Sub
 

mmieher

Active Member
Licensed User
Longtime User
PS -- The FILL parameter of pdf.Canvas.DrawRect is not working. I changed it to FALSE but it is still filled.
 
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
Well, Erel, as is almost always the case when you ask me to create a small project to show problem, I do so, and the problem goes away. So it must be some issue with my "big" project. Thanks for the replay.
 
Upvote 0
Top