public void SanityCheck()
{
if (GetMcDepth() != 0) {
throw new IllegalPdfSyntaxException(MessageLocalization.GetComposedMessage("unbalanced.marked.content.operators"));
}
if (inText) {
if (autoControlTextBlocks) {
EndText();
} else {
throw new IllegalPdfSyntaxException(MessageLocalization.GetComposedMessage("unbalanced.begin.end.text.operators"));
}
}
if (layerDepth != null && layerDepth.Count > 0) {
throw new IllegalPdfSyntaxException(MessageLocalization.GetComposedMessage("unbalanced.layer.operators"));
}
if (stateList.Count > 0) {
throw new IllegalPdfSyntaxException(MessageLocalization.GetComposedMessage("unbalanced.save.restore.state.operators"));
}
}