Skip to content Skip to sidebar Skip to footer

E/pdfmanipulationservice: Cannot Open File Java.io.ioexception: Not Create Document. Error:

hello people i am working on document printing app and first i am create a pdf file using iText lib and then i am connect the printer through ip address this is going well but when

Solution 1:

For Hp printers you can use Hp-eprint by finding the email address of your Hp printer and then you can use following code to send mail to your priner.As You send the mail the attached document gets printed on your Hp Printer.

 private void openHpeprint() {
        File file = new File(folder + "/" + fileName);
        if (file.exists()) {
                Intent emailIntent = new Intent();
                emailIntent.setAction(Intent.ACTION_SEND);
             /*   Uri uri = Uri.fromFile(file);*/
                Uri uri = FileProvider.getUriForFile(mContext, mContext.getApplicationContext().getPackageName() + ".provider", file);
                emailIntent.setFlags(FLAG_GRANT_WRITE_URI_PERMISSION);
                emailIntent.setFlags(FLAG_GRANT_READ_URI_PERMISSION);
                // set the type to 'email'
                emailIntent.setType("vnd.android.cursor.dir/email");
                emailIntent.setPackage("com.google.android.gm");
                String to[] = {"yourHpprinteremailaddress@Hpeprint.com"};
                emailIntent.putExtra(Intent.EXTRA_EMAIL, to);
// the attachment
                emailIntent.putExtra(Intent.EXTRA_STREAM, uri);
// the mail subject
                emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
                try {
                    startActivity(emailIntent);
                } catch (ActivityNotFoundException e) {
                    Logger.LogError(TAG, "No Application Available to View Pdf");
                }

        }
    }

Post a Comment for "E/pdfmanipulationservice: Cannot Open File Java.io.ioexception: Not Create Document. Error:"