Password-protected spreadsheets do not open in 26.5. The example below is correct, but the library rejects a valid password on an encrypted XLSX with Invalid password. — the same file and password open normally in GroupDocs.Markdown for .NET. Password-protected Word documents (above) work. This is being tracked as a library defect; no verified output is published for this example until it is fixed.
protected.xlsx is a sample file used in this example. Click here to download it.
Handling incorrect passwords
If the password is missing or incorrect the conversion fails. Catch GroupDocsMarkdownException to display a user-friendly message — see Error handling for why the base type rather than DocumentProtectedException:
importcom.groupdocs.markdown.*;publicclassLoadPasswordException{publicstaticvoidmain(String[]args){try{Stringmarkdown=MarkdownConverter.toMarkdown("protected.docx");}catch(GroupDocsMarkdownExceptione){System.out.println("Cannot open document: "+e.getMessage());}}}
protected.docx is a sample file used in this example. Click here to download it.
Cannot open document: com.groupdocs.markdown.DocumentProtectedException: The document password is incorrect.