private void CreateNewRootTag() { IRoleMappingResolver mapping; PdfNamespace docDefaultNs = context.GetDocumentDefaultNamespace(); mapping = context.ResolveMappingToStandardOrDomainSpecificRole(StandardRoles.DOCUMENT, docDefaultNs); if (mapping == null || mapping.CurrentRoleIsStandard() && !StandardRoles.DOCUMENT.Equals(mapping.GetRole() )) { LogCreatedRootTagHasMappingIssue(docDefaultNs, mapping); } rootTagElement = document.GetStructTreeRoot().AddKid(new PdfStructElem(document, PdfName.Document)); if (context.TargetTagStructureVersionIs2()) { rootTagElement.SetNamespace(docDefaultNs); context.EnsureNamespaceRegistered(docDefaultNs); } }
private void ProcessKidNamespace(PdfStructElem kid) { PdfNamespace kidNamespace = kid.GetNamespace(); if (currentNamespace != null && kidNamespace == null) { kid.SetNamespace(currentNamespace); kidNamespace = currentNamespace; } tagStructureContext.EnsureNamespaceRegistered(kidNamespace); }