Last active
December 17, 2015 18:49
-
-
Save rebizant/5655622 to your computer and use it in GitHub Desktop.
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
public class Main { | |
public static void main(String[] args) throws Exception{ | |
Main main = new Main(); | |
for(int i = 0; i < 1000 ; i++){ | |
main.convert(i); | |
} | |
} | |
private void convert(int i) throws Exception { | |
InputStream doc = getStreamFromResource("/example.doc"); | |
ByteArrayOutputStream docAsPdf = new ByteArrayOutputStream(); | |
new Document(doc).save(docAsPdf, new PdfSaveOptions()); | |
System.out.println("converted iteration "+i); | |
} | |
private InputStream getStreamFromResource(String resource) { | |
return Main.class.getResourceAsStream(resource); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment