Thank you. I think i know what I have to do now but I have another problem. I can’t save the pdf to word. I’ve even made a simple console application to test and I get the same error as I get in my main project.
using System;
using Aspose.Pdf;
using System.IO;
namespace TestSaveToWord {
class Program {
static void Main(string[] args) {
Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();
pdfLicense.SetLicense("Aspose.Total.lic");
var pdfPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "test.pdf");
var convertedDocumentPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "converted.docx");
var pdfDocument = new Aspose.Pdf.Document(pdfPath);
pdfDocument.Save(convertedDocumentPath, SaveFormat.DocX);
}
}
}
Here’s the error:
System.NullReferenceException: “Object reference not set to an instance of an object.”
at #=ziKqhTtbZyw4BkKUoT3mSpy$$his87ZdTcN0Ipx1P5Xl1.#=zY0HQtGNGVXQL()\n at #=zYZ5l8bOG4jJ0dhDSp4m6BvfA7peTLd8o7VEFOvOW$nIViAB4GA==.#=z_6qXGUg=(#=z5wmixPgpid2CI$g7rMTfGvRodRnNvyTQCLJbq93Lh3sL #=zyhysdIE=, #=zT402Il0$NabGYcvoJ7Px6jagchRV6Y26r288wTszdHS5 #=zKLaXDfM3B9co, #=zu6AdRgQQR8r3Yj$A4nwTdC$ENBMeulK1gg== #=zccMJ$Sk=)\n at #=zNZBu6ev$eg5$HS2CqfQEhMbcocL5SQSW3o6JucC__CVL5VK$kg==.#=z_6qXGUg=(#=z5wmixPgpid2CI$g7rMTfGvRodRnNvyTQCLJbq93Lh3sL #=zyhysdIE=, #=zT402Il0$NabGYcvoJ7Px6jagchRV6Y26r288wTszdHS5 #=zKLaXDfM3B9co)\n at #=ztxquhYRowjnsZQxP8GiFPl9msiEAGiFvny2PTFP6sJjS.#=zBudKJpbY2zTPqyCaRw==(#=z5wmixPgpid2CI$g7rMTfGvRodRnNvyTQCLJbq93Lh3sL #=zyhysdIE=, List1 #=zKwldhkE=)\n at #=ztxquhYRowjnsZQxP8GiFPl9msiEAGiFvny2PTFP6sJjS.#=zQhPGlV$TEzLjLEdYag==(#=z5wmixPgpid2CI$g7rMTfGvRodRnNvyTQCLJbq93Lh3sL #=zyhysdIE=, List
1 #=zKwldhkE=)\n at #=ztxquhYRowjnsZQxP8GiFPl9msiEAGiFvny2PTFP6sJjS.#=zU7PTtTBj985L(#=z5wmixPgpid2CI$g7rMTfGvRodRnNvyTQCLJbq93Lh3sL #=zyhysdIE=, List`1 #=zapfjkeHIyIOq)\n at #=ztxquhYRowjnsZQxP8GiFPl9msiEAGiFvny2PTFP6sJjS.#=ziRIh4sc=(#=zxomKc57lhYWWyabT41VMWKEgQxuu #=z94utm9E=, #=z8JzRwMDnRYyPoUkGXOTktEFHW4$NFkcKwQ== #=z78kbUMo=, #=z5wmixPgpid2CI$g7rMTfGvRodRnNvyTQCLJbq93Lh3sL #=zyhysdIE=)\n at #=zpzdvbeStk5TK_Z4qaPrct0JUvLhq.#=zYuQR3N5vpScV(Document #=z94utm9E=, #=z5wmixPgpid2CI$g7rMTfGvRodRnNvyTQCLJbq93Lh3sL& #=z2P9l6qDLdfYyHHWn1A==, UnifiedSaveOptions #=zMLVC6rY=, Int32& #=zWj9Zjj7SgTpd)\n at #=zpzdvbeStk5TK_Z4qaPrct0JUvLhq.#=znI6ZvrMYMhbQHVaCJQ==(Document #=z6skZ2su9HLnq, #=z5wmixPgpid2CI$g7rMTfGvRodRnNvyTQCLJbq93Lh3sL& #=zyhysdIE=, UnifiedSaveOptions #=zMLVC6rY=, Int32& #=zp9R_w8KHi3$f)\n at #=znNxpe9SuOaMhbr9aRPqKf7g=.#=zIy49nFs=(Document #=z6skZ2su9HLnq, Stream #=zdtdDQcQJo9RS, DocSaveOptions #=zMLVC6rY=)\n at Aspose.Pdf.Document.#=z4laxV7ngq0$_(String #=zNo3Cfw2oI6lO, SaveFormat #=zLP9ruF0=)\n at Aspose.Pdf.Document.Save(String outputFileName, SaveFormat format)\n at TestSaveToWord.Program.Main(String[] args) in /Users/[redacted]/Documents/Development/TestSaveToWord/TestSaveToWord/Program.cs:14
I basically get a null reference exception every time I try to save to a word document. Can you help please? Thank you.