Hi Tahir
Thanks for your reply and the help that you have been giving me.
I have finally narrowed down the problem. Its not down to environment but rather something how Aspose.Words is handling the word file
I have attached a new Ms Word DOCX File (test.docx) that illustrates the problem. If you just download the MS Word DOCX (test.docx) file and run the conversion code on it without editing the ms word file, you will find that all the tables have been collapsed as is in my attached pdf file (test-pdf-collapsed,pdf). However, If you open the MS Word file (test.docx) and the then edit it (e.g. add a space anywhere in the file) and then save it in MS Word and then run the conversion code on it. Everything comes out OK (see test-ok.pdf).
We are using OpenXML to generate the word file just for your information.
So what can be the problem?
As your are aware, it will be unacceptable for us to open ms word on a server, edit the word file and then run the conversion.
The full code that I am using for the conversion is
class Program
{
static void Main(string[] args)
{
String strWordFile = “”, strPDFFile="";
if (args == null || args.Length < 2)
throw new ArgumentException(“Invalid arguements provided. Have you provided the name of the MS Word File to be converted and the name of the PDF file”);
// Get the name of the ms word file to be converted
if (args[0] != null || !"".Equals(args[0]))
strWordFile = args[0] as String;
// Get the name of converted PDF file
if (args[1] != null || !"".Equals(args[1]))
strPDFFile = args[1] as String;
if (!File.Exists(strWordFile))
throw new ArgumentException(“The MS Word file’” + strWordFile + "’ provided does not exist. ");
//Convert the file to PDF
Document doc = new Document(strWordFile);
doc.Save(strPDFFile, SaveFormat.Pdf);
}
}
Hope to hear from you soon and thanks for your time
Kind regards