Android Question share pdf file to whatsapp

scsjc

Well-Known Member
Licensed User
Longtime User
Hello,
I want a share file pdf to whatsapp or other app, is possible?

Thanks
 

Star-Dust

Expert
Licensed User
Longtime User
I use this and wotk it
B4X:
Dim share As MESShareLibrary
' Path=File.DirRootExternal & "\MyPath" ... Don't use Path App Internal
share.sharebinary("file://" & PathP & "/" & FileNamePDF, "image/*", "Select App Share","","Share")
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
I use this and wotk it
B4X:
Dim share As MESShareLibrary
' Path=File.DirRootExternal & "\MyPath" ... Don't use Path App Internal
share.sharebinary("file://" & PathP & "/" & FileNamePDF, "image/*", "Select App Share","","Share")

Thanks !!!
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
I use this and wotk it
B4X:
Dim share As MESShareLibrary
' Path=File.DirRootExternal & "\MyPath" ... Don't use Path App Internal
share.sharebinary("file://" & PathP & "/" & FileNamePDF, "image/*", "Select App Share","","Share")

I'm try the file PDF ... but in whatsapp get the error "The file selected not a document"... i think the problem are in.... "image/*"... is possible select PDF file???
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
i think no. MIME type is IMAGE TEXT AUDIO ec.. no PDF
But it is very strange to me it works.

Try this (with JavaObject Library)
B4X:
Dim i As Intent
i.Initialize(i.ACTION_SEND, "file://" & File.DirRootExternal & "/1.PDF")
i.SetType("image/png")
Dim jo As JavaObject = i
jo.RunMethod("setPackage", Array As Object("com.whatsapp"))
StartActivity(i)
 
Upvote 0
Top