Not happy with Aspose Slide Output for charts

I am really not happy with the Output by Aspose.Slide.

I have attached two output. One output is from Microsoft Interop and other by Aspose.
You will clearly see that the aspose output is very blurry.
The charts,texts, colors everything is blurry.

I have tried with latest 7.5 version and have the same output.

Hi Pankaj,


I have observed the issue shared by you. It will be really appreciable if you may please share the source presentation along with the code snippet that you have used for your investigation. I will try to reproduce the same on my end to help you out further.

Many Thanks,

I have attached a file Thrivent_Scorecard.pptx.

You can use this file as template and then save the new file you generate by code.
You will be able to see the issue i am having…
You may use the code snippet below :


PresentationEx pres = new PresentationEx(templatePath);
PresentationEx _newPres = new PresentationEx();
SlideEx _activeSlide = pres.Slides[0];
_newPres.Slides.AddClone(_activeSlide);
_newPres.Slides.RemoveAt(0);
string Filename = “test”;

//Aspose PDF Output
_newPres.Save(locationPath + “\” + Filename + “.pdf”, Aspose.Slides.Export.SaveFormat.Pdf);

Hi Pankaj,


Thanks for sharing the requested information. I have worked with the presentation file shared and have observed the inconsistency of blurring effect in the generated PDF as compared to one generated using Microsoft Interop.

I like to share to share that Microsoft use internal algorithm to export to PDF while Aspose.Slides exports the slides to Jpeg for conversion of PDF and that is why there is some quality difference present. However, I have created an issue with ID SLIDESNET-33640 as enhancement in our issue tracking system so that our development team may investigate the further improvements in generated PDF.

I will share the further information with you as soon as it will be shared by our development team. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

Hi,

I am also facing the issue while exporting the chart image on slide. Can you please update me on this, My sample code is below:

Presentation pres = new Presentation(@"C:\WorkArea\WebApplication1\UI\Template\SampleTemplateForChart.ppt");

Slide sld = null;

Aspose.Slides.Shapes shp = null;

//code for creating multiple slides for multiple charts 31Dec2012

string chartDirectory = "C:/WorkArea/WebApplication1/UI/images/Chart/";

//string[] files = Directory.GetFiles(chartDirectory, "*.jpeg", SearchOption.TopDirectoryOnly);

string[] files = Directory.GetFiles(chartDirectory, "*.jpg", SearchOption.TopDirectoryOnly);

//string[] files = new string[1];

//files[0] = "chart1.jpg";

int loopCount = 0;

foreach (string imagePath in files)

{

if (imagePath.Substring(imagePath.IndexOf("chart")).Contains("13"))

{

if (loopCount == 0)

{

sld = pres.GetSlideByPosition(1);

}

else

{

sld = pres.GetSlideByPosition(pres.Slides.LastSlidePosition - 1);

pres.CloneSlide(sld, pres.Slides.LastSlidePosition);

sld.SlidePosition = pres.Slides.LastSlidePosition - 1;

}

shp = sld.Shapes;

Shape shape;

int picId;

Picture pic;

for (int i = 0; i < shp.Count; i++)

{

Aspose.Slides.Shape shap = shp[i];

string str = "";

str = shap.AlternativeText;

if (str == "Image1")

{

Aspose.Slides.Shape tx = (Aspose.Slides.Shape)shap;

// Getting coordinates of the shape

int xx = tx.X;

int yy = tx.Y;

int width = tx.Width;

int height = tx.Height;

shape = sld.Shapes.AddRectangle(xx, yy, width, height);

shape.FillFormat.Type = FillType.NoFill;

shape.FillFormat.Type = FillType.Picture;

shape.AlternativeText = tx.AlternativeText;

shape.Name = tx.AlternativeText;

// Creating a picture object that will be used to fill the rectagular shape

pic = new Picture(pres, imagePath);

picId = pres.Pictures.Add(pic);

shape.FillFormat.PictureId = picId;

sld.Shapes.Remove(tx);

}

}

loopCount = loopCount + 1;

}

}

pres.Write(@"C:\AsposeChart.ppt");

I have attached the image and slide generated.

Hi Pranav,


I have observed the sample code and image shared by you. I feel that I have already shares the same sample application based on your sample code with you over here. Can you please share what is the issue and what you are expecting from Aspose.Slides to offer in this regard. Please also shre the source sample presentation as well for reference.

Many Thanks,

Yes you are right. You have already shared the sample code earlier.

The issue is the image which I am exporting into aspose slide is not of the same quality as we see in the image file. Please find the attached sample template whihc I am using to export. Also find attached the the image file.

Hi Pranav,


I have worked over the requirement shared by you. Can you please try using the following sample code for your kind reference. I have sahred the generated presentation foor your kind refrenece.

public static void AddImageFrame()
{
//Instantiate a Presentation object that represents a PPT file
Presentation pres = new Presentation();


//Accessing a slide using its slide position
Slide slide = pres.GetSlideByPosition(1);

//Creating a picture object that will be used to fill the ellipse
Picture pic = new Picture(pres, @“chart13.jpg”);

//Adding the picture object to pictures collection of the presentation
//After the picture object is added, the picture is given a uniqe picture Id
int picId = pres.Pictures.Add(pic);

//Calculating picture width and height
int pictureWidth = pres.Pictures[picId - 1].Image.Width * 4;
int pictureHeight = pres.Pictures[picId - 1].Image.Height * 4;

//Calculating slide width and height

int slideWidth = slide.Background.Width;
int slideHeight = slide.Background.Height;


//Calculating the width and height of picture frame
int pictureFrameWidth = Convert.ToInt32(slideWidth / 2 - pictureWidth / 2);
int pictureFrameHeight = Convert.ToInt32(slideHeight / 2 - pictureHeight / 2);


//Adding picture frame to the slide
slide.Shapes.AddPictureFrame(picId, pictureFrameWidth, pictureFrameHeight, pictureWidth, pictureHeight);


//Writing the presentation as a PPT file
pres.Write(@“modified.ppt”);



}


Many Thanks,

Hi,

Please find attached the actual image file and the generated ppt using your code. I still find the burred image in ppt slide.

Let me know if we can improve this.

Thanks.

Hi,


Have you observed the generated presentation shared by me over this link. In my humble opinion the quality of the added image is fine. Can you please observe and share your feedback in this regard.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-33640) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.