1
ODFToolkit을 다운로드했으며 OpenOffice를 설치할 필요가 없습니다. 다음과 같이 odt 파일을 생성 할 수 있습니다.워드 파일을 읽고 odt로 저장
그리고 내 질문은 - 내가 과 .docx
파일을 읽고 .odt
으로 저장할 수 있습니까?
제발 도와 주실 수 있나요?
import org.odftoolkit.odfdom.doc.OdfTextDocument;
import java.net.URI;
public class QuickOdt {
public static void main(String[] args) {
OdfTextDocument outputDocument;
try {
outputDocument = OdfTextDocument.newTextDocument();
outputDocument.addText("I'm using the ODFDOM toolkit!");
outputDocument.newParagraph();
outputDocument.newImage(new URI("images/odf-community.jpg"));
outputDocument.newParagraph("Bu bir taze paragrafdyr");
outputDocument.save("quick.odt");
} catch (Exception e) {
System.err.println("Unable to create output file.");
System.err.println(e.getMessage());
}
}
}
.doc 파일을 읽으려고했으나 제대로 작동하지 않습니까? 어떤 문제에 직면 해 있습니까? – Tudor
예, 시도했습니다. doc 파일을 읽는 법을 모르겠습니다. 어쩌면 코드를 도울 수 있습니까? – serdar