Alpine container to use with Go SDK

Hi Aspose team,

I’m looking into setting up an Aspose container to service requests (pdf conversion, statistics extraction, etc.) from a Golang app. I have a few questions about this and hope you can help answer them.

  • With the self-hosting option, does Aspose has an Alpine Linux container image for word, cells, and slides that works with the Go SDK? How may we get access to that image and get a trial license to test it out?
  • Does the conversion image depend on any external service / license (e.g. MS Office)?
  • What resource requirements (cpu, memory, etc.) would each container need, and what is the max load (request per second) can each container handle?

Looking forward to hearing from you!

Best Regards,

Tommy

@tnhuynh,
Thank you for your query.
We have analyzed your requirement and would like to share that no such containers are part of our products therefore we cannot provide you these ready to use containers. Users create their own containers based on specific needs. For example for Aspose.Cells, consider the following solution which was provided to a user:

I have tested this scenario on Ubuntu 16.04 x64, in a docker container.
Here are my steps:

The docker I use is: microsoft/dotnet, install it first:
`sudo docker pull microsoft/dotnet`

Then, after running it, if I run this issue in this docker, I get the error:

Aspose.Cells.CellsException : The type initializer for ‘???’ threw an exception.
at Aspose.Cells.Workbook.Save(String fileName, SaveOptions saveOptions)

It seems to be the same error you also get.

Then I install libgdiplus:

```
apt-get update
apt-get install -y libgdiplus
cd /usr/lib && ln -s libgdiplus.so gdiplus.dll
```

And install libc6-dev:
`apt-get install -y --no-install-recommends libc6-dev`

After all these steps, the issue passed, and the pdf file created successfully.

And for Aspose.Words have a look at the following article:
How to Run Aspose.Words in Docker

You may try to create your own containers having sufficient resources to fulfill your requirements.

@ahsaniqbalsidiqui, thank you for your response!

Are there instructions for creating a Linux container for Slides as well?

For C++ Slides, the aspose library included in the downloadable sample is dynamic lib. How may we obtain a version with static lib?

One way to extend Aspose’s current offerings to Golang developers, one way is to use SWIG: http://www.swig.org/Doc3.0/Go.htm. Could Aspose C++ add support for Golang?

Since Aspose products operate independently of MS Office, if we convert to PDF and get statistics (word count, character count, etc.) via Aspose Word/Cells/Slides, will the result be always be consistent with what MS Office produce or have your encounter cases where the results differ?

@tnhuynh,

We are gathering information for this query and will share our feedback soon.

This issue is also under discussion here and feedback will be provided soon.

@tnhuynh,

Regarding the statistics please note that Aspose products Word, Cells and slides mimic the behavior of MS Office and all the features behave in a similar manner as posed by MS Office products. Hence you should get the same number of word count and character count when calculated using Aspose products. If you observe any difference, please share the details with us along with the runnable code, sample files, program output and expected output (obtained through MS Office products). We will analyze the scenario and share our feedback.

@tnhuynh,

We have investigated the requirements w.r.t Aspose.Slides for C++.

All Aspose C++ products are distributed as dynamic libraries only. There are no plans to support static libraries.

For your above inquiry related to configuration of Aspose.Slides for C++ in requested environment, a ticket with ID SLIDESCPP-2375 has been created in our issue tracking system to provide the requested support.

This thread has been linked with the issue so that you may be notified once the support will be available.

Regarding the statistics please note that Aspose products Word, Cells and slides mimic the behavior of MS Office and all the features behave in a similar manner as posed by MS Office products. Hence you should get the same number of word count and character count when calculated using Aspose products. If you observe any difference, please share the details with us along with the runnable code, sample files, program output and expected output (obtained through MS Office products). We will analyze the scenario and share our feedback.

Thank you for your response! Is there a function call we can make to get the document stats (slide count, word count, character count) using Aspose Slides C++? I tried to look for it in Aspose.Slides for C++ API Reference (version 23.10) and https://github.com/aspose-slides/Aspose.Slides-for-C/tree/master/Examples/SlidesCPP but haven’t had much luck.

I found some code to get slides count, but event that yield an error when compiling:

error: member access into incomplete type
      'System::SmartPtr<Aspose::Slides::ISlideCollection>::Pointee_' (aka 'Aspose::Slides::ISlideCollection')
        int slide_count = pres->get_Slides()->get_Count();
                                            ^
../include/aspose.slides.cpp/DOM/IPresentation.h:19:45: note: forward declaration of
      'Aspose::Slides::ISlideCollection'
namespace Aspose { namespace Slides { class ISlideCollection; } }

@tnhuynh,

For following error, please try using the following sample code.

int32_t countd= pres->get_Slides()->get_Count();

Hi @mudassir.fayyaz,

Thank you for your response

I’m still getting the same error with the suggested code:

error: member access into incomplete type
‘System::SmartPtrAspose::Slides::ISlideCollection::Pointee_’ (aka ‘Aspose::Slides::ISlideCollection’)
int32_t countd= pres->get_Slides()->get_Count();
^
note: forward declaration of
‘Aspose::Slides::ISlideCollection’
namespace Aspose { namespace Slides { class ISlideCollection; } }

@tnhuynh,

I have used the same code on my end and there was no errors. I request you to please share your sample CPP file that I have use on my end to investigate the issue further.

@mudassir.fayyaz, per your request, I’ve attached the cpp file here. It is based on the sample code in the Aspose Slides C++ distribution, just adding a few lines to get the slides count.

presentation_export.cpp.zip (1005 Bytes)

Besides slide count, what about other stats (e.g. character count, word count)? Are we able to get those through a function call?

@tnhuynh,

I have tested following sample code on my end in one of classes shared in our Github Examples and there was no error thrown.

// Load the desired the presentation
SharedPtr<Presentation> pres = MakeObject<Presentation>();

// Access first slide
SharedPtr<ISlide> sld = pres->get_Slides()->idx_get(0);

 int32_t countd= pres->get_Slides()->get_Count();

For second part of your inquiry related to word count, there is no direct method available in API for this. In the shared example, you will find a utility class, ExtractTextFromSlide.cpp, which allows to extract text frames on slide or presentation level. By traversing all text frames, you will have to make your logic to find number of words in each text frame.