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

Free Support Forum - aspose.com

Header formatting issues when converting from Word to PDF

Hello,

I have a word document with a header that has address information left justified and a company logo tabbed to the right hand side of the page. When I convert this word document to a PDF file (see code below) the logo appears on the left hand column instead of the right hand column. My customer has Aspose.Words (4.4.3.0) and Aspose.Pdf (3.6.1.0).

My question is, am I missing code to format this correctly or is this a bug in the version of Aspose.Words or .Pdf I am using?

Any help would be appreciated.

Regards,
JP

public bool GeneratePDFFromWord(string wordFile, string pdfFile)
{
try
{
// New a Doc object.
AspWords.Document doc = new AspWords.Document(wordFile);
string tempFileName = System.IO.Path.GetTempFileName();
File.Delete(tempFileName);
// Save the doc in a xml fille that can be handled by Aspose.Pdf.
doc.Save(tempFileName, AspWords.SaveFormat.AsposePdf);
// New a pdf object.
AspPdf.Pdf pdf = new AspPdf.Pdf();
// Bind content from the named xml file.
pdf.BindXML(tempFileName, null);
//Instruct to delete temporary image files.
pdf.IsImagesInXmlDeleteNeeded = true;
// Set Font Map for better performance
pdf.IsTruetypeFontMapCached = true;
pdf.TruetypeFontMapPath = Path.GetTempPath();
// Save the result
pdf.Save(pdfFile);
}
catch (Exception e)
{
return false;
}
return true;
}

Hello Paul,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please use the latest versions of Aspose.Words which is v5.2.2.0 and Aspsoe.Pdf v3.7.0.0. Incase the issue is still there, please share the Word file with us, so that we can test the issue at our end.