Ejemplo n.º 1
0
        /// <summary>
        /// Adds a new RefFieldPage.
        /// </summary>
        public PageRefField AddPageRefField(string name)
        {
            PageRefField fieldPageRef = new PageRefField();

            fieldPageRef.Name = name;
            Add(fieldPageRef);
            return(fieldPageRef);
        }
Ejemplo n.º 2
0
        //  [UnitTestFunction]
        public static void TestFields()
        {
            Document doc = new Document();

            doc.Info.Author = "K.P.";
            Section   sec = doc.Sections.AddSection();
            Paragraph par = sec.AddParagraph();

            par.AddBookmark("myBookmark1");

            PageRefField prf = par.AddPageRefField("myBookmark1");

            prf.Format = "ALPHABETIC";

            PageField pf = par.AddPageField();

            pf.Format = "ROMAN";

            SectionField sf = par.AddSectionField();

            sf.Format = "roman";

            SectionPagesField spf = par.AddSectionPagesField();

            spf.Format = "roman";

            NumPagesField npf = par.AddNumPagesField();

            npf.Format = "alphabetic";

            InfoField inf = par.AddInfoField(InfoFieldType.Author);
            DateField df  = par.AddDateField("D");

            df = par.AddDateField("d");
            df = par.AddDateField("s");
            df = par.AddDateField("r");
            df = par.AddDateField("G");
            df = par.AddDateField("dddd dd.MM.yyyy");

            DocumentRenderer docRndrr = new DocumentRenderer();

            docRndrr.Render(doc, "RtfFields.txt", null);

            File.Copy("RtfFields.txt", "RtfFields.rtf", true);
            System.Diagnostics.Process.Start("RtfFields.txt");
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a new PageRefField
 /// </summary>
 public void Add(PageRefField pageRefField)
 {
     this.Elements.Add(pageRefField);
 }