/// <summary><inheritDoc/></summary>
 public override void Draw(DrawContext drawContext)
 {
     if (!TargetCounterHandler.IsValueDefinedForThisId(this, target))
     {
         LOGGER.Warn(MessageFormatUtil.Format(iText.Html2pdf.LogMessageConstant.CANNOT_RESOLVE_TARGET_COUNTER_VALUE
                                              , target));
     }
     base.Draw(drawContext);
 }
Esempio n. 2
0
        public virtual void IsValueDefinedForThisIdNotDocumentRendererTest()
        {
            RootRenderer documentRenderer = new _RootRenderer_76();
            String       id       = "id";
            IRenderer    renderer = new _TextRenderer_94(new Text("renderer"));

            renderer.SetParent(documentRenderer);
            renderer.SetProperty(Property.ID, id);
            NUnit.Framework.Assert.IsFalse(TargetCounterHandler.IsValueDefinedForThisId(renderer, id));
        }
Esempio n. 3
0
        public virtual void IsValueDefinedForThisId()
        {
            DocumentRenderer documentRenderer = new DocumentRenderer(null);
            String           id         = "id";
            String           notAddedId = "not added id";
            IRenderer        renderer   = new _TextRenderer_243(new Text("renderer"));

            renderer.SetParent(documentRenderer);
            renderer.SetProperty(Property.ID, id);
            TargetCounterHandler.AddPageByID(renderer);
            NUnit.Framework.Assert.IsTrue(TargetCounterHandler.IsValueDefinedForThisId(renderer, id));
            NUnit.Framework.Assert.IsFalse(TargetCounterHandler.IsValueDefinedForThisId(renderer, notAddedId));
        }