Skip to content

Instantly share code, notes, and snippets.

@rebizant
Last active December 17, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rebizant/5655622 to your computer and use it in GitHub Desktop.
Save rebizant/5655622 to your computer and use it in GitHub Desktop.
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