Android Question [SOLVED] Floating signature in pdf

makis_best

Well-Known Member
Licensed User
Longtime User
Hi.

I create a pdf file showing one invoice.
At the and of the invoice I show the total cost of the invoice as the signature "ΥΠΟΓΡΑΦΗ in Greek" of the client.
The problem I have is that I can't make the signature printed under the word "ΥΠΟΓΡΑΦΗ" depends of the lines of invoice.
I mean the signature mast show higher or lower depends of the lines of the invoce.

I use this code to print the signature into pdf canvas.
B4X:
Dim Cursor1 As Cursor = Starter.LocalSQL.ExecQuery2("SELECT TheSignature FROM LOCAL_Temp_Order_Header WHERE OrderCode = ?", Array As String(OrderNum))
        Cursor1.Position = 0
        Dim Buffer() As Byte = Cursor1.GetBlob("TheSignature")
        Dim InputStream1 As InputStream
        InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
        Dim Bitmap1 As Bitmap
        Bitmap1.Initialize2(InputStream1)
        InputStream1.Close
'        Activity.SetBackgroundImage(Bitmap1)
        Dim DestRect As Rect
        DestRect.Initialize(100dip, 10dip, 200dip + 100dip, 150dip + 100dip)
        pdf.Canvas.DrawBitmap(Bitmap1, Null, DestRect)

Any idea how to solve this one?
I want the result show on picture.
env1.jpg
 

makis_best

Well-Known Member
Licensed User
Longtime User
My problem is not how to draw the signature.
My problem is how to move the signature, higher or lower on the page based on lines printed.
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
@makis_best how do you draw/write each line in the invoice? Can't you have a pointer of type Long f.e.? That way you could calculate the lowest line and draw the signature accordingly. Another trick would be to have a fixed height and draw the signature for example at the lowest part of the page as well as the Partial sum, VAT and Total sum.
 
Last edited:
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
@makis_best how do you draw/write each line in the invoice? Can't you have a pointer of type Long f.e.? That way you could calculate the lowest line and draw the signature accordingly. Another trick would be to have a fixed height and draw the signature for example at the lowest part of the page as well as the Partial sum, VAT and Total sum.
@hatzisn You mean a counter witch hold the number of lines as looping into pdf and use the counter for the new position?
I think that can work.... I try it and I be back.
 
Upvote 0
Top