Save PDFs to local storage on Android
Nutrient Android SDK automatically saves document changes to the device’s file system. To disable autosave, pass false to PdfConfiguration.Builder’s autosaveEnabled method:
val configuration = PdfConfiguration.Builder() .autosaveEnabled(false) .build()final PdfConfiguration configuration = new PdfConfiguration.Builder() .autosaveEnabled(false) .build();Autosave remains enabled unless you explicitly disable it.
With autosave disabled, call PdfDocument’s saveIfModified method to save changes.
Access the document through PdfFragment’s document property, or getDocument() in Java:
val document = activity.requirePdfFragment().document ?: return
// Manually save the document.document.saveIfModified()final PdfDocument document = activity.requirePdfFragment().getDocument();if (document == null) return;
// Manually save the document.try { document.saveIfModified();} catch (IOException e) { // Saving failed.}