Hi, I need help for saving a created pdf into a specific folder, and (the folder) if not exist I need to create... Thanks to any ideas
Panel to PDF.
thanks for any Ideas
PanelToPdf:
Private Sub PanelToPdf(Panel As B4XView, FileName As String)
Dim pdf As PdfDocument
pdf.Initialize
pdf.StartPage(595, 842) 'A4 size
Dim bmp As B4XBitmap = Panel.Snapshot
Dim dest As Rect
dest.Initialize(10, 10, 0, 0)
dest.Width = bmp.Width / bmp.Scale
dest.Height = bmp.Height / bmp.Scale
pdf.Canvas.DrawBitmap(bmp, Null, dest)
pdf.FinishPage
Dim out As OutputStream = File.OpenOutput(provider.SharedFolder, FileName, False)
pdf.WriteToStream(out)
out.Close
pdf.Close
Dim in As Intent
in.Initialize(in.ACTION_VIEW, "")
provider.SetFileUriAsIntentData(in, FileName)
in.SetType("application/pdf")
StartActivity(in)
End Sub
thanks for any Ideas