Page numbers are incorrect when rendering with speaker notes


#1

To avoid OutOfMemory problems when rendering Powerpoint presentations we have implemented batch based rendering using Aspose.Slides and Aspose.Pdf.

Our rendering code looks as follows:

Presentation doc = new Presentation(filename);

PdfOptions options = new PdfOptions();
options.setSaveMetafilesAsPng(false);
options.setSufficientResolution(128f);

INotesCommentsLayoutingOptions notesOptions = options.getNotesCommentsLayouting();
notesOptions.setNotesPosition(NotesPositions.BottomFull);

Document combinedPdf = new Document(); // aspose.pdf.Document

int batchSize = 5;
int totalSlides = doc.getSlides().size();
int batches = (int) Math.ceil( ((double) totalSlides) / batchSize);
for(int batch = 1; batch <= batches; batch++) {
    int slideStart = ((batch-1) * batchSize) + 1;
    int slideEnd = (batch == batches) ? totalSlides : batch * batchSize ;
    int[] slides = IntStream.rangeClosed(slideStart, slideEnd).toArray();

    ByteArrayOutputStream batchOutputStream = new ByteArrayOutputStream();
    doc.save(batchOutputStream, slides, SaveFormat.Pdf, options);
    InputStream batchInputStream = new ByteArrayInputStream(batchOutputStream.toByteArray());
    Document batchDocument = new Document(batchInputStream);

    combinedPdf.getPages().add(batchDocument.getPages());
}

combinedPdf.save(outputFilename);          

The batch functionality works very well and we are no longer seeing memory problems. We are however running into a problem with page numbers. The page numbers keep resetting for each batch. When using a batch size of 5 the page number will reset to 1 on slide 6, 11, 16 etc.

This behaviour can only be observed when using notesOptions.setNotesPosition(NotesPositions.BottomFull), if we set notesOptions.setNotesPosition(NotesPositions.None) it seems to work as expected.

Using NotesPositions.None is however not an option, we need to print with speaker notes. How can we keep the correct page numbers while showing speaker notes?

Here are examples of rendered presentations:

  • With NotesPositions.BottomFullout.pdf (365.3 KB)
  • With NotesPositions.None out.pdf (79.2 KB)

Test presentation: page-number-test.pptx.zip (50.4 KB)


#2

@sbd,

I have observed the issue shared by you and have created an issue with ID SLIDESJAVA-37615 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 automatically notified once the issue will be fixed.


#3

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