Text present inside rectangular color box with underneath table comes as empty in word to pdf conversion

Hi Team,

Text present inside rectangular color box with underneath table comes as empty in word to pdf conversion. The word to pdf conversion was done through Aspose word API. Attached are the java program and sample document attached. This issue occurs only with Aspose Words API and if we do pdf conversion directly from word application then PDF conversion comes correctly by including all contents. Is there any known issue or solution available to this use case ? If there is no solution available , Can we consider this use case as defect in Aspose Words API.

Java Program

import com.aspose.words.*;

public class WordtoPDF {

    public static void main(String args[]){

        try{
            System.out.println("Aspose version --- " + BuildVersionInfo.getVersion());
            Document doc = new Document("C:\\SAMPLE-Document.docx");

            PdfSaveOptions options = new PdfSaveOptions();
            options.setSaveFormat(SaveFormat.PDF);
            options.setPreserveFormFields(true);
            options.setEmbedFullFonts(true);
            options.setExportDocumentStructure(true);

            doc.save("C:\\output.pdf", options);

            System.out.println("PDF Conversion Done");
        }
        catch(Exception ex){
            System.out.println("Exception occurred");
            ex.printStackTrace();
        }
    }
}

SAMPLE-Document.docx (12.5 KB)

@rnara

It appears you are encountering an issue where text within a rectangular color box, along with an underlying table, is not visible in the PDF generated from a Word document using the Aspose Words API. This problem does not occur when converting the document directly through Microsoft Word, indicating a potential rendering issue with the Aspose library.

Here are several steps you can take to troubleshoot and potentially resolve this issue:

  1. Update Aspose Library: Ensure you are using the latest version of the Aspose Words library, as newer releases often include bug fixes and improvements.

  2. Check Document Structure: Review the structure of your Word document. Make sure that the text and table are properly formatted and not overlapping in a way that could confuse the rendering engine.

  3. Adjust PDF Save Options: Experiment with different PdfSaveOptions. For instance, you might try disabling setEmbedFullFonts(true) to see if it impacts the output.

  4. Use Alternative Rendering: If the issue persists, consider converting the document to an intermediate format (such as HTML or DOCX) before converting it to PDF. This approach can sometimes help bypass rendering issues.

Here’s a minimal code snippet to illustrate how you might convert to HTML first:

Document doc = new Document("C:\\SAMPLE-Document.docx");
doc.save("C:\\output.html", SaveFormat.HTML);

// Then convert HTML to PDF
Document htmlDoc = new Document("C:\\output.html");
htmlDoc.save("C:\\output.pdf", SaveFormat.PDF);
  1. Report the Issue: If none of the above solutions resolve the problem, consider reporting this as a potential defect in the Aspose Words API. Provide them with your sample document and the code you are using, as this will assist them in investigating the issue further.

If you continue to face challenges, reach out to Aspose support with detailed information about your issue, including the version of the library you are using and the specific document that is causing the problem.

Please let me know if you need further assistance!

@rnara
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): WORDSNET-28624

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.

The issues you have found earlier (filed as WORDSNET-28624) have been fixed in this Aspose.Words for Java 25.10 update.