System.Drawing.SafeNativeMethods.Gdip.CheckStatus(Int32 status)

Hello Team ,

I am getting below mentioned error while using Aspose slides in container environment.

Error :    at System.Drawing.SafeNativeMethods.Gdip.CheckStatus(Int32 status) 
   at System.Drawing.FontFamily..ctor(GenericFontFamilies genericFamily)
   at System.Drawing.FontFamily.get_GenericSerif() 
   at .()   
   at .(FontStyle )    
   at .(String , FontStyle , String )    
   at .( , Boolean )   
   at .( , Boolean , Single ,  , Int32 , Boolean )    
   at .(String , FontStyle ,  , Boolean , Single ,  , Int32 , Boolean )    
   at .ee( , String ,  , Int32 , Single , FontStyle , Boolean )    
   at .(String ,  , Int32 , Single , FontStyle , Boolean )   
   at .(String ,  , Int32 , Single , FontStyle , Boolean )    
   at e.()    
   at .(e& , Boolean& )    
   at e.()    
   at e..ctor(TextFrame ,  , IBaseSlide , e , e[] )    
   at ee.eee( ,  )    at ee.(e , Single , Single ,  )    
   at ee.(e , & , RectangleF& ,  )    
   at ee.(e , ShapeFrame& , RectangleF& ,  )    
   at ee.(e )    
   at .(IAutoShape , e , e ,  )    
   at .(IShape , e , e ,  )    
   at .(IGroupShape , e , e ,  )    
   at .(IBaseSlide ,  , e )    
   at .(IMasterSlide , Boolean )    
   at e.( , IMasterSlide , Boolean , e )    
   at e.(Presentation , Stream , PresentationTypeEx , IPptxOptions , InterruptionToken )    
   at Aspose.Slides.Presentation.(Stream , PresentationTypeEx , IPptxOptions )    
   at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)    
   at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format)    
   at Esf.Domain.Hub.Services.PPTExportService.Export() 
   in D:\Agent2\_work\11\s\Esf.Domain.Hub\Services\PPTExportService.cs:line 133

Version used : 23.1.0

Need help on this asap.

Thanks

@rahulv144,
Thank you for contacting support.

Please check your results using the latest version of Aspose.Slides for .NET if it is possible. If the issue persists, please share the following files and information:

  • input files (if they were used)
  • code example that reproduces the error
  • dockerfile

Hello andrey
I updated the Aspose slides to the latest version but still facing the same issue.

Below is the error:

 at System.Drawing.Image..ctor()  
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)  
   at e.(Size ,  )    at e.(Size )   
   at Aspose.Slides.Slide.GetThumbnail(Size imageSize)   
   at e.( , IPresentation ) 
   at e.(Presentation , Stream , ee , IPptxOptions , InterruptionToken )  
   at Aspose.Slides.Presentation.(Stream , ee , IPptxOptions )   
   at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options) 
   at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format)

@rahulv144,
Thank you for the checking. We need the remaining files and the information mentioned above in order to check the issue on our end and help you.

Hello Andrey
Below is the code which is reading a ppt file and saving it .Aspose.zip (64.9 KB)

public MemoryStream Export()
{
    //If the template file not found or isInvalid then return the control.
    //if (!IsValidTemplateFile())
    //{
    //    // return null;
    //}

    var pptStream = new MemoryStream();

    //Creating object for the template presentation file.
    try
    {
        var filepath = $"Files/{TemplateFileName}";
        byte[] fileBytes = System.IO.File.ReadAllBytes(filepath);
        using (Presentation pres = new Presentation(new MemoryStream(fileBytes)))
        {
            //Create (by cloning the template slide) as many slides, as many chartData are present
            // CreateSlides(pres);

            try
            {
                ////Fill Data For Report Name And Filters
                //FillBasicData(pres);
                ////Replace all Key/Value pairs in every slide of the Presentation
                //ReplaceTextValuesForChartSlides(pres);

                ////Replace All Charts SVG
                //ReplaceSVG(pres);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error updating data in template file");
            }
            //var pptxFileName = Guid.NewGuid().ToString() + TemplateFileName;
            // var pptxFilePath = FileUtils.ConstructFileName(TemplateFilePath, TemplateFileFolder, pptxFileName);

            //if (!this.PPTRequestModel.HasAdvanceFilters)
            //{
            //    pres.Slides.RemoveAt(2);
            //}

            //System.IO.Stream sta = outputStream;
            // pres.Save(pptxFilePath, SaveFormat.Pptx);
            try
            {
                pres.Save(pptStream, SaveFormat.Pptx);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error writing to stream.");
            }
            return pptStream;
        }
    }
    catch (Exception ex)
    {
        _logger.LogError(ex, "Error reading template file");
    }
    return pptStream;
}

Hello Andre,

In the previous reply I have attached the sample PPT file which is creating issue and Docker file too as you have asked . Code which is raising the exception also is mentioned in previous reply.

We need help with this ASAP.

@rahulv144,
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNET-44086

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hello Andre,

We already have Aspose enterprise license , Do we still need to buy Paid support services to get this resolved on priority ?

@rahulv144,
Unfortunately, I cannot help you with this question. Please ask the question on the Aspose.Purchase forum.

Anyways, What is ETA for this issue to be resolved? We have launch soon and our clients are eagerly waiting for this feature.

@rahulv144,
I requested plans for the issue from our development team. We will let you know soon.

Is there any direct email Id for communication and escalation matrix ?

@rahulv144,
We provide free support on the forum. You can also contact Paid Support to escalate the issue priority.

@rahulv144,
Investigation of the issue will begin this week.

Hi Andre,

Any update on this? can you please provide us ETA?

@rahulv144,
The issue has been planned to be resolved in Aspose.Slides for .NET 23.8. This release will be published in the second half of August.

@rahulv144,
Our developers have investigated the case and found that the Docker image is missing some libraries (libfontconfig.so.1, libfreetype.so.6, libexpat.so.1, and libpng16.so.16) that are used by Aspose.Slides. These libraries can be installed with the following packages: libfontconfig1, libfreetype6, libexpat1, libpng16-16.
Here is an example command for the Dockerfile:

#Install the necessary libraries for Aspose.Slides under .NET 6.0 and .NET 7.0, which may be missing in the Docker image
RUN apt-get update && apt-get install -y \
 libfontconfig1 \
 libfreetype6 \
 libexpat1 \
 libpng16-16

Please add these commands to the Dockerfile to ensure that the necessary libraries are installed.

Hello Andre,

I have added the missing libraries as mentioned in the docker file and now we are getting different exception .

Exception : System.Drawing.Common is not supported on this platform.
StackTrace:
 at System.Drawing.Image..ctor()    
 at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
 at e.(Size ,  )
 at e.(Size )  
 at Aspose.Slides.Slide.GetThumbnail(Size imageSize)
 at e.( , IPresentation )
 at e.(Presentation , Stream , ee , IPptxOptions , InterruptionToken )   
 at Aspose.Slides.Presentation.(Stream , ee , IPptxOptions )  
 at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)    
 at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format)

Just for reference , these are the nuget packages in my project

Include="Aspose.Cells" Version="23.7.0" />
Include="Aspose.Slides.NET" Version="23.6.0" />
Include="Aspose.SVG" Version="23.6.0" />
Include="Aspose.Words" Version="22.4.0" />
Include="ereno.linux-x64.eugeneereno.System.Drawing" Version="6.1.1.4" />
Include="GraphQL.Client" Version="6.0.0" />
Include="GraphQL.Client.Serializer.Newtonsoft" Version="6.0.0" />
Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />

@rahulv144,
I forwarded your information to our developers. We will continue to investigate the case.