private void LogCreatedRootTagHasMappingIssue(PdfNamespace rootTagOriginalNs, IRoleMappingResolver mapping ) { String origRootTagNs = ""; if (rootTagOriginalNs != null && rootTagOriginalNs.GetNamespaceName() != null) { origRootTagNs = " in \"" + rootTagOriginalNs.GetNamespaceName() + "\" namespace"; } String mappingRole = " to "; if (mapping != null) { mappingRole += "\"" + mapping.GetRole() + "\""; if (mapping.GetNamespace() != null && !StandardNamespaces.PDF_1_7.Equals(mapping.GetNamespace().GetNamespaceName ())) { mappingRole += " in \"" + mapping.GetNamespace().GetNamespaceName() + "\" namespace"; } } else { mappingRole += "not standard role"; } ILog logger = LogManager.GetLogger(typeof(iText.Kernel.Pdf.Tagutils.RootTagNormalizer)); logger.Warn(String.Format(iText.IO.LogMessageConstant.CREATED_ROOT_TAG_HAS_MAPPING, origRootTagNs, mappingRole )); }
public virtual bool CurrentRoleIsStandard() { String roleStrVal = currRole.GetValue(); bool stdRole17 = currNamespace.GetNamespaceName().Equals(StandardNamespaces.PDF_1_7) && StandardNamespaces .RoleBelongsToStandardNamespace(roleStrVal, StandardNamespaces.PDF_1_7); bool stdRole20 = currNamespace.GetNamespaceName().Equals(StandardNamespaces.PDF_2_0) && StandardNamespaces .RoleBelongsToStandardNamespace(roleStrVal, StandardNamespaces.PDF_2_0); return(stdRole17 || stdRole20); }
internal virtual void EnsureNamespaceRegistered(PdfNamespace @namespace) { if (@namespace != null) { PdfDictionary namespaceObj = @namespace.GetPdfObject(); if (!namespaces.Contains(namespaceObj)) { namespaces.Add(namespaceObj); } nameToNamespace.Put(@namespace.GetNamespaceName(), @namespace); } }
// it is StructTreeRoot // should never happen as we always should have only one root tag and we don't remove it private String ComposeExceptionBasedOnNamespacePresence(String role, PdfNamespace @namespace, String withoutNsEx , String withNsEx) { if (@namespace == null) { return(String.Format(withoutNsEx, role)); } else { String nsName = @namespace.GetNamespaceName(); PdfIndirectReference @ref = @namespace.GetPdfObject().GetIndirectReference(); if (@ref != null) { nsName = nsName + " (" + JavaUtil.IntegerToString(@ref.GetObjNumber()) + " " + JavaUtil.IntegerToString(@ref .GetGenNumber()) + " obj)"; } return(String.Format(withNsEx, role, nsName)); } }
private static bool IsTagStructurePdf2(PdfNamespace @namespace) { return(@namespace != null && StandardNamespaces.PDF_2_0.Equals(@namespace.GetNamespaceName())); }