We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Paper Size of Slides Is Not Working

The paper size of slides is not working


private static IPresentation setPaperSizeSlides(IPresentation pres,String ps)
{

if (ps.equalsIgnoreCase(“Ledger”))
{
pres.getSlideSize().setType(SlideSizeType.Ledger);
}
if (ps.equalsIgnoreCase(“Letter”))
{
pres.getSlideSize().setType(SlideSizeType.LetterPaper);
}
if (ps.equalsIgnoreCase(“A3”))
{
pres.getSlideSize().setType(SlideSizeType.A3Paper);
}
if (ps.equalsIgnoreCase(“A4”))
{
pres.getSlideSize().setType(SlideSizeType.A4Paper);
}
if (ps.equalsIgnoreCase(“OnScreen16x10”))
{
pres.getSlideSize().setType(SlideSizeType.OnScreen16x10);
}
if (ps.equalsIgnoreCase(“OnScreen16x9”))
{
pres.getSlideSize().setType(SlideSizeType.OnScreen16x9);
}
if (ps.equalsIgnoreCase(“B5”))
{
pres.getSlideSize().setType(SlideSizeType.B5IsoPaper);
}

if (ps.equalsIgnoreCase(“B4”))
{
pres.getSlideSize().setType(SlideSizeType.B4IsoPaper);
}

if (ps.equalsIgnoreCase(“Banner”))
{
pres.getSlideSize().setType(SlideSizeType.Banner);
}
if (ps.equalsIgnoreCase(“OnScreen”))
{
pres.getSlideSize().setType(SlideSizeType.OnScreen);
}

return pres;
}

the original ppt file and the distorted resulted ppt file is attached

Hi Hafsa,

I have observed the requirement shared by you. The method that you have shared is setting the different slide sizes based on passed arguments. Please share how you are using this and what value you are setting that is not working on your end.

Many Thanks,

com.aspose.slides.IPresentation pres = new com.aspose.slides.Presentation(conn.getInputStream());    <br>        <br>        pres = setPaperSizeSlides(pres,"OnScreen");<br>        <br>        // Initializing a new OutputStream for saving the changed file<br>        ByteArrayOutputStream dstStream = new ByteArrayOutputStream();<br>        <br>        // Saving the changed file in PDf Format<br>        pres.save(dstStream, com.aspose.slides.SaveFormat.Pdf);<br>        pres.save("C:/Users/himran/Documents/output.pdf", com.aspose.slides.SaveFormat.Pdf); // TEMPORARY<br><br><br><br><br>I can set any different paper size depending on my choice, but they are giving the problems mentioned above. The result is distorted<br>

Hi Hafsa,

I have worked with the presentation file and sample code shared. I have been able to observe the issue specified and have created an issue tracking system with ID SLIDESJAVA-34683 to further investigate and resolve the issue. 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,

Ok thankyou

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