Hi,
Hi Raghupathi,
Hi,
Unfortunately, i cannot share the pptx fies that i am using for merging as the data is strictly confidential.
Attached the code snippet that i am using from Aspose & using the latest Aspose.Slides for .Net dll.
protected
void ButtonMergePPTAspose_Click(object sender, EventArgs e)
{
try
{
SPWeb oWeb = SPContext.Current.Web;
int maxDeptCount = 0;
maxDeptCount = GetCountOfPresentations(
Constants.listnamePresentations, oWeb);
SPFile spFileTemplate = oWeb.Site.RootWeb.GetFile(oWeb.Site.Url + Constants.templateUrl);
Stream mergedPresentationTemplate = spFileTemplate.OpenBinaryStream();
Aspose.Slides.
Presentation destinationPresentation = new Aspose.Slides.Presentation();
for (int i = 0; i < maxDeptCount; i++)
{
SPListItem splistitemPresentation = GetListItemByOrder(Constants.listnamePresentations, i + 1, oWeb);
if (splistitemPresentation != null)
{
if (splistitemPresentation.Attachments.Count > 0)
{
if (Convert.ToDateTime(splistitemPresentation["Month"].ToString()).Month == DateTime.Now.Month)
{
SPFile file = splistitemPresentation.ParentList.ParentWeb.GetFile(splistitemPresentation.Attachments.UrlPrefix + splistitemPresentation.Attachments[0].ToString());
Stream pptFile = file.OpenBinaryStream();
Aspose.Slides.
Presentation sourcePresentation = new Aspose.Slides.Presentation(pptFile);
foreach (Aspose.Slides.Slide slide in sourcePresentation.Slides)
{
destinationPresentation.Slides.AddClone(slide);
}
}
}
}
}
string fileStamp = DateTime.Now.ToString("yyyyMMddHHmmssfff");
destinationPresentation.Save(
@"C:\\Temp\PPT" + fileStamp + ".pptx", Aspose.Slides.Export.SaveFormat.Pptx);
destinationPresentation.Save(
@"C:\\Temp\PPT" + fileStamp + ".pdf", Aspose.Slides.Export.SaveFormat.Pdf);
}
catch (ThreadAbortException ex)
{
}
catch (Exception ex)
{
Helper.LogException(ex, Constants.applicationName, SPContext.Current.Web);
}
}
Hi Raghupathi,
I am sorry for your inconvenience. I have observed the sample code shared and
it seems OK. You have also followed in live chat session as well. I have some
suggestions in this regard. Theoretically, there is no constraint of license
version for number of slides to get cloned in target presentation. The
evaluation copy is real version but it inserts a watermark in the generated
presentation slides. In order to verify this you can shuffle the order of
presentations during merging and see if the same presentation throws the issue
stated during slide cloning or not. You can also use a try catch block and
capture information that for which presentation and which slide the exception
is thrown while merging.
I suggest you to please try using 30 days free license to evaluate the product
on your end. If there is still an issue you are more than welcome for that and
we will try our best to help yo in this regard. However, we will request you to
please share the sample solution along with sample presentations with us with
which you are able to reproduce the issue. We will also try to reproduce the
same on our end to help you further in this this regard. You can mark this
thread private and share the presentations with us. When marked private then only
you and Aspose staff has access to your information. You can also share the presentation
files privately with me by following these guidelines as well. In this case, please
simply notify me in this thread that you have shared the presentations
privately with me.
Please share, if I may help you further in this regard.
Many Thanks,
Hi, thanks for your reply.
I did use the 30day trial license, it has merged without any watermark. But i am still facing the same issue.
I am able to figure out the below points, so that it might help you further to analyze.
The exception is not occuring at the time of cloning. It is occuring at the time of saving the merged presentation as pptx. The same merged presentation is successfully saving as pdf.
destinationPresentation.Save(@"C:\\Temp\PPT" + fileStamp + ".pptx", Aspose.Slides.Export.SaveFormat.Pptx);
The presentations are strictly confidential & client is not keen to share the presentations. I am trying to see if the same error occurs for the junk data pptx & if i am able to reproduce, will share the solution & files.
We are kind of running out of time for production deployment, so could you please look into this issue?
We got the approval for buying the license, once this issue is fixed. Appreciate your help on this.
Hi,
One more observation is, the merged presentation is saving as ppt but without charts. I am not able to find charts on the merged presentation but am able to see the charts on pdf file.
Hi Raghupathi,