Any changes which are applied to some texts and Map-type graphs are not reflecting when generating thumbnails using GetThumbnail() method of Aspose.Slides
However, when we are applying same changes and save the PPT instance, changes are preserved.
Any changes which are applied to some texts and Map-type graphs are not reflecting when generating thumbnails using GetThumbnail() method of Aspose.Slides
However, when we are applying same changes and save the PPT instance, changes are preserved.
@srivastava.dipika,
Welcome to our community! Thank you for the query. To investigate this case on our side, please share and specify the following:
But first, please check the issue with the latest version of Aspose.Slides.
Hello Team,
Thanks for the response. Below are required details:
Code for graphs/charts
var chrt = Slide[0].Shapes.AddChart(Aspose.Slides.Charts.ChartType.Map, 0, 0 , 500, 500);
chrt.ChartData.Series.Clear();
var bitmap = chrt.GetThumbnail();
Code for text
void ReplaceText(ISlide slide, List portions)
{
IEnumerable getTextShapes(IEnumerable shapes)
{
return shapes.OfType().Union(shapes.OfType().SelectMany(g => getTextShapes(g.Shapes.Cast())));
}
getTextShapes(slide.Shapes.Cast())
.ForEach(autoshape =>
{
autoshape.TextFrame.Paragraphs
.ToList()
.ForEach(para =>
{
para.Portions
.ToList()
.ForEach(port =>
{
var updatedPort = portions.FirstOrDefault(p => p.Id == port.PortionFormat.BookmarkId);
port.Text = string.Concat(updatedPort.UpdatedText, CommonConstants.StringSpace);
});
});
});
var thumbnail = slide.GetThumbnail(1, 1);
}
Regards
image003.jpg (181 Bytes)
@srivastava.dipika,
Unfortunately, this information is not enough to investigate this case. Please try to remove confidential information from the presentation and share it. We cannot help you properly without the presentation sample. Also, I cannot use your code example. Please share a compilable and comprehensive code example.
This issue is very random and not specific to any particular presentation file.
I can add additional explanation step wise of what we are trying to achieve:
The issue is ‘replaced text’ exists in presentation file but slide thumbnail doesn’t capture it. (Similar to snapshot I shared in thread).
Also, can you share the particular format in which code is required.
@srivastava.dipika,
Unfortunately, I cannot reproduce the problem. You should check your application code carefully and isolate the problem.
Hello,
Please find below details of OS and C# code along with PPT used.
OS details :
cat /etc/os-release
PRETTY_NAME=“Debian GNU/Linux 10 (buster)”
NAME=“Debian GNU/Linux”
VERSION_ID=“10”
VERSION=“10 (buster)”
VERSION_CODENAME=buster
ID=debian
HOME_URL=“https://www.debian.org/
”
SUPPORT_URL=“https://www.debian.org/support
”
BUG_REPORT_URL=“https://bugs.debian.org/
”
// aspose.slides : 21.5.0
// docker OS {Unix 5.4.72.2}
====Docker file content====
FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
RUN apt-get update -y && apt-get install -y apt-utils
RUN apt-get install -y libgdiplus && apt-get install -y libc6-dev
C# code:
string path = @"C:\PPT\";
using (Presentation pres = new Presentation(@$"{path}DummyPPT - Thumbnail.pptx"))
{
ISlide slide = pres.Slides[0];
slide.GetThumbnail(1, 1).Save(@$"{path}Slide{slide.SlideNumber}_before.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
((AutoShape)slide.Shapes[1]).TextFrame.Paragraphs[0].Portions[2].Text = "Food and Beverages";
slide.GetThumbnail(1, 1).Save(@$"{path}Slide{slide.SlideNumber}_after.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
PPT : https://bcg01.egnyte.com/dl/8arS9MYcSk
Link will be deactivated after few days.
@srivastava.dipika,
Thank you for the additional information. I reproduced the problem with the text and logged the issue with ID SLIDESNET-42658 in our tracking system. Our development team will investigate this case. You will be notified when it is fixed.
I have not managed to find the issue with the chart. Could you also share a code example reproducing the problem for the chart, please?