We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word to pdf save error

Hi,


I attached our original word doc, errorring pdf doc and test project.
We browse and upload word doc and click the convert to pdf button.
Thanks
Hi Ahmet,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-14700. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Ahmet,

Thanks for your patience. Please note that Aspose.Words mimics the same behavior as MS Word does. In your code example, you are setting table's text wrapping as "Around". If you change the table's text wrapping using MS Word, the GroupShape position is also changed.

Could you please share your expected output document here for our reference?

The part of the code that checks if a table is in header/footer makes an unnecessary traversing of all headers/footers for each table in the document. Checking if a node is in a header/footer can be done much more effectively, please see an example below.

Document doc = new Aspose.Words.Document(MyDir + "POLITIKA-0194.doc");

foreach (Aspose.Words.Tables.Table table in doc.GetChildNodes(Aspose.Words.NodeType.Table, true))

{

bool isHF = false;

isHF = (table.GetAncestor(NodeType.HeaderFooter) != null);

//foreach (Aspose.Words.HeaderFooter hf in doc.GetChildNodes(Aspose.Words.NodeType.HeaderFooter, true))

//{

// foreach (Aspose.Words.Tables.Table table1 in hf.GetChildNodes(Aspose.Words.NodeType.Table, true))

// {

// if (table1 == table)

// {

// isHF = true;

// break;

// }

// }

// if (isHF) break;

//}

if (!isHF)

table.TextWrapping = Aspose.Words.Tables.TextWrapping.None;

}

doc.Save(MyDir + "out v16.12.0.pdf");