Skip to content

Instantly share code, notes, and snippets.

@toshimasa-nanaki
Created November 6, 2017 13:15
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 toshimasa-nanaki/95082210a3373cd2b02f74108e8890e9 to your computer and use it in GitHub Desktop.
Save toshimasa-nanaki/95082210a3373cd2b02f74108e8890e9 to your computer and use it in GitHub Desktop.
JODConverter4.1.0 tmpファイルエラー
import java.io.File;
import org.jodconverter.DocumentConverter;
import org.jodconverter.LocalConverter;
import org.jodconverter.office.LocalOfficeManager;
import org.jodconverter.office.OfficeException;
import org.jodconverter.office.OfficeManager;
public class LibrePdfOutputTest {
public static final String SRC_FILE_PATH = "D:\\temp\\test.tmp";
public static final String DEST_FILE_PATH = "D:\\temp\\test.pdf";
public static void main(String[] args) throws OfficeException {
File srcFile = new File(SRC_FILE_PATH);
File destFile = new File(DEST_FILE_PATH);
OfficeManager officeManager = LocalOfficeManager.make();
DocumentConverter converter = LocalConverter.make(officeManager);
officeManager.start();
try {
converter.convert(srcFile).to(destFile).execute();
} finally {
officeManager.stop();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment