Clone Slide Error: System.ArgumentException: '-7.26' is not a valid value for 'emSize'. 'emSize' should be greater than 0 and less than or equal to System.Single.MaxValue


#1

When I do a clone slide on a slide with a bullet, I get the following error:

System.ArgumentException: '-7.26' is not a valid value for 'emSize'. 'emSize' should be greater than 0 and less than or equal to System.Single.MaxValue.
Parameter name: emSize
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit)
at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style)
at ?.?.?(Portion ?, Int16 ?, Single ?, Boolean ?)
at ?.?.?(Paragraph ?)
at ?.?.?(Boolean ?)
at ?.?..ctor(Graphics Graphics, Paragraphs Text, ? Fonts, Single Width, Boolean WrapText, AnchorText Anchor, Tabs Tabs, Color BackgroundColor)
at Aspose.Slides.TextFrame.?()
at Aspose.Slides.Shape.?()
at Aspose.Slides.Rectangle.?()
at Aspose.Slides.Shape.?()
at Aspose.Slides.Presentation.?(Boolean ?)
at Aspose.Slides.Slide.?(Presentation ?)
at Aspose.Slides.Presentation.?(Slide ?, Presentation ?, SortedList ?)
at Aspose.Slides.Presentation.CloneSlide(Slide srcSlide, Int32 position, Presentation pres, SortedList idList)

Please see the attached project that recreates the error


#2

Thank you for report, we will fix that issue asap.


#3

I upgraded to 2.4.5.0 and now I receive the following exception:

Message: "Object reference not set to an instance of an object."

Source: "Aspose.Slides"

StackTrace: " at Aspose.Slides.MainMaster.৤(Presentation ৥)

at Aspose.Slides.Presentation.ਝ(Slide ਞ, Presentation ৥, SortedList ৠ)

at Aspose.Slides.Presentation.CloneSlide(Slide srcSlide, Int32 position, Presentation pres, SortedList idList)

at Project1.TestSlideEMSizeError.Main() in C:\temp\AposePowerPointCloneSlideTest\InvalidFontSize\test.vb:line 23"

TargetSite: {System.Reflection.RuntimeMethodInfo}

Is there any update on this?

Phil


#4

destinationPresentation variable is not initialized in your example


#5

Please see attached example.

Phil


#6

destinationPresentation is null (Nothing) when you call CloneSlide method.
How slide should be cloned in this case?


#7

Sorry about that! Thank you for your help. Rolling back in versions (and fixing my test), the problem is fixed in 2.4.4.0 (and now 2.4.5.0).

Thanks again.

Phil