Android Question Pdf Library

Giusy

Active Member
Licensed User
I copied this program from the link:
B4X:
Dim pdf As PdfDocument
pdf.Initialize
pdf.StartPage(595, 842) 'A4 size
pdf.Canvas.DrawLine(2, 2, 593 , 840, Colors.Blue, 4)
pdf.Canvas.DrawText("Hello", 100, 100, Typeface.DEFAULT_BOLD, 30 / GetDeviceLayoutValues.Scale , Colors.Yellow, "CENTER")
pdf.FinishPage
Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "1.pdf", False)
pdf.WriteToStream(out)
out.Close
pdf.Close
But the library?
 
Upvote 0

moster67

Expert
Licensed User
Did you read the post by Erel? Check at the end of his post and you will see the library attached.
 
Upvote 0

moster67

Expert
Licensed User
works fine here:

upload_2019-3-14_23-57-38.png
 
Upvote 0

moster67

Expert
Licensed User
Never used this library. Sorry.
But I guess you need to position x and y values in relation to the canvas size set with pdf.startpage in order to put the text where you want.
 
Upvote 0
Top