Save individual slide PDF (Java)

I was trying to follow the steps documented at:

When using the following code:

    Presentation presentation = new Presentation(fileName);
    ISlide slide = presentation.getSlides().get_Item(1);

    Presentation slidePresentation = new Presentation();

    // Clone the selected slide at the end of another presentation file
    // Set the cloned slide dimensions
    Dimension2D slideSize = presentation.getSlideSize().getSize();
    slidePresentation.getSlideSize().setSize((float)slideSize.getWidth(), (float)slideSize.getHeight(), SlideSizeScaleType.EnsureFit);

    // Remove default empty slide
    slidePresentation.getSlides().remove(slidePresentation.getSlides().get_Item(0));".pdf", SaveFormat.Pdf);

On file:

I see that part of the slide is cut-off


I have observed your requirements. If you intend to export only particular slide to PDF then you don’t really need to perform slide cloning to a new presentation and saving that to PDF. Aspose.Slides allows to export a particular slide/slides to PDF. I request you to please visit this documentation link for your kind reference.