Giusy Active Member Licensed User Mar 14, 2019 #1 Hi, I can't find the library to create PDF files. Thanks
moster67 Expert Licensed User Longtime User Mar 14, 2019 #2 https://www.b4x.com/android/forum/threads/printing-and-pdf-creation.76712/ Upvote 0
Giusy Active Member Licensed User Mar 14, 2019 #3 moster67 said: https://www.b4x.com/android/forum/threads/printing-and-pdf-creation.76712/ Click to expand... 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 said: https://www.b4x.com/android/forum/threads/printing-and-pdf-creation.76712/ Click to expand... 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?
moster67 Expert Licensed User Longtime User Mar 14, 2019 #4 Did you read the post by Erel? Check at the end of his post and you will see the library attached. Upvote 0
Giusy Active Member Licensed User Mar 14, 2019 #5 moster67 said: Did you read the post by Erel? Check at the end of his post and you will see the library attached. Click to expand... I found Printig.jar and printing.xml but the program does not work what did i forget? Upvote 0
moster67 said: Did you read the post by Erel? Check at the end of his post and you will see the library attached. Click to expand... I found Printig.jar and printing.xml but the program does not work what did i forget?
Giusy Active Member Licensed User Mar 14, 2019 #7 moster67 said: works fine here: View attachment 78408 Click to expand... all ok thanks a lot Upvote 0
Giusy Active Member Licensed User Mar 15, 2019 #8 moster67 said: works fine here: View attachment 78408 Click to expand... Hi @moster67 Why when you write "Hello" and the instruction indicates "Center", "Hello" is not centered? Thanks Upvote 0
moster67 said: works fine here: View attachment 78408 Click to expand... Hi @moster67 Why when you write "Hello" and the instruction indicates "Center", "Hello" is not centered? Thanks
moster67 Expert Licensed User Longtime User Mar 15, 2019 #9 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
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.