Free Support Forum - aspose.com

Slide-for-java


#1

slides.png (29.6 KB)


#2

@xianlu,

我已经观察了您的评论并与您共享示例代码。这将帮助您实现您的要求。

public static void main(String[] args) {
//ExStart:ConvertingASpecificSlideToPDF

  // The path to the documents directory.
  String dataDir = Utils.getDataDir(ConvertingASpecificSlideToPDF.class);

  // Instantiate a Presentation object that represents a presentation file
  Presentation pres = new Presentation(dataDir + "demo.pptx");
  // Setting array of slides positions
  int[] slides = new int[] { 2, 3, 5 };

  // Save the presentation to PDF
  pres.save(dataDir + "demo.pdf", slides, SaveFormat.Pdf);

//ExEnd:ConvertingASpecificSlideToPDF