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

Free Support Forum - aspose.com

Header images getting cropped when converting to PDF

I have an existing Word 2007 document that all I do is save it in PDF format. There are 3 images in the 1st page header of that document. The top of 2 of the 3 images are getting clipped when saved to PDF format.

I have version 9.4.0 of Aspose.Words (as part of Aspose.Total license). I am using Visual Studio 2008, O/S is XP if that matters.

Attached is a zip file with the VS2008 solution, the docx input file and the resulting PDF output file.

Hi Clarie,

Thanks for the inquiry.

I cannot reproduce the issue using your test project and Aspose.Words 9.4. Can you please double check that you are referencing that DLL in your application, and not different version by a mistake. You can test this at run time using the following code:

System.Reflection.Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

foreach (System.Reflection.Assembly assembly in assemblies)

{

System.Reflection.AssemblyName assemblyName = assembly.GetName();

if(assemblyName.Name.Contains("Aspose.Words"))

Console.Write("Aspose.Words Version Number: " + assemblyName.Version.ToString());

}

Thanks,

I did run the suggested code and it returned version 9.4.0.0.

Hi Clarie,

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

Thank you for additional information. But I also cannot reproduce the problem on my side using the latest version of Aspose.Words (9.4.0). I use the following code for testing:

// Open source document

Document doc = new Document("test.docx");

// Save as PDF

doc.Save("out.pdf", SaveFormat.pdf);

I sent the output PDF produced on my side to your e-mail.

Best regards,

My code, other than specifying a full paths for input and output files, and fully qualifying the SaveFormat is identical to yours.

The output PDF you sent does not have cropped images but it isn't in the correct font so perhaps it's a font issue?

Just for the heck of it I downloaded the 9.4.1 version of Aspose.Words. That version corrected the problem for me. That correct output file is attached in case you want to compare.

Hi

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

Thank you for additional information. Just to clarify, Aspose.Words requires all fonts, which are used in the document to be installed in the environment, where you perform conversion. Fonts are read, during converting to PDF, and embedded into the PDF document. If Aspose.Words cannot find some of fonts, it uses another similar font.

Best regards,