0

I am trying to print pdf document that i just have created in my application. I used

How to Print PDF using Android 4.4 Printing framework

above link

but there is error in :

PrintManager printManager = (PrintManager)this.getSystemService(mContext.PRINT_SERVICE);

this line

says this error

Please see this image for error

And after this i tried to extend my activity with service then it says that , ondestroy clashes with service ondestroy.

so after that i created a service which extends PrintService there also same error occurs as in image.

Added service in manifest also and added the permission too. Please help i need to print the pdf file.

Community
  • 1
  • 1
Asif Ansari
  • 119
  • 12
  • 1
    Asif Ansari: It is Context and not mContext. PrintManager printManager = (PrintManager) getSystemService(Context.PRINT_SERVICE); – kevz Sep 19 '16 at 06:41

1 Answers1

0

Try this :

PrintManager printManager = (PrintManager) this .getSystemService(Context.PRINT_SERVICE);

Evan Laksana
  • 410
  • 3
  • 7
  • 17