I'm trying to convert a PDF file to HTM using java library - (spire.office 10.1.0) - with the following code :
- Code: Select all
PdfDocument doc = new PdfDocument();
doc.loadFromStream(Files.newInputStream(originalFile));
//Load a sample PDF document
OutputStream returnedOutputStream = Files.newOutputStream(returnedFile) ;
if (expectedFileFormat.equals(com.spire.pdf.FileFormat.SVG)) {
doc.getConvertOptions().setOutputToOneSvg(true);
}
if (expectedFileFormat.equals(com.spire.pdf.FileFormat.HTML)) {
doc.getConvertOptions().setPdfToHtmlOptions(true);
}
//Convert PDF to Doc and save it to a specified path
doc.saveToStream(returnedOutputStream, expectedFileFormat);
doc.close();
I receive the following exception - and no documentation about it.
java.lang.NullPointerException: Cannot invoke "com.spire.pdf.packages.sprghg.spr≂⑊(com.spire.pdf.packages.sprskg)" because "this.spr‼" is null
I uploaded the file in attachement.
Could you help me on this exception ?
Best regards
Steve Favez