import com.aspose.pdf.Document;
import com.aspose.pdf.SaveFormat;
public class PDFWORD {
public static void main(String[] args) {
// Open the source PDF document
com.aspose.pdf.License license = new com.aspose.pdf.License();
// Call setLicense method to set license
try {
license.setLicense("c:\\Aspose.Pdf.lic");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Document pdfDocument = new Document("c:\\xx.pdf");
// Save the file into Microsoft document format
pdfDocument.save("c:\\xxx.doc", SaveFormat.Doc);
}
}
We are using the above code to save pdf file in doc format. We have a temporary license obtained from Aspose. The code runs fine up until the statement
pdfDocument.save
which produces “unknown source” error.
How can we solve this problem?