Questions tagged [android-print-manager]
22 questions
7
votes
3 answers
getting an error "java.lang.IllegalStateException: Can print only from an activity"?
I am getting an error "java.lang.IllegalStateException: Can print only from an activity" while using an android 4.4 printing API.
is it work on all android above 4.4?
my code
public class MainActivity extends Activity {
Context cotext;
…

Riyas PK
- 3,147
- 1
- 23
- 29
4
votes
0 answers
Printing to WiFi printer android
I need to create an android application that sends data to multiple printers without any user input regarding printer selection.
Basically, when the user taps on some UI button the app should know to witch available printer(can be more than one) to…

Ivan
- 41
- 2
3
votes
2 answers
Fatal Exception: java.lang.IllegalArgumentException fd cannot be null in onwrite() of PrintAdapter class in Android Q only
I suddenly faced this issue when I tested this on Android Q device for the Print PDF feature. Its was working fine till Android P. I tried finding solution on the internet but of no use. Any help would be good.

Prajwal Waingankar
- 2,534
- 2
- 13
- 20
2
votes
2 answers
How to print password protected PDF in android?
I am printing pdf using the below code which works fine for normal pdfs but crashes with password-protected pdf. is there any way by which we can print password-protected pdf or stop applications from crashing. application crashes even print()…

Saurabh Dhage
- 1,478
- 5
- 17
- 31
2
votes
1 answer
How to configure Build In POS printer with android PrintService
I have PAX A920 and i am trying to print receipt from chrome.
I wan to configure printer service in android for print receipt from my build in printer
I have write printer service for local printer and its is showing in preview, but I don't know how…

Shoaib Anwar
- 819
- 2
- 12
- 29
1
vote
0 answers
How to print with thermal printer built-in with EDC machine with kotlin
I have an EDC machine android and built-in with thermal printer. now i'am make an POS application with jetpack compose kotlin. How can I detect the thermal printer in this EDC machine and how I can print the jetpack compose view? Please help me…

HANI LESMANA
- 11
- 1
1
vote
1 answer
How do I print programatically on android without the prompt where you have to choose a printer?
I've been trying to find a solution to this issue all day but I haven't come across anything and android has no documentation related to this. Normally when you print something programmatically following the instructions within the documentation, a…

Krisztián Nagy
- 132
- 1
- 10
1
vote
0 answers
Do Android apps need to add any dependency in order to support CUPS (Common Unix Printing System/Server)
I have an Android app having support for PDF printing. I have used PrintManager class to implement printing behaviour for the app and for Chromebook we were using Cloud Print. Now as google have deprecated cloud print in January of 2021 and is no…

Tushar raina
- 41
- 2
1
vote
2 answers
Malformed PDF print doesn't catch RuntimeException
I try to print a PDF file and it works fine until I try to print a malformed PDF file.
I don't know why the application crashes even though I used try / catch to prevent crashes. I checked and found out that PrintManager.java:1101 throws…

Janekxyz
- 101
- 1
- 9
1
vote
0 answers
Android: How to print to Default Print Service without Android UI?
I am trying to print to the default print service in Android 9 and it seems that I can only do it through PrintManager.print command. Unfortunately, this command pops up a view that I don't need in my flow as I am developing an automated printing…

Vladimir Arkhipov
- 99
- 7
0
votes
0 answers
How I can activate color option in print dialog?
In print dialog " in the attached image", I want to active color option to edit text or something else before print the pdf ..
Can I also active the "two -sided" ?
How I can do it?
enter image description here
Adapter code:
`@Override
public void…

HGSu
- 15
- 6
0
votes
0 answers
Is there a way to print a custom document without showing the default android print interface (instead using custom made interface)
I'm able to print a custom document using Printing custom documents
but it uses android print interface to perform the print operations (as shown in image)
Instead, I want to show my own interface to print the doc, I have seen many apps interface…

Jatin guglani
- 363
- 7
0
votes
0 answers
Add a Click listener to "save pdf" button in android print manager
I am working on saving a webview as a pdf in compose android .
Have this function that launches the android print manager which works for me .
I am looking to add a functionality where i can automatically pop the backstack to the previous screen…

Paa kwesi OPOKU
- 13
- 3
0
votes
0 answers
depreciated PrintManager library in android
I'm not able to print PDF from webView. PrintManager library depreciated in android, So i'm finding library or method to fix this issue. Can anybody help?
private void createWebPrintJob(WebView webView) {
/*if (Build.VERSION.SDK_INT <…
0
votes
0 answers
first page of the pdf is getting printed while printing multi pages pdf from android webview
I am trying to print a pdf with 4 pages which I am receiving from a URL.
but only the first page of the pdf is showing in the print manager.
So I am getting a single page in the print.
The first page is getting saved to device while trying to save…

XamarinInfo
- 133
- 1
- 8