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

Free Support Forum - aspose.com

Image on new page after floating box crashes on save

This crashes at Save(); with the message “Invalid scale value (should be a float number greater than 0):-2.693333”.

Aspose 10.7.0.0


var pdf = new Aspose.Pdf.Generator.Pdf();
var section1 = pdf.Sections.Add();

var floatingBox = new Aspose.Pdf.Generator.FloatingBox();
section1.Paragraphs.Add(floatingBox);

var image1 = new Aspose.Pdf.Generator.Image();
image1.ImageInfo.File = @“big.png”;
floatingBox.Paragraphs.Add(image1);

var image2 = new Aspose.Pdf.Generator.Image();
image2.ImageInfo.File = @“small.png”;
floatingBox.Paragraphs.Add(image2);

var section2 = pdf.Sections.Add();
section2.IsNewPage = true;

var image3 = new Aspose.Pdf.Generator.Image();
image3.ImageInfo.File = @“small.png”;
section2.Paragraphs.Add(image3);

using (var stream = new MemoryStream())
{
pdf.Save(stream);
File.WriteAllBytes(@“c:\temp\test.pdf”, stream.ToArray());
}

Hi there,


Thanks for your inquiry. Please use new DOM approach for Image to PDF conversion, it is more efficient and improved. It will help you to accomplish the task.


Please feel free to contact us for any further assistance.

Best Regards,