How set properties of Slide Number Placeholder (Java)

Hi All
I am trying to set the font size, height, width, X & Y of Slide Number Placeholder.
This is the code for reference:

 Presentation pres = new Presentation("Abc.pptx");
 pres.getHeaderFooterManager().setAllSlideNumbersVisibility(true);
 IMasterSlide master = pres.getMasters().get_Item(0);
 IShapeCollection sld = master.getShapes();
 IShape icsh[] = sld.toArray();

        for (IShape icsh1 : icsh) {
            String name = icsh1.getName();                     

            if (name.startsWith("Slide Number Placeholder")) {
                
                icsh1.setWidth(25.0F);
                icsh1.setHeight(17.0F);
                
                icsh1.setX(670.0F);
                icsh1.setY(514.0F);

            }
        }

pres.save(output_file, SaveFormat.Pptx);

After this, it’s not showing the page number placeholder in the give dimension. How to set the properties for the Slide number placeholder.

Please give suggestions ASAP.
Thanks

@Shree995,

I have observed the sample code shared by you. However, I am unable to understand what desired output you are interested to have. I request you to please share the source presentation, generated presentation and desired output that you want to achieve. I will investigate the issue further on my end to help you out.

Please find the zip to see generated .pptx & desired output.
pres.getHeaderFooterManager().setAllSlideNumbersVisibility(true); - this line of code giving me the slide number placeholder but i want to custmizes the properties like X, Y, Height, Width & the font size.test.zip (63.3 KB)

@Shree995,

I have observed the requirements shared by you and like to share that ideally the following code shall work for you when you try to change the formatting of slide number field inside master slide. However, there seems to be some issue while setting the formatting properties. An issue with ID SLIDESJAVA-37663 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed. Once the issue will be fixed, the following code sample will work.

public static void TestDateFooter()
{
    Presentation pres = new Presentation();
    IMasterSlide master = pres.getMasters().get_Item(0);
    
    IShapeCollection sld = master.getShapes();
    IShape icsh[] = sld.toArray();

    for (IShape icsh1 : icsh) 
    {
        String name = icsh1.getName();                     
        if(icsh1 instanceof IAutoShape)
        {
            IAutoShape ashp=(IAutoShape)icsh1;
            if(ashp.getTextFrame()!=null)
            {
                ITextFrame text=ashp.getTextFrame();
                IPortion portion=text.getParagraphs().get_Item(0).getPortions().get_Item(0);
                System.out.println(portion.getText());
                
                if(portion.getField()!=null)
                {
                    System.out.println(portion.getField().getType());
                   System.out.println(FieldType.getSlideNumber());
               
                   if(portion.getField().getType().equals(FieldType.getSlideNumber()))
                    {
               
                        icsh1.setWidth(25.0F);
                        icsh1.setHeight(17.0F);

                        icsh1.setX(670.0F);
                        icsh1.setY(514.0F);
                       // IPortionFormatEffectiveData format=portion.createPortionFormatEffective();
                        IPortionFormat format=portion.getPortionFormat();
                        //portion.setText("test");
                        format.setFontHeight(12.0f);
                        format.getFillFormat().setFillType(FillType.Solid);
                        format.getFillFormat().getSolidFillColor().setColor(Color.RED);
                        format.setFontBold(NullableBool.True);
                        IFontData font=new FontData("Times New Roman");
                        format.setLatinFont(font);
                    }
            
                }
            
            }
            
        }
        
    }
    
  
    pres.getHeaderFooterManager().setAllSlideNumbersVisibility(true);
    
    pres.save("C:\\Aspose Data\\testpres\\test\\TestFooter.pptx", SaveFormat.Pptx);

}

@mudassir.fayyaz can you please tell me how much time it will take to resolve this issue?
Thanks for your quick support

@Shree995,

I like to share that issue has just been created and is pending in issues queue at the moment. We request for your patience and will be sharing good news with you as soon as the issue will be fixed.

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