Facing issue while converting word into pdf

Hi Team,

We are facing an issue while converting the word document into PDF. Could please let us know the exact root cause and please help us to resolve the issue.
Aspose-words-24.3-jdk17.jar
java version -jdk17
Aspose-pdf-23.11-jdk17.jar

com.aspose.words.Document  document = new com.aspose.words.Document(inputFile.getAbsolutePath());
document.setWarningCallback(new Warning());
document.save(exportedFileLocation, pdfSaveOptions);

Please find the sample issue word file.
sample_issue.docx (639.7 KB)

Please find the custom font used in our app.
Custom Fonts.zip (857.4 KB)

java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "com.aspose.words.zzWcK.zzZzF(com.aspose.words.Border)" because "<local5>" is null
	at com.aspose.words.zzWtT.zz5u(Unknown Source)
	at com.aspose.words.zzWZg.zzXQW(Unknown Source)
	at com.aspose.words.zzYJG.zzXQW(Unknown Source)
	at com.aspose.words.zzZg7.zzXQW(Unknown Source)
	at com.aspose.words.zzZBT.zzXQW(Unknown Source)
	at com.aspose.words.zzWkG.zzXQW(Unknown Source)
	at com.aspose.words.zzVR7.zzXQW(Unknown Source)
	at com.aspose.words.zzY1U.zzXQW(Unknown Source)
	at com.aspose.words.zzWtT.zz5u(Unknown Source)
	at com.aspose.words.zzWtT.zzXQW(Unknown Source)
	at com.aspose.words.Document.zzXQW(Unknown Source)
	at com.aspose.words.zzWEf.zzO1(Unknown Source)
	at com.aspose.words.zzWEf.zzXQW(Unknown Source)
	at com.aspose.words.zzZT.zzXQW(Unknown Source)
	at com.aspose.words.Document.zzO1(Unknown Source)
	at com.aspose.words.Document.zzXQW(Unknown Source)

@forasposeissues

Looks like your issue is related to Aspose.Words. So, we are moving this to respective forum category where you will be assisted accordingly.

@forasposeissues Unfortunately, I cannot reproduce the problem on my side neither using 24.3 nor using 24.4 version of Aspose.Words. I used the following code for testing:

FontSettings.getDefaultInstance().setFontsSources(new FontSourceBase[] { new SystemFontSource(), new FolderFontSource("C:\\temp\\fonts", true) });

Document doc = new Document("C:\\Temp\\in.docx");
doc.setWarningCallback(new FontSubstitutionWarningCollector());
doc.save("C:\\Temp\\out.pdf");

Hi Team,

When you will check the word document at page number 9 at the end of page, You see the paragraph spacing is present. If we remove the paragrapgh spacing then I am not facing the issue. But, when paragraph spacing is present then issue is coming. I am attaching the screen shot so that you get the reference.

Thanks

@forasposeissues I am afraid I still cannot preproduce the problem on my side. Could you please attach input DOCX document that causes the exception upon conversion on your side? The document attached in the initial post does not allow us to reproduce the problem.

HI Team,

Please find the docx in which issue exist. Please DON’T modify the document.
Please help to analyze the page number 9.

sample_issue.docx (639.7 KB)

@forasposeissues Thank you for addition information. Unfortunately the problem is still not reproducible on my side. The document is successfully converted to PDF on my side. Aspose.Words does not throw any exceptions. I see only the following warning upon conversion:

Font 'MS Shell Dlg 2' has not been found. Using 'Tahoma' font instead. Reason: table substitution.

Hi Team,

We are still facing issue with the document which we attached in initial post. Also, we are facing the issue with updated document. I am sharing the update document.

As I mentioned, that at end of page number 9 when we remove the paragraph spacing then it issue is not coming.
But, when paragraph spacing is not removed then issue is coming.
Please help to investigate the issue further.

issue_sample_doc.docx (658.2 KB)

@forasposeissues Could you please create a simple application that will allow us to reproduce the problem on our side and describe the environment where the problem is reproducible. I have checked the conversion on my side once again and still the problem is not reproducible. Here is PDF document produced on my side:
out.pdf (680.0 KB)

Hi Team,

Please find the simple app as a sample. We are facing on all environment.
I am afraid that this issue can create noise.

Appreciate for help.
sample_app.zip (1.5 KB)

@forasposeissues Thank you for additional information. I tested with the provided code and the problem is still not reproducible on my side. I will ask my colleagues to test on their side too.

Hi Team,

Any update on the given issue?

@forasposeissues Unfortunately, we are unable to reproduce the problem on our side. We have tested the scenario n different machines and still the problem is not reproducible. Could you please create a compilable application that allows to reproduce the problem?

Hi Team,

Please find the compiled app in which we are facing issue.
compiled.zip (3.1 KB)

@forasposeissues Thank you for additional information. As I can see you have shared the same code as was shared earlier. Unfortunately, the problem is still not reproducible on our side. Your code works fine and no exceptions are thrown. Here is PDF document produced on my side using your code:
out.pdf (680.1 KB)

Could you please try create a simple console application from scratch and use the following code for testing on your side?

Document doc = new Document("C:\\Temp\\in.docx");
doc.save("C:\\Temp\\out.pdf");

Does Aspose.Words thrown an exception on your side upon executing this simple code?