public void init() { workerContextImpl = new WorkerContextImpl(); workerContextImpl.Put(typeof (HtmlPipeline).FullName, new HtmlPipelineContext(null)); t.SetCssAppliers(new CssAppliersImpl()); content = t.Content(workerContextImpl, new Tag("pre"), " code snippet {" + "return it all!!} "); }
virtual public void SetUp() { workerContextImpl = new WorkerContextImpl(); workerContextImpl.Put(typeof (HtmlPipeline).FullName, new HtmlPipelineContext(null)); s.SetCssAppliers(new CssAppliersImpl()); content = s.Content(workerContextImpl, new Tag("span"), " text snippet " + "return it sanitized!! "); }
virtual public void VerifyBreakChunk() { Break br = new Break(); WorkerContextImpl workerContextImpl = new WorkerContextImpl(); CssAppliersImpl cssAppliers = new CssAppliersImpl(); workerContextImpl.Put(typeof (HtmlPipeline).FullName, new HtmlPipelineContext(cssAppliers)); br.SetCssAppliers(cssAppliers); IList<IElement> end = br.End(workerContextImpl, new Tag("span"), null); Assert.AreEqual(Chunk.NEWLINE.Content, end[0].Chunks[0].Content); }
virtual public void ResolveBuild() { AbstractTagProcessor table2 = new Table(); table2.SetCssAppliers(new CssAppliersImpl()); WorkerContextImpl context = new WorkerContextImpl(); context.Put(typeof (HtmlPipeline).FullName, new HtmlPipelineContext(null)); PdfPTable table = (PdfPTable) (table2.End(context, tag, rows)[0]); Assert.AreEqual(4, table.Rows[0].GetCells().Length); Assert.AreEqual(4, table.NumberOfColumns); }
virtual public void SetUp() { workerContextImpl = new WorkerContextImpl(); workerContextImpl.Put(typeof (HtmlPipeline).FullName, new HtmlPipelineContext(null)); currentContent.Add(new Paragraph("titel paragraph")); currentContent.Add(Chunk.NEWLINE); currentContent.Add(new NoNewLineParagraph("first content text")); currentContent.Add(new Paragraph("footer text")); d.SetCssAppliers(new CssAppliersImpl()); }
virtual public void TestContentToChunk() { Anchor a = new Anchor(); Tag t = new Tag("dummy"); String content2 = "some content"; WorkerContextImpl ctx = new WorkerContextImpl(); HtmlPipelineContext htmlPipelineContext = new HtmlPipelineContext(null); ctx.Put(typeof (HtmlPipeline).FullName, htmlPipelineContext); a.SetCssAppliers(new CssAppliersImpl()); IList<IElement> ct = a.Content(ctx, t, content2); Assert.AreEqual(content2, ct[0].Chunks[0].Content); }
public void SetUp() { lst = new List<IWritable>(); IElementHandler elemH = new CustomElementHandler(); p = new ElementHandlerPipeline(elemH, null); po = new ProcessObject(); writable = new WritableElement(new Chunk("aaaaa")); po.Add(writable); context = new WorkerContextImpl(); p.Init(context); }
virtual public void SetUp() { StyleAttrCSSResolver css = new StyleAttrCSSResolver(); css.AddCss("dummy { key1: value1; key2: value2 } .aklass { key3: value3;} #dumid { key4: value4}", true); CssResolverPipeline p = new CssResolverPipeline(css, null); Tag t = new Tag("dummy"); t.Attributes["id"] = "dumid"; t.Attributes["class"] = "aklass"; WorkerContextImpl context = new WorkerContextImpl(); p.Init(context); IPipeline open = p.Open(context, t, null); css2 = t.CSS; }
virtual public void SetUp() { LoggerFactory.GetInstance().SetLogger(new SysoLogger(3)); root = new Tag("body"); p = new Tag("p"); ul = new Tag("ul"); first = new Tag("li"); last = new Tag("li"); single = new ListItem("Single"); start = new ListItem("Start"); end = new ListItem("End"); listWithOne = new List<IElement>(); listWithTwo = new List<IElement>(); orderedUnorderedList = new OrderedUnorderedList(); CssAppliersImpl cssAppliers = new CssAppliersImpl(); orderedUnorderedList.SetCssAppliers(cssAppliers); workerContextImpl = new WorkerContextImpl(); HtmlPipelineContext context2 = new HtmlPipelineContext(cssAppliers); workerContextImpl.Put(typeof (HtmlPipeline).FullName, context2); root.AddChild(p); root.AddChild(ul); ul.AddChild(first); ul.AddChild(last); p.CSS["font-size"] = "12pt"; p.CSS["margin-top"] = "12pt"; p.CSS["margin-bottom"] = "12pt"; new ParagraphCssApplier(cssAppliers).Apply(new Paragraph("paragraph"), p, context2); first.CSS["margin-top"] = "50pt"; first.CSS["padding-top"] = "25pt"; first.CSS["margin-bottom"] = "50pt"; first.CSS["padding-bottom"] = "25pt"; last.CSS["margin-bottom"] = "50pt"; last.CSS["padding-bottom"] = "25pt"; listWithOne.Add(single); listWithTwo.Add(start); listWithTwo.Add(end); }
virtual public void Init() { b.SetCssAppliers(new CssAppliersImpl()); workerContextImpl = new WorkerContextImpl(); workerContextImpl.Put(typeof (HtmlPipeline).FullName, new HtmlPipelineContext(null)); }
virtual public void SetUp() { hpc = new HtmlPipelineContext(null); p = new HtmlPipeline(hpc, null); wc = new WorkerContextImpl(); p.Init(wc); }
virtual public void init() { h.SetCssAppliers(new CssAppliersImpl()); workerContextImpl = new WorkerContextImpl(); workerContextImpl.Put(typeof (HtmlPipeline).FullName, new HtmlPipelineContext(null).AutoBookmark(true)); content = h.Content(workerContextImpl, H2, "text inside a header tag"); }
/** * Returns the local WorkerContext, beware: could be a newly initialized * one, if {@link XMLWorker#close()} has been called before. * * @return the local WorkerContext */ virtual protected internal IWorkerContext GetLocalWC() { IWorkerContext ik = (IWorkerContext)Thread.GetData(context); if (ik == null) { ik = new WorkerContextImpl(); Thread.SetData(context, ik); } return ik; }
public void init() { li.SetCssAppliers(new CssAppliersImpl()); workerContextImpl = new WorkerContextImpl(); workerContextImpl.Put(typeof (HtmlPipeline).FullName, new HtmlPipelineContext(null)); currentContent.AddRange(li.Content(workerContextImpl, new Tag("li"), "list item")); }
virtual public void SetUp() { workerContextImpl = new WorkerContextImpl(); p.SetCssAppliers(new CssAppliersImpl()); workerContextImpl.Put(typeof (HtmlPipeline).FullName, new HtmlPipelineContext(null)); currentContent.AddRange(p.Content(workerContextImpl, new Tag("p"), "some paragraph text")); }