• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# text.ListItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中iTextSharp.text.ListItem的典型用法代码示例。如果您正苦于以下问题:C# ListItem类的具体用法?C# ListItem怎么用?C# ListItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ListItem类属于iTextSharp.text命名空间,在下文中一共展示了ListItem类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Write

        public void Write(string outputPath, FlowDocument doc)
        {
            Document pdfDoc = new Document(PageSize.A4, 50, 50, 50, 50);
            Font textFont = new Font(baseFont, DEFAULT_FONTSIZE, Font.NORMAL, BaseColor.BLACK);
            Font headingFont = new Font(baseFont, DEFAULT_HEADINGSIZE, Font.BOLD, BaseColor.BLACK);
            using (FileStream stream = new FileStream(outputPath, FileMode.Create))
            {
                PdfWriter writer = PdfWriter.GetInstance(pdfDoc, stream);
                pdfDoc.Open();
                foreach (Block i in doc.Blocks) {
                    if (i is System.Windows.Documents.Paragraph)
                    {
                        TextRange range = new TextRange(i.ContentStart, i.ContentEnd);
                        Console.WriteLine(i.Tag);
                        switch (i.Tag as string)
                        {
                            case "Paragraph": iTextSharp.text.Paragraph par = new iTextSharp.text.Paragraph(range.Text, textFont);
                                par.Alignment = Element.ALIGN_JUSTIFIED;
                                              pdfDoc.Add(par);
                                              break;
                            case "Heading": iTextSharp.text.Paragraph head = new iTextSharp.text.Paragraph(range.Text, headingFont);
                                              head.Alignment = Element.ALIGN_CENTER;
                                              head.SpacingAfter = 10;
                                              pdfDoc.Add(head);
                                              break;
                            default:          iTextSharp.text.Paragraph def = new iTextSharp.text.Paragraph(range.Text, textFont);
                                              def.Alignment = Element.ALIGN_JUSTIFIED;
                                              pdfDoc.Add(def);
                                              break;

                        }
                    }
                    else if (i is System.Windows.Documents.List)
                    {
                        iTextSharp.text.List list = new iTextSharp.text.List(iTextSharp.text.List.UNORDERED, 10f);
                        list.SetListSymbol("\u2022");
                        list.IndentationLeft = 15f;
                        foreach (var li in (i as System.Windows.Documents.List).ListItems)
                        {
                            iTextSharp.text.ListItem listitem = new iTextSharp.text.ListItem();
                            TextRange range = new TextRange(li.Blocks.ElementAt(0).ContentStart, li.Blocks.ElementAt(0).ContentEnd);
                            string text = range.Text.Substring(1);
                            iTextSharp.text.Paragraph par = new iTextSharp.text.Paragraph(text, textFont);
                            listitem.SpacingAfter = 10;
                            listitem.Add(par);
                            list.Add(listitem);
                        }
                        pdfDoc.Add(list);
                    }

               }
                if (pdfDoc.PageNumber == 0)
                {
                    iTextSharp.text.Paragraph par = new iTextSharp.text.Paragraph(" ");
                    par.Alignment = Element.ALIGN_JUSTIFIED;
                    pdfDoc.Add(par);
                }
               pdfDoc.Close();
            }
        }
开发者ID:drdaemos,项目名称:ODTCONVERTvs10,代码行数:60,代码来源:PDFWriter.cs


示例2: End

 /* (non-Javadoc)
  * @see com.itextpdf.tool.xml.ITagProcessor#endElement(com.itextpdf.tool.xml.Tag, java.util.List)
  */
 public override IList<IElement> End(IWorkerContext ctx, Tag tag, IList<IElement> currentContent) {
     IList<IElement> l = new List<IElement>(1);
     ListItem li = new ListItem();
     float maxSize = -1;
     foreach (IElement e in currentContent) {
         li.Add(e);
         //finding max leading among list item elements
         foreach (Chunk chunk in e.Chunks) {
             // here we use 4f/3 multiplied leading value to simulate leading which is used with default font size
             float currFontSize = chunk.Font.GetCalculatedLeading(4f/3);
             if (maxSize < currFontSize) {
                 maxSize = currFontSize;
             }
         }
     }
     if (li.Leading < maxSize)
         li.Leading = maxSize;
     if (li.Trim()) {
         l.Add(li); // css applying is handled in the OrderedUnorderedList Class.
     }
     return l;
 }
开发者ID:newlysoft,项目名称:itextsharp,代码行数:25,代码来源:OrderedUnorderedListItem.cs


示例3: CreatePdf

 // ---------------------------------------------------------------------------
 /**
  * Creates the PDF.
  * @return the bytes of a PDF file.
  */
 public byte[] CreatePdf()
 {
     IEnumerable<Movie> movies = PojoFactory.GetMovies(1);
       using (MemoryStream ms = new MemoryStream()) {
     using (Document document = new Document()) {
       PdfWriter writer = PdfWriter.GetInstance(document, ms);
       document.Open();
       document.Add(new Paragraph(
     "'Stanley Kubrick: A Life in Pictures'"
     + " is a documentary about Stanley Kubrick and his films:"
       ));
       StringBuilder sb = new StringBuilder();
       sb.AppendLine("<movies>");
       List list = new List(List.UNORDERED, 20);
       foreach (Movie movie in movies) {
     sb.AppendLine("<movie>");
     sb.AppendLine(String.Format(
       "<title>{0}</title>",
       XMLUtil.EscapeXML(movie.MovieTitle, true)
     ));
     sb.AppendLine(String.Format("<year>{0}</year>", movie.Year));
     sb.AppendLine(String.Format(
       "<duration>{0}</duration>", movie.Duration
     ));
     sb.AppendLine("</movie>");
     ListItem item = new ListItem(movie.MovieTitle);
     list.Add(item);
       }
       document.Add(list);
       sb.Append("</movies>");
       PdfFileSpecification fs = PdfFileSpecification.FileEmbedded(
     writer, null, "kubrick.xml", Encoding.UTF8.GetBytes(sb.ToString())
     //txt.toByteArray()
       );
       writer.AddFileAttachment(fs);
     }
     return ms.ToArray();
       }
 }
开发者ID:kuujinbo,项目名称:iTextInAction2Ed,代码行数:44,代码来源:KubrickDocumentary.cs


示例4: SetUp

        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);
        }
开发者ID:yu0410aries,项目名称:itextsharp,代码行数:38,代码来源:OrderedUnorderedListTest.cs


示例5: Write

 // ---------------------------------------------------------------------------
 public void Write(Stream stream)
 {
     // step 1
     using (Document document = new Document())
     {
         // step 2
         PdfWriter.GetInstance(document, stream);
         // step 3
         document.Open();
         // step 4
         Director director;
         using (var c = AdoDB.Provider.CreateConnection())
         {
             c.ConnectionString = AdoDB.CS;
             using (DbCommand cmd = c.CreateCommand())
             {
                 cmd.CommandText = SQL;
                 c.Open();
                 using (var r = cmd.ExecuteReader())
                 {
                     while (r.Read())
                     {
                         // create a paragraph for the director
                         director = PojoFactory.GetDirector(r);
                         Paragraph p = new Paragraph(
                             PojoToElementFactory.GetDirectorPhrase(director));
                         // add a dotted line separator
                         p.Add(new Chunk(new DottedLineSeparator()));
                         // adds the number of movies of this director
                         p.Add(string.Format("movies: {0}", Convert.ToInt32(r["c"])));
                         document.Add(p);
                         // Creates a list
                         List list = new List(List.ORDERED);
                         list.IndentationLeft = 36;
                         list.IndentationRight = 36;
                         // Gets the movies of the current director
                         var director_id = Convert.ToInt32(r["id"]);
                         ListItem movieitem;
                         // LINQ allows us to on sort any movie object property inline;
                         // let's sort by Movie.Year, Movie.Title
                         var by_year = from m in PojoFactory.GetMovies(director_id)
                                       orderby m.Year, m.Title
                                       select m;
                         // loops over the movies
                         foreach (Movie movie in by_year)
                         {
                             // creates a list item with a movie title
                             movieitem = new ListItem(movie.MovieTitle);
                             // adds a vertical position mark as a separator
                             movieitem.Add(new Chunk(new VerticalPositionMark()));
                             var yr = movie.Year;
                             // adds the year the movie was produced
                             movieitem.Add(new Chunk(yr.ToString()));
                             // add an arrow to the right if the movie dates from 2000 or later
                             if (yr > 1999)
                             {
                                 movieitem.Add(PositionedArrow.RIGHT);
                             }
                             // add the list item to the list
                             list.Add(movieitem);
                         }
                         // add the list to the document
                         document.Add(list);
                     }
                 }
             }
         }
     }
 }
开发者ID:kuujinbo,项目名称:iTextInAction2Ed,代码行数:70,代码来源:DirectorOverview2.cs


示例6: ListBody

 public ListBody(ListItem parentItem, float indentation) : this(parentItem) {
     this.indentation = indentation;
 }
开发者ID:Gianluigi,项目名称:dssnet,代码行数:3,代码来源:ListBody.cs


示例7: GetListItem

 public static ListItem GetListItem(Properties attributes)
 {
     ListItem item = new ListItem(GetParagraph(attributes));
     return item;
 }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:5,代码来源:ElementFactory.cs


示例8: AddAssumptions

        private void AddAssumptions(Project project, Document document)
        {
            if (project.Assumptions == null || project.Assumptions.Count < 1)
                return;

            var element = new Paragraph("Assumptions", TitleFont());
            element.SpacingBefore = 5f;
            document.Add(element);

            var list = new List(false, false, 10);
            list.SetListSymbol("\u2022");
            list.IndentationLeft = 10f;

            foreach (var assumption in project.Assumptions)
            {
                var item = new ListItem(assumption);
                list.Add(item);
            }

            document.Add(list);
        }
开发者ID:modulexcite,项目名称:Estimatorx,代码行数:21,代码来源:DocumentCreator.cs


示例9: CreateListItem

 /**
  * Creates an iText Paragraph object using the properties
  * of the different tags and properties in the hierarchy chain.
  * @param   chain   the hierarchy chain
  * @return  a ListItem without any content
  */
 public ListItem CreateListItem(ChainedProperties chain) {
     ListItem item = new ListItem();
     UpdateElement(item, chain);
     return item;
 }
开发者ID:Gianluigi,项目名称:dssnet,代码行数:11,代码来源:ElementFactory.cs


示例10: ListLabel

 protected internal ListLabel(ListItem parentItem) : base(parentItem)
 {
     role = PdfName.LBL;
     indentation = 0;
 }
开发者ID:joshaxey,项目名称:Simple-PDFMerge,代码行数:5,代码来源:ListLabel.cs


示例11: GeneratePDFAndMail


//.........这里部分代码省略.........
        Anchor anchor = new Anchor("http://www.stgeorge.com.au/idchecklist", link);
        anchor.Reference = "http://www.stgeorge.com.au/idchecklist";
        pdfDoc.Add(anchor);
        pdfDoc.Add(new Phrase(Environment.NewLine + Environment.NewLine, FontType));

         #region CodeFonewFourProduct
        PdfPTable pdfpTableAdditionalProductnew = new PdfPTable(2);
        pdfpTableAdditionalProductnew.WidthPercentage = 100f;
        int[] TableAdditionalProductwidthnew = { 30, 70 };
        pdfpTableAdditionalProductnew.SetWidths(TableAdditionalProductwidthnew);

        phrase = new Phrase(" " + Environment.NewLine);
        phrase.Add(new Chunk("My Business Connect", FontTypeBold));
        phrase.Add(Environment.NewLine + " ");
        PdfPCell cellAdditionalProductnew = new PdfPCell(phrase);
        cellAdditionalProductnew.Colspan = 3;

        //Used to checked Last Five product is selected
        bool isLastFourProductSelected = false;
        if (fifteenid.Checked)
        {
           // pdfDoc.NewPage();
            pdfpTableAdditionalProductnew.AddCell(cellAdditionalProductnew);
            isLastFourProductSelected = true;

            PdfPCell Cell1 = new PdfPCell(new Phrase(Environment.NewLine +Environment.NewLine +"Planning and Setup", FontTypeBold));
            pdfpTableAdditionalProductnew.AddCell(Cell1);
            phrase = new Phrase();
            phrase.Add(new Chunk("Make a business plan?", FontTypeBold));

        list = new iTextSharp.text.List(false, 8);
                list.ListSymbol = bullet;
         ////////list.Add(new iTextSharp.text.ListItem(new Chunk("With this account, all day-to-day electronic transactions are fee-free",FontType)));
                list.Add(new iTextSharp.text.ListItem(new Chunk("Follow the PlanHQ business plan wizard to produce a personalised business plan",FontType)));
                list.Add(new iTextSharp.text.ListItem(new Chunk("Understand and manage the tasks associated with setting up a business",FontType)));

                PdfPCell objCell = new PdfPCell();
                objCell.AddElement(phrase);
                objCell.AddElement(list);
                objCell.AddElement(new Phrase(" "));

                objCell.Colspan = 2;
                pdfpTableAdditionalProductnew.AddCell(objCell);

        }
        if (sixteenid.Checked)
        {
            if (!isLastFourProductSelected)
            {
               // pdfDoc.NewPage();
                pdfpTableAdditionalProductnew.AddCell(cellAdditionalProductnew);
                isLastFourProductSelected = true;
            }
            PdfPCell Cell1 = new PdfPCell(new Phrase(Environment.NewLine +Environment.NewLine +"Manage Finances", FontTypeBold));
            pdfpTableAdditionalProductnew.AddCell(Cell1);
            phrase = new Phrase();
            phrase.Add(new Chunk("Track money coming in and out of the business?", FontTypeBold));
           phrase.Add(new Chunk("      and/or",FontType));
            phrase.Add(new Chunk(Environment.NewLine + "Keep track of receipts without the data entry?", FontTypeBold));

        list = new iTextSharp.text.List(false, 8);
                list.ListSymbol = bullet;
         ////////list.Add(new iTextSharp.text.ListItem(new Chunk("With this account, all day-to-day electronic transactions are fee-free",FontType)));
                list.Add(new iTextSharp.text.ListItem(new Chunk("Saasu helps make managing and monitoring business cash flow and finances simpler and more straightforward",FontType)));
                list.Add(new iTextSharp.text.ListItem(new Chunk("Receipt Bank is the quick and easy way of recording receipts and invoices. No more entering data manually – just take a photo of a receipt and send it for processing in the click of a button",FontType)));
开发者ID:hafizor,项目名称:stgeorge,代码行数:66,代码来源:Default.aspx.cs


示例12: RtfList

        /**
        * Constructs a new RtfList for the specified List.
        *
        * @param doc The RtfDocument this RtfList belongs to
        * @param list The List this RtfList is based on
        */
        public RtfList(RtfDocument doc, List list)
            : base(doc)
        {
            this.listNumber = document.GetDocumentHeader().GetListNumber(this);

            this.items = new ArrayList();
            if (list.SymbolIndent > 0 && list.IndentationLeft > 0) {
                this.firstIndent = (int) (list.SymbolIndent * RtfElement.TWIPS_FACTOR * -1);
                this.leftIndent = (int) ((list.IndentationLeft + list.SymbolIndent) * RtfElement.TWIPS_FACTOR);
            } else if (list.SymbolIndent > 0) {
                this.firstIndent = (int) (list.SymbolIndent * RtfElement.TWIPS_FACTOR * -1);
                this.leftIndent = (int) (list.SymbolIndent * RtfElement.TWIPS_FACTOR);
            } else if (list.IndentationLeft > 0) {
                this.firstIndent = 0;
                this.leftIndent = (int) (list.IndentationLeft * RtfElement.TWIPS_FACTOR);
            } else {
                this.firstIndent = 0;
                this.leftIndent = 0;
            }
            this.rightIndent = (int) (list.IndentationRight * RtfElement.TWIPS_FACTOR);
            this.symbolIndent = (int) ((list.SymbolIndent + list.IndentationLeft) * RtfElement.TWIPS_FACTOR);
            this.numbered = list.IsNumbered();

            for (int i = 0; i < list.Items.Count; i++) {
                try {
                    IElement element = (IElement) list.Items[i];
                    if (element.Type == Element.CHUNK) {
                        element = new ListItem((Chunk) element);
                    }
                    if (element is ListItem) {
                        this.alignment = ((ListItem) element).Alignment;
                    }
                    IRtfBasicElement rtfElement = doc.GetMapper().MapElement(element);
                    if (rtfElement is RtfList) {
                        ((RtfList) rtfElement).SetListNumber(listNumber);
                        ((RtfList) rtfElement).SetListLevel(listLevel + 1);
                        ((RtfList) rtfElement).SetParent(this);
                    } else if (rtfElement is RtfListItem) {
                        ((RtfListItem) rtfElement).SetParent(this);
                        ((RtfListItem) rtfElement).InheritListSettings(listNumber, listLevel + 1);
                    }
                    items.Add(rtfElement);
                } catch (DocumentException ) {
                }
            }
            if (this.listLevel == 0) {
                CorrectIndentation();
            }

            fontNumber = new ST.RtfFont(document, new Font(Font.TIMES_ROMAN, 10, Font.NORMAL, new Color(0, 0, 0)));
            fontBullet = new ST.RtfFont(document, new Font(Font.SYMBOL, 10, Font.NORMAL, new Color(0, 0, 0)));
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:58,代码来源:RtfList.cs


示例13: RtfListItem

 /**
 * Constructs a RtfListItem for a ListItem belonging to a RtfDocument.
 *
 * @param doc The RtfDocument this RtfListItem belongs to.
 * @param listItem The ListItem this RtfListItem is based on.
 */
 public RtfListItem(RtfDocument doc, ListItem listItem)
     : base(doc, listItem)
 {
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:10,代码来源:RtfListItem.cs


示例14: AddList

        private float AddList(string[] chunks, iTextSharp.text.Font font, float spacingBefore, float spacingAfter, float spacingBetween, int alignment, float lineHightMultiplier, string listSymbol, int padding, float indentationLeft, Document doc)
        {
            int count = 0;
            float height = 0;
            float fontSize = font.Size * lineHightMultiplier;
            var paragraph = new Paragraph();

            var list = new List(List.UNORDERED);
            list.SetListSymbol(listSymbol.PadRight(padding));
            list.IndentationLeft = indentationLeft;

            foreach (string item in chunks)
            {
                if (string.IsNullOrEmpty(item)) continue;
                var chunk = new Chunk(item, font);
                chunk.setLineHeight(font.Size * lineHightMultiplier);
                var listItem = new ListItem(chunk);
                listItem.SpacingBefore = spacingBetween;
                list.Add(listItem);
                count++;
            }

            if (count > 0)
            {
                paragraph.Add(list);
                paragraph.Alignment = alignment;
                paragraph.SpacingBefore = spacingBefore;
                paragraph.SpacingAfter = spacingAfter;
                doc.Add(paragraph);
                height = spacingBefore + spacingAfter + count * (fontSize + spacingBetween) - spacingBetween;
            }

            return height;
        }
开发者ID:tsigdel-idc,项目名称:oracle-paas-2015,代码行数:34,代码来源:PdfReport.cs


示例15: GeneratePDF1


//.........这里部分代码省略.........
            pdfDoc.Add(anchor);
            pdfDoc.Add(new Phrase(Environment.NewLine + Environment.NewLine, FontType));

            #region CodeForLastFiveProduct
            PdfPTable pdfpTableAdditionalProduct = new PdfPTable(2);
            pdfpTableAdditionalProduct.WidthPercentage = 100f;
            int[] TableAdditionalProductwidth = { 30, 70 };
            pdfpTableAdditionalProduct.SetWidths(TableAdditionalProductwidth);

            phrase = new Phrase(" " + Environment.NewLine);
            phrase.Add(new Chunk("Business Products", FontTypeBold));
            phrase.Add(Environment.NewLine + " ");
            PdfPCell cellAdditionalProduct = new PdfPCell(phrase);
            cellAdditionalProduct.Colspan = 3;

            //Used to checked Last Five product is selected
            bool isLastFiveProductSelected = false;
            if (get.Contains("f"))
            {
                // pdfDoc.NewPage();
                pdfpTableAdditionalProduct.AddCell(cellAdditionalProduct);
                isLastFiveProductSelected = true;

                PdfPCell Cell1 = new PdfPCell(new Phrase(Environment.NewLine + Environment.NewLine + "EFTPOS and merchant facilities", FontTypeBold));
                pdfpTableAdditionalProduct.AddCell(Cell1);
                phrase = new Phrase();
                phrase.Add(new Chunk("Customers being able to pay with a debit card?", FontTypeBold));
                phrase.Add(new Chunk("      and/or", FontType));
                phrase.Add(new Chunk(Environment.NewLine + "Customers being able to pay with a credit card?", FontTypeBold));

                list = new iTextSharp.text.List(false, 8);
                list.ListSymbol = bullet;
                ////////list.Add(new iTextSharp.text.ListItem(new Chunk("With this account, all day-to-day electronic transactions are fee-free",FontType)));
                list.Add(new iTextSharp.text.ListItem(new Chunk("To accept debit and credit cards from customers, whether it’s in person, over the phone or online, St.George has a range of EFTPOS and merchant solutions", FontType)));
                list.Add(new iTextSharp.text.ListItem(new Chunk("Get same-day settlement (when the terminal is settled before 9pm Sydney time) on debit and credit card sales, 7 days a week, when linked to a St.George business transaction account", FontType)));

                PdfPCell objCell = new PdfPCell();
                objCell.AddElement(phrase);
                objCell.AddElement(list);
                objCell.AddElement(new Phrase(" "));

                objCell.Colspan = 2;
                pdfpTableAdditionalProduct.AddCell(objCell);

            }
            if (get.Contains("g"))
            {
                if (!isLastFiveProductSelected)
                {
                    //pdfDoc.NewPage();
                    pdfpTableAdditionalProduct.AddCell(cellAdditionalProduct);
                    isLastFiveProductSelected = true;
                }
                PdfPCell Cell1 = new PdfPCell(new Phrase(Environment.NewLine + Environment.NewLine + "Equipment finance", FontTypeBold));
                pdfpTableAdditionalProduct.AddCell(Cell1);
                phrase = new Phrase();
                phrase.Add(new Chunk("Purchasing a vehicle?", FontTypeBold));
                phrase.Add(new Chunk("      and/or", FontType));
                phrase.Add(new Chunk(Environment.NewLine + "Purchasing equipment or machinery?", FontTypeBold));

                list = new iTextSharp.text.List(false, 8);
                list.ListSymbol = bullet;
                ////////list.Add(new iTextSharp.text.ListItem(new Chunk("With this account, all day-to-day electronic transactions are fee-free",FontType)));
                list.Add(new iTextSharp.text.ListItem(new Chunk("Finance up to 100% of the purchase price for vehicles or equipment", FontType)));
                list.Add(new iTextSharp.text.ListItem(new Chunk("Frees up money to run a business, rather than tying up working capital", FontType)));
开发者ID:hafizor,项目名称:stgeorge,代码行数:66,代码来源:PDFGenerate1.aspx.cs


示例16: CloneShallow

        // methods

        public override Paragraph CloneShallow(bool spacingBefore) {
            ListItem copy = new ListItem();
            PopulateProperties(copy, spacingBefore);
            return copy;
        }
开发者ID:joshaxey,项目名称:Simple-PDFMerge,代码行数:7,代码来源:ListItem.cs


示例17: PopulateList

 /**
  * Fills a java.util.List with all elements found in currentContent. Places elements that are not a {@link ListItem} or {@link com.itextpdf.text.List} in a new ListItem object.
  *
  * @param currentContent
  * @return java.util.List with only {@link ListItem}s or {@link com.itextpdf.text.List}s in it.
  */
 private IList<IElement> PopulateList(IList<IElement> currentContent)
 {
     IList<IElement> listElements = new List<IElement>();
     foreach (IElement e in currentContent) {
         if (e is ListItem || e is List) {
             listElements.Add(e);
         } else {
             ListItem listItem = new ListItem();
             listItem.Add(e);
             listElements.Add(listItem);
         }
     }
     return listElements;
 }
开发者ID:boecko,项目名称:iTextSharp,代码行数:20,代码来源:OrderedUnorderedList.cs


示例18: RtfList

        /**
        * Constructs a new RtfList for the specified List.
        *
        * @param doc The RtfDocument this RtfList belongs to
        * @param list The List this RtfList is based on
        * @since 2.1.3
        */
        public RtfList(RtfDocument doc, List list)
            : base(doc)
        {
            // setup the listlevels
            // Then, setup the list data below

            // setup 1 listlevel if it's a simple list
            // setup 9 if it's a regular list
            // setup 9 if it's a hybrid list (default)
            CreateDefaultLevels();

            this.items = new ArrayList();       // list content
            RtfListLevel ll = (RtfListLevel)this.listLevels[0];

            // get the list number or create a new one adding it to the table
            this.listNumber = document.GetDocumentHeader().GetListNumber(this);

            if (list.SymbolIndent > 0 && list.IndentationLeft > 0) {
                ll.SetFirstIndent((int) (list.SymbolIndent * RtfElement.TWIPS_FACTOR * -1));
                ll.SetLeftIndent((int) ((list.IndentationLeft + list.SymbolIndent) * RtfElement.TWIPS_FACTOR));
            } else if (list.SymbolIndent > 0) {
                ll.SetFirstIndent((int) (list.SymbolIndent * RtfElement.TWIPS_FACTOR * -1));
                ll.SetLeftIndent((int) (list.SymbolIndent * RtfElement.TWIPS_FACTOR));
            } else if (list.IndentationLeft > 0) {
                ll.SetFirstIndent(0);
                ll.SetLeftIndent((int) (list.IndentationLeft * RtfElement.TWIPS_FACTOR));
            } else {
                ll.SetFirstIndent(0);
                ll.SetLeftIndent(0);
            }
            ll.SetRightIndent((int) (list.IndentationRight * RtfElement.TWIPS_FACTOR));
            ll.SetSymbolIndent((int) ((list.SymbolIndent + list.IndentationLeft) * RtfElement.TWIPS_FACTOR));
            ll.CorrectIndentation();
            ll.SetTentative(false);

            if (list is RomanList) {
                if (list.Lowercase) {
                    ll.SetListType(RtfListLevel.LIST_TYPE_LOWER_ROMAN);
                } else {
                    ll.SetListType(RtfListLevel.LIST_TYPE_UPPER_ROMAN);
                }
            } else if (list.Numbered) {
                ll.SetListType(RtfListLevel.LIST_TYPE_NUMBERED);
            } else if (list.Lettered) {
                if (list.Lowercase) {
                    ll.SetListType(RtfListLevel.LIST_TYPE_LOWER_LETTERS);
                } else {
                    ll.SetListType(RtfListLevel.LIST_TYPE_UPPER_LETTERS);
                }
            }
            else {
            //          Paragraph p = new Paragraph();
            //          p.Add(new Chunk(list.GetPreSymbol()) );
            //          p.Add(list.GetSymbol());
            //          p.Add(new Chunk(list.GetPostSymbol()) );
            //          ll.SetBulletChunk(list.GetSymbol());
                ll.SetBulletCharacter(list.PreSymbol + list.Symbol.Content + list.PostSymbol);
                ll.SetListType(RtfListLevel.LIST_TYPE_BULLET);
            }

            // now setup the actual list contents.
            for (int i = 0; i < list.Items.Count; i++) {
                try {
                    IElement element = (IElement) list.Items[i];

                    if (element.Type == Element.CHUNK) {
                        element = new ListItem((Chunk) element);
                    }
                    if (element is ListItem) {
                        ll.SetAlignment(((ListItem) element).Alignment);
                    }
                    IRtfBasicElement[] rtfElements = doc.GetMapper().MapElement(element);
                    for (int j = 0; j < rtfElements.Length; j++) {
                        IRtfBasicElement rtfElement = rtfElements[j];
                        if (rtfElement is RtfList) {
                            ((RtfList) rtfElement).SetParentList(this);
                        } else if (rtfElement is RtfListItem) {
                            ((RtfListItem) rtfElement).SetParent(ll);
                        }
                        ll.SetFontNumber( new RtfFont(document, new Font(Font.TIMES_ROMAN, 10, Font.NORMAL, new Color(0, 0, 0))) );
                        if (list.Symbol != null && list.Symbol.Font != null && !list.Symbol.Content.StartsWith("-") && list.Symbol.Content.Length > 0) {
                            // only set this to bullet symbol is not default
                            ll.SetBulletFont( list.Symbol.Font);
                            ll.SetBulletCharacter(list.Symbol.Content.Substring(0, 1));
                        } else
                        if (list.Symbol != null && list.Symbol.Font != null) {
                            ll.SetBulletFont(list.Symbol.Font);

                        } else {
                            ll.SetBulletFont(new Font(Font.SYMBOL, 10, Font.NORMAL, new Color(0, 0, 0)));
                        }
                        items.Add(rtfElement);
                    }
//.........这里部分代码省略.........
开发者ID:bmictech,项目名称:iTextSharp,代码行数:101,代码来源:RtfList.cs



注:本文中的iTextSharp.text.ListItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# text.Paragraph类代码示例发布时间:2022-05-26
下一篇:
C# text.List类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap