Use of PPTX template

Hi,

We are trying to add image with trasperent background in table using ASPOSE slides,
But still its showing background as white color instead of showing default color.
PFA image in which we have added blue and red Dot image.
We are sharing snapshot and sample code to understand us better.
plz find below code

double[] dblCols = { 50, 50, 50 };
double[] dblRows = { 50, 30, 30, 30, 30 };

//Add table shape to slide
ITable tbl = sld.Shapes.AddTable(100, 50, dblCols, dblRows);

//Add text to the merged cell
IPPImage imgx;
tbl[1, 1].FillFormat.FillType = FillType.Pattern;// "Merged Cells";
imgx = pres.Images.AddImage(createbitmap("#00B0F0"));
tbl[1, 1].FillFormat.FillType = FillType.Picture;
tbl[1, 1].FillFormat.PictureFillFormat.PictureFillMode = PictureFillMode.Stretch;
tbl[1, 1].FillFormat.PictureFillFormat.Picture.Image = imgx;
tbl[1, 2].FillFormat.FillType = FillType.Pattern;// "Merged Cells";

imgx = pres.Images.AddImage(ImagePath); // added image with trasperent background
tbl[1, 2].FillFormat.FillType = FillType.Picture;
tbl[1, 2].FillFormat.PictureFillFormat.PictureFillMode = PictureFillMode.Stretch;
tbl[1, 2].FillFormat.PictureFillFormat.Picture.Image = imgx;

//Write PPTX to Disk
pres.Save(dataDir + "/table.pptx", SaveFormat.Pptx);

Hi Prasad,

I have observed your requirement and like to share that Aspose.Slides supports transparent background image if the image is really with transparent background. In your case the slide background is white and that is why it is appearing as white. You can try setting the slide background color to some other color and you will see the effect. If there is still an issue then please share the sample transparent image with me and I will help you further in this regard.

Many Thanks,

Hi,

I have added table in ppt silde but unable to change the header color of the table.
Can anybody please let me know how the header color of the table can be changed.
The default template is applied to the table.
plz find attaced snap for reference.

Thanks,
Sumit

Hi Summit,

I have observed the requirement shared and suggest you to please try using the following sample code on your end to serve the purpose.

ICell cell = tbl[k, j];
cell.FillFormat.FillType = FillType.Solid;
cell.FillFormat.SolidFillColor.Color = Color.Red;

The tbl is ITable object. You can set the fill color for every cell to serve the purpose.

Many Thanks,

Hi,

I want to flip arrow angle so that it will point to opposit direction.
Please find below code which i used to generate arrow. and attached images to get clear picture.

In PPT we can change 3-D Rotaten X value to 180 then we are getting desired output.
Please let us know where we can set 3D Rotation X value in Aspose Slide.

using (Presentation pres = new Presentation())
{
    ISlide sld = pres.Slides[0];
    IAutoShape shp = sld.Shapes.AddAutoShape(ShapeType.Line, 150, 150, 63, 44);

    shp.LineFormat.BeginArrowheadLength = LineArrowheadLength.Long;
    shp.LineFormat.BeginArrowheadWidth = LineArrowheadWidth.Wide;
    shp.LineFormat.BeginArrowheadStyle = LineArrowheadStyle.Triangle;
    shp.LineFormat.FillFormat.FillType = FillType.Solid;

    pres.Save(dataDir + "ineShape2.pptx", SaveFormat.Pptx);
}

Thanks,
Prasad

Hi Prasad,

Thanks for your interest in Aspose.Slides.

I have observed your requirements and like to share that you can achieve the desired output by setting the Rotation property of shape. I have made necessary changes to the code sample shared by you to serve the purpose and about different values of Rotation property, I would like to add that Rotation property returns or sets the number of degrees the specified shape is rotated around the
z-axis. A positive value indicates clockwise rotation; a negative
value indicates counterclockwise rotation.

Presentation pres = new Presentation();
ISlide sld = pres.Slides[0];
IAutoShape shp = sld.Shapes.AddAutoShape(ShapeType.Line, 150, 150, 63, 44);

shp.LineFormat.BeginArrowheadLength = LineArrowheadLength.Long;
shp.LineFormat.BeginArrowheadWidth = LineArrowheadWidth.Wide;
shp.LineFormat.BeginArrowheadStyle = LineArrowheadStyle.Triangle;
shp.LineFormat.FillFormat.FillType = FillType.Solid;
shp.Rotation = 90;

pres.Save(@"D:\LineShape2.pptx", Aspose.Slides.Export.SaveFormat.Pptx);

I hope this will be helpful. Please share if I may help you further in this regard.

Best Regards,

Hi Prasad,

I have observed the requirement shared by you and request you to please try using the following sample code to serve the purpose on your end. You need to set the rotation value for the shape that suits your requirement.

public static void TestTextEffects()
{
    String dataDir = @"D:\Aspose Data";
    using (Presentation pres = new Presentation())
    {
        ISlide sld = pres.Slides[0];
        IAutoShape shp = sld.Shapes.AddAutoShape(ShapeType.Line, 150, 150, 63, 44);
        shp.LineFormat.BeginArrowheadLength = LineArrowheadLength.Long;
        shp.LineFormat.BeginArrowheadWidth = LineArrowheadWidth.Wide;
        shp.LineFormat.BeginArrowheadStyle = LineArrowheadStyle.Triangle;
        shp.LineFormat.FillFormat.FillType = FillType.Solid;
        shp.Rotation = 90;
        pres.Save(dataDir + "LineShape2.pptx", SaveFormat.Pptx);
    }
}

Many Thanks,

Yes Rotation property is working for me but in my case angle is not constant but if i flip arrow with 3 D rotation in 180 degree then it will work for me. thats why i wanted to implement 3 D rotation Z axias set property.

Please let me know if we can implement that.

Thanks,
Prasad

Hi Prasad,

I have observed your comments and regret to share that I have not been able to understand the completely. Can you please elaborate the issue for my understanding in the form of sample code and snapshot so that I may understand the issue and help you further.

Many Thanks,

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi I would like to know, can i remove the tick marks highlited in attached image.

If yes please share source code.

Thanks,
Prasad

Hi Prasad,

I have observed the requirement shared by you and like to share that you are actually looking for hiding MajorTickMark position. Please try using the following sample code in your application to serve the purpose.

IAxis axis=chart.Axes.VerticalAxis;
axis.MajorTickMark = TickMarkType.None;

I hope this will be helpful. Please share if I may help you further in this regard.

Many Thanks,

Hi Mudassir,

I would like to change font of entire slide which i am generating.

I am using Aspose.Slides Version 14.10.0.0.

I have investigated and found pres.FontsManager.ReplaceFont(sourceFont, destFont);

it’s not working for me as giving me error Aspose.Slides.Presentation does not contains definition for FontManager

Please let me know the way to do so.

Thanks,
Prasad

Hi Prasad,

I have observed the requirements shared by you and like to share that you can replace fonts inside your presentation. Please visit this documentation link to serve the purpose on your end. Please share, if I may help you further in this regard.

Many Thanks,

Thanks for quick response.

it’s not working for me as giving me error Aspose.Slides.Presentation does not contains definition for FontManager

Thanks,
Prasad

Hi Prasad,

This is relatively new feature. I request you to please try using Aspose.Slides for Java 15.5.1 on your end. If there is still an issue then please share the sample java file reproducing the issue.

Many Thanks,

Hi,

I have created chart with code using Aspose Slides.
I would like to increase width of Data Label so that it will fit in horizontally. (28% is not fitting in a row that i wanted to fit in a row)
I have tried with reducing font size but i have to reduce font size to 5 and its barely visible.

Please find attached image to get clarity on the same.

Thanks,
Prasad

Hi Prasad,

I have observed your requirements and request you to please share the sample project and generated presentation. Please also provide the desired presentation as well. I will check if that is possible to achieve using Aspose.Slides and help you further in this regard.

Many Thanks,

Hi Mudassir,

I have written too much code to generate required output in various format.
My requirement is simple i just want to add percentage in Data label part of chart.
below is the sample code which i am calling in a loop to overwrite Data lable with percentage.

IChartSeries series = Chart.ChartData.Series[iResponseCount];
series.ParentSeriesGroup.GapWidth = (ushort)gap;

if (series.Overlap == 0)
    series.ParentSeriesGroup.Overlap = 100;

if (Percentage > 0)
{
    series.DataPoints.AddDataPointForBarSeries(Fact.GetCell(index, iResponseCount + 1, iYearCount + 1, Percentage));
}
else
{
    if (Percentage == 0 || (Percentage == 100))
        series.DataPoints.AddDataPointForBarSeries(Fact.GetCell(index, iResponseCount + 1, iYearCount + 1, 0));
    else
        series.DataPoints.AddDataPointForBarSeries(Fact.GetCell(index, iResponseCount + 1, iYearCount + 1, Percentage));
}

IDataLabel lbl = series.DataPoints[iYearCount].Label;
lbl.Width = 50;
lbl.AddTextFrameForOverriding("");

if (Percentage >= 0)
{
    if (Percentage < 3)
        lbl.TextFrameForOverriding.Paragraphs[0].Portions[0].Text = "";
    else
        lbl.TextFrameForOverriding.Paragraphs[0].Portions[0].Text = Percentage + "%";
}

lbl.TextFrameForOverriding.Paragraphs[0].Portions[0].PortionFormat.FontHeight = Height;
lbl.TextFrameForOverriding.Paragraphs[0].Portions[0].PortionFormat.FillFormat.FillType = FillType.Solid;
lbl.TextFrameForOverriding.Paragraphs[0].Portions[0].PortionFormat.FillFormat.SolidFillColor.Color = Color.White;

Hi Prasad,

I have observed that you are interested in setting the data label size. I am afraid, this option is even unavailable in PowerPoint as well to change the size of data label. It depends on how much area does the series data point occupy in a plot area. If you are able to locate any property in PowerPoint for setting the label size, please share with us and I will try my best to help you further. What you can do as alternate is to reduce the height of text in data label to get that accommodated.

Many Thanks,