a document after adding a cover page, when saving document aspose will throw exception.
my test code: (excute this function twice will always throw exception)
private void btnAddCover_Click(object sender, EventArgs e)
{
string builtinBuildingblock = @"C:\Users\CHN\AppData\Roaming\Microsoft\Document Building Blocks\1033\15\Built-In Building Blocks.dotx";
string docFile = @"C:\Users\CHN\Desktop\testDoc\Test.Docx";
ADoc.Document docx = new ADoc.Document(docFile);
new DocumentNormalizer(docx).Normalize();
ADoc.Document docBuildingBlocks = new ADoc.Document(builtinBuildingblock);
CreateCover(docx, docBuildingBlocks, "Semaphore");
docx.Save(docFile, SaveFormat.Docx);
}
DocumentNormalizer class just delete some unnecessary document node.
please use attechment to test. the attachment include the some part of sourcecode.
thanks.