print file or web page

29 views
Skip to first unread message

stockmanager sys

unread,
May 28, 2020, 10:06:36 AM5/28/20
to QPython
    hello qpython
   i need to know how can i print html file or pdf file from qpython to printer connected to android device
  thanks

robertt

unread,
Mar 16, 2021, 12:04:33 AM3/16/21
to QPython
Have you tried Send Intent?
from androidhelper import Android
droid = Android()
droid.startActivity(None, None, None, None, None, 'com.sec.android.app.launcher', 'com.android.launcher2.Launcher')
# startActivity(action, uri, type, extras, wait, packagename, classname)
for the uri: file:///<file path/document.pdf>
You'll still need an App that connects to your printer and need the packagename & classname
for that printer App (still not guaranteed to work) It depends on how the App was written.
I've had pretty good luck interacting with other Android apps using python send intent scripts,
but it's not always allowed.
Reply all
Reply to author
Forward
0 new messages