NullReferenceException when Converting PDF to Word in C#

Hi,

Tested OSs were Win7 and Win10
.NET target platform is .net 6.0
Using SDK: Aspose.PDF for .Net 24.3
Using file:
AS1205_Datasheet-1.7z (824.6 KB)

@kngstr
This is a section of the Aspose.Pdf product.
I will move your question to the appropriate section of the forum.

@sergei.shibanov
Sorry. Thanks.

@kngstr,
The issue doesn’t seem to be related to Aspose.Slides. Could you kindly describe the problem in more detail and share a code example that reproduces the problem?

@andrey.potapov
Sorry. I made a mistake. Now it’s been moved to pdf section.

Please write what you did and what you expected to receive.
In the description you have Aspose.Slides for .Net 24.3, in the archive there is a pdf document (with a non-embedded font).
1.png (85.3 KB)
And it’s not even clear what product you’re dealing with.

@sergei.shibanov
Sorry for my mistake. It should be Aspose.PDF for .net 24.3. It’s corrected.
Is that font cause this issue?

@kngstr
It didn’t get any clearer.
Are you converting a pdf document to slides?
Or, on the contrary, do you make pdf from slides?
Please write what you are doing, attach the source document and the code used.
Perhaps the resulting document, indicating that this is the resulting document and what is wrong with it.
Then it will be clear what is being done, we can try to reproduce it and either advise something, or create a task to the developers to fix it.

@sergei.shibanov
Sorry to write the wrong sdk in the topic.

@asad.ali
Please take a look at this topic.
I got Object reference not set to an instance of an object when converting pdf to word using pdf for .net.
Testing code

using Aspose.Pdf;

void ConvertPDFtoWord_DOCX_Format_Page1(string filename)
{
    // Open the source PDF document
    Document pdfDocument = new Document(filename);
    // Save the resultant DOC file
    pdfDocument.Save(filename + "saveOptionsOutput_out.doc", SaveFormat.DocX);
}

Exception detail

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=Aspose.PDF
  StackTrace:
   在 #=zwDke0qLP6_TZqOtxwhERJdjnkybXKwUQ8BpY1JaUlMnB.#=zUlezqQv$8_F1()
   在 #=zVQJX7Axdvkip71gRUNFzzeqfDe3XCzRWz7fE9YfclH5H466D7Q==.#=zrAa79sY=(#=zq4EcwWUNU5$UAcJIvUU02uoQPrB$dYvI3VtHlLg49FqW #=zXyMetCM=, #=zqJg20T2wNGfRaLq7M13GMt8$F3IjipWZrcnCfBZHA5bG #=zYRKNNTLpT1Nd, #=znxc0OTuThdy1BWF1ywUnpRuhXwYdWL4msg== #=zxqhRwjw=)
   在 #=z4FTteMyuNTbEeQOt3Yq8dYOkocCyeUzrKXYgY70whI7YRR7p8g==.#=zrAa79sY=(#=zq4EcwWUNU5$UAcJIvUU02uoQPrB$dYvI3VtHlLg49FqW #=zXyMetCM=, #=zqJg20T2wNGfRaLq7M13GMt8$F3IjipWZrcnCfBZHA5bG #=zYRKNNTLpT1Nd)
   在 #=zs71scsxPtkQdVQAvuAmfiZ7YqXpDd03y6$4WQlK2eQr1.#=zqkdpDiUMx2enLlu1Qg==(#=zq4EcwWUNU5$UAcJIvUU02uoQPrB$dYvI3VtHlLg49FqW #=zXyMetCM=, List`1 #=z90y7U04=)
   在 #=zs71scsxPtkQdVQAvuAmfiZ7YqXpDd03y6$4WQlK2eQr1.#=zEcCRELMXJEI3zzgyig==(#=zq4EcwWUNU5$UAcJIvUU02uoQPrB$dYvI3VtHlLg49FqW #=zXyMetCM=, List`1 #=z90y7U04=)
   在 #=zs71scsxPtkQdVQAvuAmfiZ7YqXpDd03y6$4WQlK2eQr1.#=zS8fGQDkHoLQe(#=zq4EcwWUNU5$UAcJIvUU02uoQPrB$dYvI3VtHlLg49FqW #=zXyMetCM=, List`1 #=zcs_mF3wcBGs8)
   在 #=zs71scsxPtkQdVQAvuAmfiZ7YqXpDd03y6$4WQlK2eQr1.#=zlGTNJbg=(#=zF61khbxO4AIqtTJ2rte2rHFHNjA8 #=zAedmv4o=, #=zzLq4EBXXnJzaMujtRdvyNPLXY5fDo4RP4Q== #=z5pkMFAk=, #=zq4EcwWUNU5$UAcJIvUU02uoQPrB$dYvI3VtHlLg49FqW #=zXyMetCM=)
   在 #=zj1vbiTPyjrGyHwTCbLkcr0e533T6Mzrzow==.#=zzRNNkko=(Int32 #=zSqrENbM=, IList`1 #=zc4s2tnryHR2Dq4F$qQ==, #=zbGtuNggT_5EA #=zfy5i9CM=)
   在 #=zj1vbiTPyjrGyHwTCbLkcr0e533T6Mzrzow==.#=zlGTNJbg=()
   在 #=zOfFNzb1ieB_RU$$C5Dl2ACv8JF8m.#=zhGSoIig2ajmx(Document #=zAedmv4o=, #=zq4EcwWUNU5$UAcJIvUU02uoQPrB$dYvI3VtHlLg49FqW& #=z2ShnzR9mCJvs5k6qSw==, UnifiedSaveOptions #=zqe2caRU=, Int32& #=zOlVR1qcvlNBt, Boolean #=zUahZJyg=)
   在 #=zQWtIEQVPsZ$GWCalsxp3aTg=.#=z$YL6y2E=(Document #=zAedmv4o=, Stream #=zXA8oysAiF2Fl, DocSaveOptions #=zqe2caRU=)
   在 Aspose.Pdf.Document.#=zzLs2J7A7JQIm(Stream& #=zXA8oysAiF2Fl, SaveOptions #=zqe2caRU=)
   在 Aspose.Pdf.Document.#=zhcvra9QXUIQv(Stream #=zXA8oysAiF2Fl, SaveOptions #=zqe2caRU=)
   在 Aspose.Pdf.Document.#=zhcvra9QXUIQv(Stream #=zXA8oysAiF2Fl, SaveFormat #=zgRRFbR4=)
   在 Aspose.Pdf.Document.#=zhcvra9QXUIQv(String #=zF1SiQu9$r2WB, SaveFormat #=zgRRFbR4=)
   在 Aspose.Pdf.Document.Save(String outputFileName, SaveFormat format)
   在 Program.<<Main>$>g__ConvertPDFtoWord_DOCX_Format_Page1|0_3(String filename) 在 C:\.NET\ConsoleApp1\ConsoleApp1\Program.cs 中: 第 53 行

@kngstr
Thanks for the information provided.
I’ve reproduced the problem (it actually stems from an incorrect description of the DejaVuMathTeXGyre font in the document) and will create a task for the development team.

@sergei.shibanov
Thanks.

@kngstr
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-57065

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.