This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yeo Kheng Meng
committed
Nov 28, 2013
1 parent
d7cd9d9
commit f58ccd7
Showing
5 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
docs-to-pdf-converter/src/com/yeokhengmeng/docstopdfconverter/OdtToPDF.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.yeokhengmeng.docstopdfconverter; | ||
|
||
import java.io.FileInputStream; | ||
import java.io.FileOutputStream; | ||
|
||
import org.odftoolkit.odfdom.converter.pdf.PdfConverter; | ||
import org.odftoolkit.odfdom.converter.pdf.PdfOptions; | ||
import org.odftoolkit.odfdom.doc.OdfTextDocument; | ||
|
||
|
||
public class OdtToPDF extends Converter { | ||
|
||
public OdtToPDF(String inputFilePath, String outputFilePath) { | ||
super(inputFilePath, outputFilePath); | ||
} | ||
|
||
@Override | ||
public void convert() throws Exception { | ||
startTime(); | ||
showLoadingMessage(); | ||
|
||
FileInputStream inStream = getInFileStream(); | ||
OdfTextDocument document = OdfTextDocument.loadDocument(inStream); | ||
|
||
PdfOptions options = PdfOptions.create(); | ||
FileOutputStream out = getOutFileStream(); | ||
|
||
showProcessingMessage(); | ||
PdfConverter.getInstance().convert(document, out, options); | ||
|
||
showFinishedMessage(); | ||
|
||
|
||
} | ||
|
||
} |