Java에서 PDF를 PowerPoint로 변환
Contents
[
Hide
]
Aspose.PDF for Java는 슬라이드 렌더링 옵션을 사용하여 PDF 페이지를 편집 가능한 PowerPoint 프레젠테이션으로 내보내는 것을 지원합니다. PDF 페이지가 PowerPoint 슬라이드에 매핑되는 방식을 제어하려면 PptxSaveOptions를 사용하세요.
PDF를 PPTX로 변환
PDF 문서를 표준 PowerPoint 프레젠테이션으로 내보내야 하는 경우 이 예를 사용하세요.
Document인스턴스에서 소스 PDF를 여세요.- 편집 가능한 PowerPoint 내보내기를 위한 기본값
PptxSaveOptions를 만드세요. document.save(outputFile.toString(), saveOptions)를 호출하세요. PDF 페이지가.pptx프레젠테이션으로 직렬화됩니다.- 변환된 PPTX 파일을 저장하세요.
public static void convertPdfToPptx(Path inputFile, Path outputFile) {
try (Document document = new Document(inputFile.toString())) {
PptxSaveOptions saveOptions = new PptxSaveOptions();
document.save(outputFile.toString(), saveOptions);
}
System.out.println(inputFile + " converted into " + outputFile);
}
슬라이드를 이미지로 사용하여 PDF를 PPTX로 변환
각 PDF 페이지가 이미지 기반 PowerPoint 슬라이드가 되어야 하는 경우 이 예를 사용하세요.
Document인스턴스에서 소스 PDF를 여세요.PptxSaveOptions를 만들고setSlidesAsImages(true)를 활성화하세요.document.save(outputFile.toString(), saveOptions)를 호출하세요. 각 PDF 페이지가 프레젠테이션에서 이미지 기반 슬라이드로 렌더링됩니다.- 생성된 PPTX 파일을 저장하세요.
public static void convertPdfToPptxSlidesAsImages(Path inputFile, Path outputFile) {
try (Document document = new Document(inputFile.toString())) {
PptxSaveOptions saveOptions = new PptxSaveOptions();
saveOptions.setSlidesAsImages(true);
document.save(outputFile.toString(), saveOptions);
}
System.out.println(inputFile + " converted into " + outputFile);
}
사용자 정의 이미지 해상도를 사용하여 PDF를 PPTX로 변환
PDF를 PPTX로 내보내는 동안 슬라이드 이미지 품질을 제어해야 하는 경우 이 예를 사용하세요.
Document인스턴스에서 소스 PDF를 여세요.- 더 높은 슬라이드 이미지 충실도를 위해
PptxSaveOptions를 만들고setImageResolution(300)를 설정하세요. document.save(outputFile.toString(), saveOptions)를 호출하세요. 래스터화된 슬라이드 콘텐츠가 요청된 해상도로 생성됩니다.- 출력 프레젠테이션을 저장하세요.
public static void convertPdfToPptxImageResolution(Path inputFile, Path outputFile) {
try (Document document = new Document(inputFile.toString())) {
PptxSaveOptions saveOptions = new PptxSaveOptions();
saveOptions.setImageResolution(300);
document.save(outputFile.toString(), saveOptions);
}
System.out.println(inputFile + " converted into " + outputFile);
}