سؤال

Here is a way to open Adobe Reader on Android:

try {
  Intent intent = new Intent();

  intent.setClassName("com.adobe.reader", "com.adobe.reader.AdobeReader");
  intent.setAction(Intent.ACTION_VIEW);
  intent.setDataAndType(Uri.fromFile(doc), "application/pdf");

  startActivity(intent);
} 
catch (ActivityNotFoundException activityNotFoundException) {
  activityNotFoundException.printStackTrace();
}

Is there a way to open it and specify the author name for the annotations (the annonations we can with adobe reader 10.4.0 on pdf documents)?

Thanks in advance !

Zab

هل كانت مفيدة؟

المحلول

The only solution I found is to use super user (on rooted devices).

Here is how to do that:

    Process suProcess = Runtime.getRuntime().exec("su");

    DataOutputStream os = new DataOutputStream(suProcess.getOutputStream());

    os.writeBytes("echo \"<?xml version='1.0' encoding='utf-8' standalone='yes' ?><map><string name='commentAuthorName'>toto</string></map>\" > /data/data/com.adobe.reader/shared_prefs/com.adobe.reader.preferences.xml \n");

    os.writeBytes("exit\n");
    os.flush();
    os.close();

    suProcess.waitFor();
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top