내 워드 파일 (.doc)에 비밀번호를 추가하고 싶습니다. Google에서 검색했지만 솔루션 (.docx) 만 발견했습니다. 누구든지 나를 도울 수 있습니까? 이 코드를 사용하고 있지만 출력 파일에 암호가 없습니다.비밀번호 apache poi로 단어 (.doc) 파일 추가
FileInputStream in = new FileInputStream("Doccc.doc");
BufferedInputStream bin = new BufferedInputStream(in);
POIFSFileSystem poiFileSystem = new POIFSFileSystem(bin);
Biff8EncryptionKey.setCurrentUserPassword("[email protected]");
HWPFDocument doc = new HWPFDocument(poiFileSystem);
Range range = doc.getRange();
FileOutputStream out = new FileOutputStream("Doccc.doc");
doc.write(out);
out.close();
[Apache POI에서 지원하는 암호화/암호 보호 매트릭스] (http://poi.apache.org/encryption.html)를 보셨습니까? – Gagravarr
@Gagravarr 예. 이 가이드에서는 .doc 파일을 지원하지 않으며 .docx 파일 만 지원합니다. 누구든지 다른 방법으로 제안 할 수 있습니까? – kids