This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/android/security/secured-documents.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Open password-protected PDF on Android | Nutrient SDK

PDF documents support passwords and other security methods. Nutrient can write annotations and forms to password-protected documents when their permissions enable editing.

Some protected documents use an empty password. Nutrient tries an empty password before displaying the password dialog, matching Adobe Acrobat’s behavior.

Password dialog

Nutrient Android SDK prompts users for a password when opening a protected PDF that requires one, so you don’t need additional setup.

Supplying passwords programmatically

To open a protected PDF without a prompt, supply its password through PdfActivityIntentBuilder’s passwords method:

val fileUri = Uri.parse("file:///path/to/your/document.pdf")
val intent = PdfActivityIntentBuilder.fromUri(context, fileUri)
.passwords("file_password_goes_here")
.build()
context.startActivity(intent)

For PdfUiFragment instead of PdfActivity, supply the password through PdfUiFragmentBuilder:

val fileUri = Uri.parse("file:///path/to/your/document.pdf")
val fragment = PdfUiFragmentBuilder.fromUri(context, fileUri)
.passwords("file_password_goes_here")
.build()
supportFragmentManager.beginTransaction()
.replace(R.id.fragmentContainer, fragment)
.commit()

For PdfFragment, use a newInstance overload that accepts a list of document passwords:

val fileUri = Uri.parse("file:///path/to/your/document.pdf")
val fragment = PdfFragment.newInstance(
listOf(fileUri),
listOf("file_password_goes_here"),
configurationBuilder.build()
)