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

Free Support Forum - aspose.com

System.ApplicationException: Image top or bottom margin is too large 0-0

Hello,


I am facing with this exception below:

System.ApplicationException: Image top or bottom margin is too large 0,0 image file:D:\Temp\imgstnk___monplvmjjv.jpg
at Ž..—(Pdf , Section , HeaderFooter , Table , Row , Cell , Paragraph , e , e , , Boolean )
at Ž.™.˜(Pdf , Section , HeaderFooter , Table , Row , Cell , Image , e , , Boolean )
at Ž..–—(Pdf , Section , e )
at Ž.‰.•(Pdf )
at Ž.’.—•( , Pdf )
at Aspose.Pdf.Generator.Pdf.Save(Stream stream)
at WebServiceApplication1.ClsMain.doPrepareCoverNote_MV(Object parameters) in D:\Project\WebServiceApplication1\ClsMain.cs:line 2084

on

MemoryStream ms = new MemoryStream();
pdf1.Save(ms); // ERROR HERE

using Aspose Pdf 11.3.0.0

how to handle this?..

please help

thanks
Win

Hi,


Thanks for contacting support.

Can you please share the complete code snippet and any related resource files, so that we can test the scenario in our environment. We are sorry for this inconvenience.

Hi…

thanks for your reply…

this problem has resolved …by settings the margin of the section as below

Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
Section sec1 = pdf1.Sections.Add();
sec1.IsLandscape = true;
sec1.PageInfo.Margin.Top = 1;
sec1.PageInfo.Margin.Bottom = 1;
sec1.PageInfo.Margin.Left = 1;
sec1.PageInfo.Margin.Right = 1;

Hi,


Thanks for the feedback.

We are glad to hear that your problem is resolved. However we recommend you to please try using new Document Object Model of Aspose.Pdf namespace as its more stable and optimized as compared to legacy Aspose.Pdf.Generator approach. For further details, please visit Convert an Image to PDF

In case you still face any issue, please share the resource files, so that we can further look into this matter. We are sorry for this inconvenience.