Convestation Issue Word to Pdf

Hello Aspose Team,

We’ve encountered an issue while converting certain .docx files to .pdf format using Aspose.Words for .NET. The problem appears consistently with specific documents, while others convert without issues.

I’ve attached an example document and a minimal .NET test application to help you reproduce the problem. Please investigate and let us know the cause and any recommended solutions or workarounds.
https://drive.google.com/file/d/1lc28GtCWoDS_frvnUZedVrZw6Ppk35BE/view?usp=sharing
24920_AKT_ROZSHIRENIJ_VW_AKCIYA__1_2025_docx (2).docx (42.6 KB)

Thank you for your assistance.

Best regards,
Oleh

@Oleh96khomyn

Hello Oleh,

Thank you for reaching out regarding the issue you’re experiencing while converting .docx files to .pdf format using Aspose.Words for .NET.

To troubleshoot the conversion problem, here are a few steps you can take:

  1. Check Document Compatibility: Ensure that the .docx file you are trying to convert does not contain any unsupported features or formatting that might cause issues during conversion. Sometimes, specific elements in the document can lead to conversion failures.

  2. Use the Latest Version: Make sure you are using the latest version of Aspose.Words for .NET. Updates often include bug fixes and improvements that could resolve your issue.

  3. Test with a Minimal Example: Since you have provided a minimal .NET test application, ensure that it is correctly set up to load and convert the document. Here’s a basic example of how to convert a .docx file to PDF:

    using Aspose.Words;
    
    class Program
    {
        static void Main(string[] args)
        {
            // Load the document
            Document doc = new Document("path/to/your/document.docx");
            
            // Save the document as PDF
            doc.Save("path/to/output/document.pdf");
        }
    }
    
  4. Error Handling: Implement error handling in your code to catch any exceptions that may provide more insight into what is going wrong during the conversion process.

  5. Review Logs: If you have logging enabled, check the logs for any error messages or warnings that could indicate the source of the problem.

  6. Contact Support: If the issue persists, consider reaching out to Aspose support with the specific document and code you are using. Providing them with the document will help them reproduce the issue and offer a more tailored solution.

If you have any further questions or need additional assistance, feel free to ask!

Best regards.

@Oleh96khomyn I cannot reproduce the problem on my side. but it looks like the problem with fonts on your side. Here is the output produced by your code on my side:
out.pdf (111.0 KB)

Here is your output PDF:
output2.pdf (111.5 KB)

As you can see the files use different fonts.

Usually, the such problems occur because the fonts used in your input document are not available on the machine where document is converted to PDF. The fonts are required to build document layout. If Aspose.Words cannot find the font used in the document, the font is substituted . This might lead into fonts mismatch and document layout differences due to the different fonts metrics. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to learn where Aspose.Words looks for fonts:
https://docs.aspose.com/words/net/specifying-truetype-fonts-location/