iOS Question Write PDF to File

SFE

Member
Licensed User
What do I need to do to get this PDF to write this to a file? I check in the files folder on the iphone and never see anything so I am missing a step.

Thank you

Dim pcvs As Canvas
pcvs.InitializePDF(File.DirDocuments,"Test.pdf",612,792)
pcvs.DrawText("Hello", 100, 100, Font.DEFAULT_BOLD, Colors.Blue, "CENTER")
pcvs.Refresh
pcvs.Release
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use [code]code here...[/code] tags when posting code.

Full example:
B4X:
Private Sub Button1_Click
    Dim cvs As Canvas
    cvs.InitializePDF(xui.DefaultFolder, "1.pdf", 612, 792)
    cvs.DrawCircle(100, 100, 50, xui.Color_Red, True, 0)
    cvs.Refresh
    cvs.Release
    WebView1.LoadUrl(xui.FileUri(xui.DefaultFolder, "1.pdf")) 'show the saved pdf with WebView.
End Sub
 
Upvote 0

SFE

Member
Licensed User
Thanks Erel. It works as you said it would.

Obviously the file was created but when I look under the files folder or even search for 1 or 1.pdf I never see anything. So where does this file reside that I cannot see it when I look in the Files Folder on the iPhone, even though I can use it in code?

Thanks again.
 
Upvote 0
Top