use of org.apache.poi.xwpf.converter.pdf.PdfOptions in project Gargoyle by callakrsos.
the class PDFUtil method convert.
/**
* @작성자 : KYJ
* @작성일 : 2017. 3. 3.
* @param docxFile
* @param outPdfFile
* @throws FileNotFoundException
* @throws IOException
*/
public static void convert(XWPFDocument document, File outPdfFile) throws FileNotFoundException, IOException {
try (OutputStream out = new FileOutputStream(outPdfFile)) {
PdfOptions options = PdfOptions.getDefault();
PdfConverter.getInstance().convert(document, out, options);
}
}
use of org.apache.poi.xwpf.converter.pdf.PdfOptions in project Gargoyle by callakrsos.
the class MSWordTest method toPdf.
@Test
public final void toPdf() throws FileNotFoundException, IOException {
File file = new File("C:\\Users\\KYJ\\Desktop\\학습\\Algorism.docx");
XWPFDocument document = new XWPFDocument(new FileInputStream(file));
File outFile = new File("Algorism.pdf");
try (OutputStream out = new FileOutputStream(outFile)) {
PdfOptions options = PdfOptions.getDefault();
PdfConverter.getInstance().convert(document, out, options);
}
System.out.println("Sucess");
FileUtil.openFile(outFile);
}
Aggregations