Unlock Microsoft Word Documents, Excel Spreadsheets, Powerpoint Presentations and PDF Documents by removing password or write protection via C++ Application
Created
April 5, 2024 05:17
Unlock Password Protected Documents via C++ Applications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Aspose::Cells::Startup(); | |
Workbook workbook(u"protected.xlsx"); | |
Worksheet worksheet = workbook.GetWorksheets().Get(0); | |
worksheet.Unprotect(); | |
workbook.Unprotect("password"); | |
workbook.Save("unprotected.xlsx", SaveFormat::Auto); | |
Aspose::Cells::Cleanup(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String _dataDir("C:\\Samples\\"); | |
auto pdfDocument = MakeObject<Document>(_dataDir + u"Decrypt.pdf", u"password"); | |
pdfDocument->Decrypt(); | |
pdfDocument->Save(_dataDir + u"unlocked.pdf"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto loadOptions = System::MakeObject<LoadOptions>(); | |
loadOptions->set_Password(u"123123"); | |
auto presentation = System::MakeObject<Presentation>(u"pres.pptx", loadOptions); | |
presentation->get_ProtectionManager()->RemoveEncryption(); | |
presentation->Save(u"encryption-removed.pptx", SaveFormat::Pptx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputFileName); | |
doc->Unprotect(); | |
doc->Save(u"unprotected.doc"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment