We are using Aspose.Words .NET 17.3 in an IIS web service.
Our application uses Word templates in a range of formats (doc, docx, rtf) containing MailMerge tags, and sometimes conditional logic. We merge data with those templates, then we SPLIT the document (using PageSplitter) so we can find the exact location of certain objects (Shapes) AFTER the merge. It’s critical we know the Page number each objects lands on. For that, we use PageSplitter to split the document into individual page sub documents.
DocumentPageSplitter splitter = new DocumentPageSplitter(layoutCollector);
for (int page = 1; page <= doc.PageCount; page++)
{
Aspose.Words.Document pageDoc = new Aspose.Words.Document();
pageDoc = splitter.GetDocumentOfPage(page);
. . . .
}
The single page sub documents created by the PageSplitter do not split accurately. Each sub document should be a single page, but we regularly find a few extra words or characters on a SECOND page in the sub document.
I saw a related thread (Split document page issue) where Moderator Tahir Manzoor suggested installing fonts used in the document on the server. That will NOT work for us, because we are accepting Word files from Customers. We can not always have every font they have. We assume if font substitution happens, the result will look good enough.
Background - I inherited this code base from a developer who left. I’m not sure how she set this all up
Question 1) I see the source code for PageSplitter.cs is built directly into our project. Is that normal? I expected PageSplitter to be part of the object model Aspose provides?
Question 2) Where can I get the latest version of PageSplitter.cs? I don’t see it when I search Aspose.Words docs.
Question 3) Are there cases where PageSplitter is KNOWN to have problems?
Thanks for your help,
SimpleTestSignableBadSplit.zip (26.9 KB)
Peter Cleaveland