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

Free Support Forum - aspose.com

Exception error: Image top or bottom margin is too large

Creating PDF from .DOC

Aspose.Word extracts 3 files (2 PNGs and 1 XML)

When creating PDF

Aspose.Pdf.Pdf aPdf = new Aspose.Pdf.Pdf();

aPdf.BindXML(xmldoc, null);

aPdf.IsImagesInXmlDeleteNeeded = true;

aPdf.Save(pdfdoc);

The following exception is caught

System.ApplicationException was caught

Message="Image top or bottom margin is too large 1.5,0 image file:C:\\Documents and Settings\\sandro\\My Documents\\Visual Studio 2005\\WebSites\\mil\\files\\A\\034_Test_PDF_error_PNG_images.002.png" Source="Aspose.Pdf"

Now, I have 2 PNG files, 1 XML file and an empty PDF file in my folder. How it is possible to remove these files after an exception like that occurs?

Suggestions?

Thank you

Sandro.

Hello Sandro,

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

Thanks for considering Aspose.

I am not sure why the application is throwing the exception. Please make sure you are using latest version of Aspose.Words 5.2.2.0 and Aspose.Pdf 3.8.0.0. If the problem is still here, share the resource word file so that we can test the issue at our end.

Regarding, deleting the intermediate XML and Image files, you can remove them manually, using following code line.

File.Delete(Filepath);

I updated Aspose and now it works fine.

Thanks buddy.