Text and hyperlink missing when saving as pdf

Hi,

when I save the attached word document as pdf I see that some text and links in the foot note are missing in the pdf.
Below is the code snippet used,

Document doc = new Document(input);
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setHeadingsOutlineLevels(6);
saveOptions.setExpandedOutlineLevels(5);
saveOptions.setBookmarksOutlineLevel(9);
saveOptions.setTextCompression(PdfTextCompression.NONE);
saveOptions.setPreserveFormFields(true);
doc.acceptAllRevisions(); 
doc.save(output, saveOptions);

Please comment.

Hi Shyama,
Thanks for your inquiry. Could you please share again the actual source document? So we will test the scenario at our side and suggest you accordingly. As highlighted text and hyperlinks in the image file are already missing in the shared source document (dataLoss.docx).
Please feel free to contact us for any further assistance.
Best Regards,

Hi Tilal,

I do see the text in the attached document. I am using Word 2007 on a windows xp machine.Please let me know if anything else is needed

Hi Shyama,
Sorry for the inconvenience faced. Unfortunately, I couldn’t reproduce the issue at my side, while using latest version of Aspose.Words i.e. v11.6.0. Please find attached PDF documents generated from Aspose.Words and MS Word for your reference. Could you please share the PDF file generated from MS Word, for further investigation?
Please feel free to contact us for any further assistance.
Best Regards,

Hi Tilal,

Thank you the response. I am not sure why the document when opened in your machine does not show the text. I also tried opening the document in Document Explorer tool provided by aspose in the demos folder. Attaching screenshots when viewing the document using the tool. As you can see I can see the text when opening the document using your tool.

Hi
Shyama,

Thanks for the additional information and sorry for the delayed response. This problem occurs because those particular sets of text are marked as ‘Hidden Text’. In MS WORD 2007, you can turn off/on this feature by doing the following steps:

Click on the ‘Office Button’.
Click on ‘Word Options’ button.
Select the ‘Display’ tab on the left.
Check/Un-check ‘Hidden Text’ option.

Moreover, to be able to render that hidden text to PDF, please try using the following code snippet:

Document doc = new
Document(@"C:\test\dataLoss.docx");
foreach (Run r in doc.GetChildNodes(NodeType.Run, true))
r.Font.Hidden = false;
doc.Save(@"C:\test\out.pdf");

I hope, this will help.

Best Regards,