How to get file path or URI after saving it via Android native (PRINT) dialog?

Print application added to android in KITKAT. I used it to save PDF content loaded in webView.

An open dialog opens and provides the option to print or save as PDF.

if the user chooses to save as PDF. open the file and save the file.

I want a SAVED PATH.

I am using the following method to print PDF

private void createWebPrintJob(WebView webView) {

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

    PrintDocumentAdapter printAdapter = webView
            .createPrintDocumentAdapter();

    String jobName = getString(R.string.app_name) + " Print Test";

    printManager.print(jobName, printAdapter,
            new PrintAttributes.Builder().build());
}

      

Android Developer Documentation Print

+3


source to share





All Articles