Aspose.Total for Java 를 통해 2단계로 PPTM 파일을 XLTX로 변환할 수 있습니다. 첫 번째 단계에서 Aspose.Slides for Java 를 사용하여 PPTM을 HTML로 내보낼 수 있습니다. 둘째, Aspose.Cells for Java 를 사용하여 HTML을 XLTX로 변환할 수 있습니다.
Java를 통해 PPTM을 XLTX로 변환 또는 온라인하는 방법
- Presentation 클래스를 사용하여 PPTM 파일을 엽니다.
- save 을 사용하여 PPTM을 HTML로 변환합니다. ISaveOptions-) 메서드
- Workbook 클래스를 사용하여 HTML 문서 로드
- save 을 사용하여 문서를 XLTX 형식으로 저장합니다. SaveOptions)) 메서드
변환 요구 사항
PPTM을 XLTX로 변환하려면 [Maven]( https://repository.aspose.com/webapp/#/artifacts/browse/tree/General/repo/com/ 에서 직접 Java용 Aspose.Total을 쉽게 사용할 수 있습니다. aspose/aspose-total) 기반 프로젝트를 만들고 pom.xml에 라이브러리를 포함합니다.
또는 다운로드 에서 ZIP 파일을 받을 수 있습니다.
// supports PPT, POT, PPS, PPTX, POTX, PPSX, PPTM, PPSM, and POTM input file formats | |
// instantiate a Presentation object that represents a PPT file | |
Presentation presentation = new Presentation("template.ppt"); | |
// save the presentation as HTML | |
presentation.save("output.html", SaveFormat.Html); | |
// load the HTML file in an instance of Workbook | |
Workbook book = new Workbook("output.html"); | |
// Supports XLS, XLSX, XLSB, XLSM, XLT, XLTX, XLTM, XLAM, CSV, TSV, TXT, MHTML, ODS, DIF, MARKDOWN, SXC, and FODS output file formats | |
// save HTML as XLS | |
book.save("output.xls", SaveFormat.Xls); |
PPTM를 XLTX로 변환하는 무료 온라인 변환기
변환 요구 사항
API를 사용하여 암호로 보호된 문서를 열 수도 있습니다. 입력한 PPTM 문서가 비밀번호로 보호되어 있는 경우 비밀번호를 사용하지 않고는 XLTX로 변환할 수 없습니다. API를 사용하면 LoadOptions 개체에 올바른 암호를 전달하여 암호화된 문서를 열 수 있습니다.
// initialize load options | |
LoadOptions loadOptions = new LoadOptions(); | |
// set password | |
loadOptions.setPassword("123123"); | |
// supports PPT, POT, PPS, POTX, PPSX, PPTM, PPSM, POTM, ODP, and OTP input file formats | |
Presentation presentation = new Presentation("template.ppt", loadOptions); | |
// save the presentation as HTML | |
presentation.save("output.html", SaveFormat.Html); | |
// load the HTML file in an instance of Workbook | |
Workbook book = new Workbook("output.html"); | |
// Supports XLS, XLSX, XLSB, XLSM, XLT, XLTX, XLTM, XLAM, CSV, TSV, TXT, MHTML, ODS, DIF, MARKDOWN, SXC, and FODS output file formats | |
// save HTML as XLS | |
book.save("output.xls", SaveFormat.Xls); |
Java를 통해 보호된 PPTM을 XLTX로 변환
PPTM 파일을 XLTX로 변환하는 동안 출력 XLTX 파일 형식에 워터마크를 추가할 수도 있습니다. 워터마크를 추가하려면 새 통합 문서를 만들어 변환된 HTML 파일을 엽니다. 인덱스를 통해 워크시트를 선택하고 모양을 만들고 addTextEffect 기능을 사용하여 색상, 투명도 등을 설정합니다. 그런 다음 Watermark를 사용하여 HTML 문서를 XLTX로 저장할 수 있습니다.
// supports PPT, POT, PPS, PPTX, POTX, PPSX, PPTM, PPSM, and POTM input file formats | |
// instantiate a Presentation object that represents a PPT file | |
Presentation presentation = new Presentation("template.ppt"); | |
// save the presentation as HTML | |
presentation.save("output.html", SaveFormat.Html); | |
// load the HTML file in an instance of Workbook | |
Workbook book = new Workbook("XlsxOutput.xlsx"); | |
// get the first default sheet | |
Worksheet sheet = book.getWorksheets().get(0); | |
// add Watermark | |
Shape wordart = sheet.getShapes().addTextEffect(MsoPresetTextEffect.TEXT_EFFECT_1, "CONFIDENTIAL", | |
"Arial Black", 50, false, true, 18, 8, 1, 1, 130, 800); | |
// get the fill format of the word art | |
FillFormat wordArtFormat = wordart.getFill(); | |
// set the color | |
wordArtFormat.setOneColorGradient(Color.getRed(), 0.2, GradientStyleType.HORIZONTAL, 2); | |
// set the transparency | |
wordArtFormat.setTransparency(0.9); | |
// make the line invisible | |
LineFormat lineFormat = wordart.getLine(); | |
lineFormat.setWeight(0.0); | |
// supports CSV, XLSB, XLSM, XLT, XLTX, XLTM, XLAM, TSV, TXT, ODS, DIF, MD, SXC, and FODS file format | |
// save HTML as XLS | |
book.save("output.xls", SaveFormat.AUTO); |