How to add page breaks to epub files

I am using Aspose.Words to create text documents which I then export as PDF and ePUB files. I try to add page breaks to the epub file. I use the following code:

builder.Writeln("line 1");
builder.InsertBreak(BreakType.PageBreak);
builder.Writeln("line 2");

If I save this as docx or as pdf, the page break works as expected. But in the epub files, the two lines are on the same page.

How can I make “line 2” to start on a new page in an epub file?

@eexperts There is no page concept in EPUB format. Content is exported as flow document. To make the content split by page break appear in different parts of EPUB documents, you can use DocumentSplitCriteria.PageBreak.

Ah great. Thanks for the hint!

1 Like