當前位置: 首頁>>代碼示例>>C#>>正文


C# PdfContentByte.EndText方法代碼示例

本文整理匯總了C#中iTextSharp.text.pdf.PdfContentByte.EndText方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfContentByte.EndText方法的具體用法?C# PdfContentByte.EndText怎麽用?C# PdfContentByte.EndText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在iTextSharp.text.pdf.PdfContentByte的用法示例。


在下文中一共展示了PdfContentByte.EndText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Draw

// ---------------------------------------------------------------------------    
    /**
     * Draws a character representing an arrow at the current position.
     * @see com.itextpdf.text.pdf.draw.VerticalPositionMark#draw(
     *      com.itextpdf.text.pdf.PdfContentByte, float, float, float, float, float)
     */
    // i'm so stupid; originally forgot to override parent method and wondered
    // why the arrows weren't being drawn...
    public override void Draw(
      PdfContentByte canvas, float llx, float lly, float urx, float ury, float y
    ) {
      canvas.BeginText();
      canvas.SetFontAndSize(zapfdingbats, 12);
      if (left) {
        canvas.ShowTextAligned(Element.ALIGN_CENTER,
          ((char) 220).ToString(), llx - 10, y, 0
        );
      }
      else {
        canvas.ShowTextAligned(Element.ALIGN_CENTER,
          ((char) 220).ToString(), urx + 10, y + 8, 180
        );
      }
      canvas.EndText();
    }
開發者ID:,項目名稱:,代碼行數:25,代碼來源:

示例2: AddWaterMarkText

        private static void AddWaterMarkText(PdfContentByte directContent, string textWatermark, BaseFont font, float fontSize, float angle, BaseColor color, Rectangle realPageSize)
        {
            var gstate = new PdfGState { FillOpacity = 0.2f, StrokeOpacity = 0.2f };

            directContent.SaveState();
            directContent.SetGState(gstate);
            directContent.SetColorFill(color);
            directContent.BeginText();
            directContent.SetFontAndSize(font, fontSize);

            var x = (realPageSize.Right + realPageSize.Left) / 2;
            var y = (realPageSize.Bottom + realPageSize.Top) / 2;

            directContent.ShowTextAligned(Element.ALIGN_CENTER, textWatermark, x, y, angle);
            directContent.EndText();
            directContent.RestoreState();
        }
開發者ID:fabiohvp,項目名稱:DocumentSigner,代碼行數:17,代碼來源:PdfHelper.cs

示例3: DrawInfo

// ---------------------------------------------------------------------------           
    /**
     * Draws some text on every calendar sheet.
     * 
     */
    protected void DrawInfo(PdfContentByte directcontent) {
      directcontent.BeginText();
      directcontent.SetFontAndSize(bf, 18);
      float x, y;
      x = (OFFSET_LEFT + WIDTH + OFFSET_LOCATION) / 2;
      y = OFFSET_BOTTOM + HEIGHT + 24;
      directcontent.ShowTextAligned(
        Element.ALIGN_CENTER,
        "FOOBAR FILM FESTIVAL", x, y, 0
      );
      x = OFFSET_LOCATION + WIDTH_LOCATION / 2f - 6;
      y = OFFSET_BOTTOM + HEIGHT_LOCATION;
      directcontent.ShowTextAligned(
        Element.ALIGN_CENTER,
        "The Majestic", x, y, 90
      );
      y = OFFSET_BOTTOM + HEIGHT_LOCATION * 4f;
      directcontent.ShowTextAligned(
        Element.ALIGN_CENTER,
        "Googolplex", x, y, 90
      );
      y = OFFSET_BOTTOM + HEIGHT_LOCATION * 7.5f;
      directcontent.ShowTextAligned(
        Element.ALIGN_CENTER,
        "Cinema Paradiso", x, y, 90
      );
      directcontent.SetFontAndSize(bf, 12);
      x = OFFSET_LOCATION + WIDTH_LOCATION - 6;
      for (int i = 0; i < LOCATIONS; i++) {
        y = OFFSET_BOTTOM + ((8.5f - i) * HEIGHT_LOCATION);
        directcontent.ShowTextAligned(
          Element.ALIGN_CENTER,
          locations[i], x, y, 90
        );
      }
      directcontent.SetFontAndSize(bf, 6);
      y = OFFSET_BOTTOM + HEIGHT + 1;
      for (int i = 0; i < TIMESLOTS; i++) {
        x = OFFSET_LEFT + (i * WIDTH_TIMESLOT);
        directcontent.ShowTextAligned(
          Element.ALIGN_LEFT,
          TIME[i], x, y, 45
        );
      }
      directcontent.EndText();
    }
開發者ID:,項目名稱:,代碼行數:51,代碼來源:

示例4: OnEndPage

        public override void OnEndPage(PdfWriter writer, Document document)
        {
            base.OnEndPage(writer, document);

            if (_isLastPage)
            {
                var relativeWidths = ColumnsHelper.GetRelativeColumnsForProducts(PageSize.A4);

                //RODAPE
                var pdfTableFooter = new BuilderTable().Create(relativeWidths).Standard();
                pdfTableFooter.AddCell(new BuilderCell("", 5).Create("DADOS ADICIONAIS").FixedHeight(15).Bold().HorizontalLeft().VerticalBottom().Colspan(42).NoBorder().BorderBuilder(false, false, false, false).Standard());

                pdfTableFooter.AddCell(new BuilderCell("", 5).Create("INFORMAÇÕES COMPLEMENTARES").FixedHeight(5).Bold().HorizontalLeft().VerticalTop().Colspan(32).NoBorder().BorderBuilder(true, true, false, true).Standard());
                pdfTableFooter.AddCell(new BuilderCell("", 5).Create("RESERVADO AO FISCO").Bold().HorizontalLeft().VerticalTop().Colspan(10).NoBorder().BorderBuilder(true, true, false, true).Standard());

                var infAdicional = _nfe.NFe.infNFe.infAdic;
                pdfTableFooter.AddCell(new BuilderCell("", 5).Create(infAdicional.infCpl).FixedHeight(25).HorizontalLeft().VerticalTop().Colspan(32).NoBorder().BorderBuilder(true, true, false, false).Standard());
                pdfTableFooter.AddCell(new BuilderCell("", 5).Create(" ").HorizontalLeft().VerticalTop().Colspan(10).NoBorder().BorderBuilder(true, true, false, false).Standard());

                if (_isHomolog)
                {
                    pdfTableFooter.AddCell(new BuilderCell("", 5).Create("SEM VALOR FISCAL").FixedHeight(5).HorizontalLeft().VerticalTop().Colspan(32).NoBorder().BorderBuilder(true, true, true, false).Standard());
                    pdfTableFooter.AddCell(new BuilderCell("", 5).Create(" ").HorizontalLeft().VerticalTop().Colspan(10).NoBorder().BorderBuilder(true, true, true, false).Standard());
                }

                document.Add(pdfTableFooter);
            }

            const float posX = 325f;
            const float posY = 662f;

            var pageN = writer.PageNumber;
            var text = "Folha " + pageN + "/";
            var len = _baseFont.GetWidthPoint(text, 8);

            _pdfContent = writer.DirectContent;
            _pdfContent.SetRGBColorFill(100, 100, 100);
            _pdfContent.BeginText();
            _pdfContent.SetFontAndSize(_baseFont, 8f);
            _pdfContent.SetTextMatrix(posX, posY);
            _pdfContent.ShowText(text);
            _pdfContent.EndText();
            _pdfContent.AddTemplate(_pageNumberTemplate, posX + len, posY);
            _pdfContent.BeginText();
            _pdfContent.SetFontAndSize(_baseFont, 8f);
            _pdfContent.EndText();
        }
開發者ID:spltechnology,項目名稱:spldanfe,代碼行數:47,代碼來源:DanfeHeader.cs

示例5: PdfText

        private static void PdfText(PdfContentByte cb, TextAlignedPdfConfig parms)
        {
            var bf = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
            cb.SetColorFill(BaseColor.BLACK);
            cb.SetFontAndSize(bf, 18);

            cb.BeginText();
            cb.ShowTextAligned(parms.Alignment, parms.Text, parms.X, parms.Y, parms.Rotation);
            cb.EndText();
        }
開發者ID:watcharayarnu,項目名稱:MvcPdfReport,代碼行數:10,代碼來源:DrawPdfPage.cs

示例6: FooterPdfInitialize

        private static void FooterPdfInitialize(PdfWriter writer, Document document, PdfTemplate template, PdfContentByte contentByte, BaseFont baseFont, DateTime PrintTime)
        {
            int pageNumber = writer.PageNumber;
            string footerText = string.Format("Strona {0}{1}", pageNumber, " z ");
            float lenght = baseFont.GetWidthPoint(footerText, textSize);
            Rectangle pageSize = document.PageSize;

            contentByte.SetRGBColorFill(100, 100, 100);
            contentByte.BeginText();
            contentByte.SetFontAndSize(baseFont, textSize);
            contentByte.SetTextMatrix(pageSize.GetLeft(left), pageSize.GetBottom(bottom));
            contentByte.ShowText(footerText);
            contentByte.EndText();
            contentByte.AddTemplate(template, pageSize.GetLeft(left) + lenght, pageSize.GetBottom(bottom));

            contentByte.BeginText();
            contentByte.SetFontAndSize(baseFont, textSize);
            contentByte.ShowTextAligned(PdfContentByte.ALIGN_RIGHT, string.Format("Utworzony: {0}", PrintTime.ToString()), pageSize.GetRight(right), pageSize.GetBottom(bottom), 0);
            contentByte.EndText();
        }
開發者ID:Khaleesy,項目名稱:Csharp,代碼行數:20,代碼來源:PdfFooter.cs

示例7: OnEndPage

        public override void OnEndPage(PdfWriter writer, Document document)
        {
            base.OnEndPage(writer, document);

            int pageN = writer.PageNumber;

            string text = "From SG Telecom        SIGN..........................   Exe. Name  "+ BusinessAccessLeyer.BAL.StaticVariables.selectuser+"     Given To........................... ";
               // string text = pageN + " - ";
            float len = baseFont.GetWidthPoint(text, 8);

            Rectangle pageSize = document.PageSize;
            pdfContent = writer.DirectContent;
            pdfContent.SetRGBColorFill(100, 100, 100);

            pdfContent.BeginText();
            pdfContent.SetFontAndSize(baseFont, 12);
               // pdfContent.ShowTextAligned(PdfContentByte.ALIGN_LEFT, text, pageSize.GetRight(40), pageSize.GetBottom(30), 0);
            pdfContent.ShowTextAligned(PdfContentByte.ALIGN_LEFT, text, pageSize.GetLeft(40) , pageSize.GetBottom(30), 0);
            pdfContent.EndText();

            BusinessAccessLeyer.BAL.StaticVariables.selectuser = "";

              //  string path = @"D:\Dropboxdata\Dropbox\mayankmvc\Web_Complete_Inv\PresantationAccessLeyer\Images\Address Img.jpg";

              ////  iTextSharp.text.Image instanceImg = iTextSharp.text.Image.GetInstance(path);

              //  //Image logo = Image.GetInstance(path);
              //  // logo.ScaleAbsolute(500, 300);

              //   string imageURL =   path ;  // Server.MapPath(".") + "/image2.jpg";
              //   iTextSharp.text.Image jpg = iTextSharp.text.Image.GetInstance(imageURL);
              //   //Resize image depend upon your need
              //   jpg.ScaleToFit(240f, 120f);
              //   //Give space before image
              //   jpg.SpacingBefore = 10f;
              //   //Give some space after the image
              //   jpg.SpacingAfter = 1f;
              //   //jpg.Alignment = Element.ALIGN_LEFT;
              //   jpg.Alignment =  Element.ALIGN_CENTER;
              //   document.Add(jpg);

            ////////////////////////////////////
        }
開發者ID:spsinghdocument,項目名稱:MVC3SG,代碼行數:43,代碼來源:PrintHeaderFooter.cs

示例8: DrawBoxForCover

        /// <summary>
        /// Draws the box on the cover page that contains the date
        /// </summary>
        /// <param name="cb"></param>
        /// <param name="doc"></param>
        /// <param name="project"></param>
        private void DrawBoxForCover(PdfContentByte cb, Document doc)
        {
            // set the colors
            cb.SetColorStroke(_baseColor);
            cb.SetColorFill(_baseColor);

            // calculate the top left corner of the box
            var x = doc.LeftMargin;
            var y = doc.BottomMargin + 678;

            var height = 60;

            // move the cursor to starting position
            cb.MoveTo(x, y);

            // draw the top line
            cb.LineTo(x + _pageWidth, y);

            // draw the right line
            cb.LineTo(x + _pageWidth, y - height);

            // draw the bottom line
            cb.LineTo(x, y - height);

            // draw the left line
            cb.LineTo(x, y);

            cb.ClosePathFillStroke();
            cb.Stroke();

            // add the text inside the box
            cb.BeginText();
            cb.SetFontAndSize(_dateBaseFont, 26f);
            cb.SetColorStroke(BaseColor.WHITE);
            cb.SetColorFill(BaseColor.WHITE);
            cb.SetTextMatrix(x + 10, y - 40);
            cb.ShowText(string.Format("{0:MMMM dd, yyyy}", DateTime.Now));
            cb.EndText();
        }
開發者ID:ucdavis,項目名稱:Dogbert,代碼行數:45,代碼來源:PdfService.cs

示例9: AddItemData

        private static void AddItemData(Factuur factuur, Document document,
										int lastwriteposition, PdfContentByte content, ref int topMargin)
        {
            // Loop thru the rows in the rows table
            // Start by writing out the line headers
            // Line headers
            const int aantalMargin = 360, ehprijsMargin = 450, totaalMargin = 540;

            WriteText(content, "Omschrijving", 40, topMargin, 12, true);
            WriteText(content, "Aantal", aantalMargin, topMargin, 12, true, PdfContentByte.ALIGN_RIGHT);
            WriteText(content, "Prijs/EH", ehprijsMargin, topMargin, 12, true, PdfContentByte.ALIGN_RIGHT);
            WriteText(content, "Bedrag", totaalMargin, topMargin, 12, true, PdfContentByte.ALIGN_RIGHT);

            topMargin -= 20;
            foreach (var item in factuur.Items)
            {
                var opmerkingBottom = topMargin;
                foreach (var s in item.Omschrijving.Split(new[] { Environment.NewLine }, StringSplitOptions.None))
                {
                    WriteText(content, s, 40, opmerkingBottom, 10);
                    opmerkingBottom -= 16;
                }

                WriteText(content, item.Aantal.ToString(), aantalMargin, topMargin, 10, false, PdfContentByte.ALIGN_RIGHT);
                WriteText(content, string.Format("{0:C}", Math.Round(item.EenheidsPrijs, 2)), ehprijsMargin, topMargin, 10, false,
                          PdfContentByte.ALIGN_RIGHT);
                WriteText(content, string.Format("{0:C}", item.TotaalPrijs), totaalMargin, topMargin, 10, false,
                          PdfContentByte.ALIGN_RIGHT);

                // This is the line spacing, if you change the font size, you might want to change this as well.
                topMargin = opmerkingBottom;

                // Implement a page break function, checking if the write position has reached the lastwriteposition
                if (topMargin > lastwriteposition) continue;
                // We need to end the writing before we change the page
                content.EndText();
                // Make the page break
                document.NewPage();
                // Start the writing again
                content.BeginText();
                topMargin = 780;
                WriteText(content, "Omschrijving", 40, topMargin, 12, true);
                WriteText(content, "Aantal", aantalMargin, topMargin, 12, true, PdfContentByte.ALIGN_RIGHT);
                WriteText(content, "Prijs/EH", ehprijsMargin, topMargin, 12, true, PdfContentByte.ALIGN_RIGHT);
                WriteText(content, "Bedrag", totaalMargin, topMargin, 12, true, PdfContentByte.ALIGN_RIGHT);
                // Assign the new write location on page two!
                // Here you might want to implement a new header function for the new page
                topMargin -= 20;
            }
        }
開發者ID:desmetjens,項目名稱:DuraFact,代碼行數:50,代碼來源:PDFGenerator.cs

示例10: RenderTextElement

 private void RenderTextElement(TextElement el, PdfContentByte dc)
 {
     var color = new BaseColor(el.FontColor);
     var font = el.FontBold ? fontBold : this.font;
     dc.SetColorFill(color);
     dc.SetFontAndSize(font, el.FontSize);
     dc.BeginText();
     dc.ShowTextAligned(PdfContentByte.ALIGN_LEFT, el.Text, TranslateLeft(el), TranslateTop(el), 0);
     dc.EndText();
     //var ct = new ColumnText(dc);
     //var p = new Phrase(new Chunk(el.Text, new iTextSharp.text.Font(font, el.FontSize)));
     //ct.SetSimpleColumn(p,
     //    TranslateLeft(el),
     //    TranslateTop(el) - el.Height,
     //    TranslateLeft(el) + el.Width,
     //    TranslateTop(el),
     //    0,
     //    iTextSharp.text.Element.ALIGN_LEFT | iTextSharp.text.Element.ALIGN_TOP);
     //ct.Go();
 }
開發者ID:koraytaylan,項目名稱:ReportSharp,代碼行數:20,代碼來源:PdfRenderer.cs

示例11: RenderCanvasSheet

        public void RenderCanvasSheet(Stream stream, IEnumerable<CanvasItemModel> items, UserModel currentUser,UserModel requestedBy, PurchaseRequest Pr, string[] Vendors)
        {
            Document document = new Document(PageSize.LETTER);

            try {
                PdfWriter writer = PdfWriter.GetInstance(document, stream);
                document.Open();

                // Create a page in the document and add it to the bottom layer
                document.NewPage();
                //Pass Document to this
                CurrentDoc = document;

                page = writer.DirectContentUnder;
                page.BeginText();
                int top = (int)document.GetTop(0);
                SetFontSizeTo(16);
                PrintText("CANVASS SHEET", 20, 10);
                SetFontSizeTo(10);

                //Header
                PrintText("Company Name: " + requestedBy.CompanyName, 20, 30); // Company Name
                PrintText("Department: " + requestedBy.DepartmentName, 20, 45); // Company Address
                PrintText("Purpose: " + Pr.Purpose, 20, 60); // Purpose
                PrintTextRight("Date: {0}".WithTokens(DateTime.Now.ToShortDateString()), 70, 30); // Date Created
                PrintTextRight("PR No: {0}".WithTokens(Pr.PRNo), 70, 45); // PR Number

                SetFontSizeTo(8);

                // START HERE ----------------------------
                Paragraph Grid = new Paragraph("\n");
                Grid.Alignment = 1;
                Grid.SpacingAfter = 10f;
                document.Add(Grid);

                Paragraph Grid2 = new Paragraph();
                Grid2.Alignment = 1;
                Grid2.SpacingBefore = 35f;
                //Start Table -----------------------------------
                PdfPTable rightTable = new PdfPTable(7);
                int[] widths = { 1, 7, 2, 2, 2, 2, 2 };
                rightTable.SetWidths(widths);
                rightTable.TotalWidth = 570f;
                rightTable.LockedWidth = true;
                Font tableFont = new Font(Font.FontFamily.HELVETICA, 8);

                PdfPCell rightAlignedCell = new PdfPCell();
                rightAlignedCell.HorizontalAlignment = Element.ALIGN_CENTER;

                //Headers
                rightAlignedCell.Phrase = new Phrase("Item No.", tableFont); rightTable.AddCell(rightAlignedCell);
                rightAlignedCell.Phrase = new Phrase("Item Description", tableFont); rightTable.AddCell(rightAlignedCell);
                rightAlignedCell.Phrase = new Phrase("Quantity", tableFont); rightTable.AddCell(rightAlignedCell);
                rightAlignedCell.Phrase = new Phrase("UOM", tableFont); rightTable.AddCell(rightAlignedCell);
                rightAlignedCell.Phrase = new Phrase(Vendors[0], tableFont); rightTable.AddCell(rightAlignedCell);
                rightAlignedCell.Phrase = new Phrase(Vendors[1], tableFont); rightTable.AddCell(rightAlignedCell);
                rightAlignedCell.Phrase = new Phrase(Vendors[2], tableFont); rightTable.AddCell(rightAlignedCell);

                rightAlignedCell.HorizontalAlignment = Element.ALIGN_RIGHT;

                foreach (var item in items) {
                    string priceVendor1 = item.PriceVendor1 == 0 ? "NONE" : item.PriceVendor1.ToString();
                    string priceVendor2 = item.PriceVendor2 == 0 ? "NONE" : item.PriceVendor2.ToString();
                    string priceVendor3 = item.PriceVendor3 == 0 ? "NONE" : item.PriceVendor3.ToString();
                    rightTable.AddCell(new Phrase(item.ItemNumber.ToString(), tableFont));
                    rightTable.AddCell(new Phrase(item.ItemDescription, tableFont));
                    rightAlignedCell.Phrase = new Phrase(item.Quantity.ToString(), tableFont); rightTable.AddCell(rightAlignedCell);
                    rightTable.AddCell(new Phrase(item.UOM, tableFont));
                    rightAlignedCell.Phrase = new Phrase(priceVendor1, tableFont); rightTable.AddCell(rightAlignedCell);
                    rightAlignedCell.Phrase = new Phrase(priceVendor2, tableFont); rightTable.AddCell(rightAlignedCell);
                    rightAlignedCell.Phrase = new Phrase(priceVendor3, tableFont); rightTable.AddCell(rightAlignedCell);
                }
                Grid2.Add(rightTable);
                document.Add(Grid2);

                // Footer
                SetFontSizeTo(10);
                PrintTextBottom("Requested By:", 20, 105);
                PrintTextBottom("{0} {1}".WithTokens(requestedBy.FirstName, requestedBy.LastName), 20, 35);

                PrintTextBottom("Prepared By:", 265, 105);
                PrintTextBottom("{0} {1}".WithTokens(currentUser.FirstName, currentUser.LastName), 265, 35);

                PrintTextBottom("Approved By:", 450, 105);
                PrintTextBottom("{0}".WithTokens("______________________"), 450, 35);

                page.EndText();

                writer.Flush();
            }
            finally {
                document.Close();
            }
        }
開發者ID:haroldocampo,項目名稱:PRSSSI,代碼行數:94,代碼來源:PdfManager.cs

示例12: CreateLayerInLegend

  private bool CreateLayerInLegend(PdfContentByte content, Configuration.MapTabRow mapTab, List<CommonLayer> layerList, LegendProperties properties, CommonLayer layer, float indent)
  {
    if (!layerList.Contains(layer))
    {
      return false;
    }

    float layerHeight = GetLayerHeightInLegend(layerList, properties, layer);

    if (properties.CurrentY < properties.Height && properties.CurrentY - layerHeight < 0)
    {
      if (properties.CurrentColumn == properties.NumColumns)
      {
        return true;
      }

      properties.CurrentX += properties.ColumnWidth + properties.ColumnSpacing;
      properties.CurrentY = properties.Height;
      properties.CurrentColumn += 1;
    }

    int numClasses = GetNumClasses(layer);

    Configuration.LayerRow configLayer = mapTab.GetMapTabLayerRows().Where(o => String.Compare(o.LayerRow.LayerName, layer.Name, true) == 0).Select(o => o.LayerRow).FirstOrDefault();
    string layerName = configLayer != null && !configLayer.IsDisplayNameNull() ? configLayer.DisplayName : layer.Name;

    // write the layer name

    if (layer.Type == CommonLayerType.Group || numClasses > 1)
    {
      properties.CurrentY -= properties.FontSize;
      string name = layerName;

      try
      {
        while (content.GetEffectiveStringWidth(name, false) > properties.ColumnWidth - indent)
        {
          name = name.Substring(0, name.Length - 1);
        }
      }
      catch { }

      content.BeginText();
      content.SetFontAndSize(properties.BaseFont, properties.FontSize);
      content.SetRGBColorFill(0, 0, 0);
      content.ShowTextAligned(PdfContentByte.ALIGN_LEFT, name, properties.OriginX + properties.CurrentX + indent, properties.OriginY + properties.CurrentY + (properties.SwatchHeight - properties.FontSize) / 2, 0);
      content.EndText();
    }

    if (layer.Type == CommonLayerType.Group)
    {
      properties.CurrentY -= properties.LayerSpacing;

      foreach (CommonLayer childLayer in layer.Children)
      {
        CreateLayerInLegend(content, mapTab, layerList, properties, childLayer, indent + 1.5f * properties.FontSize);
      }
    }
    else
    {
      properties.CurrentY -= properties.ClassSpacing;

      foreach (CommonLegendGroup legendGroup in layer.Legend.Groups)
      {
        foreach (CommonLegendClass legendClass in legendGroup.Classes)
        {
          if (!legendClass.ImageIsTransparent)
          {
            properties.CurrentY -= properties.SwatchHeight;

            MemoryStream stream = new MemoryStream(legendClass.Image);
            System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(stream);
            float w = properties.SwatchHeight * bitmap.Width / bitmap.Height;

            iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(legendClass.Image);
            image.SetAbsolutePosition(properties.OriginX + properties.CurrentX + indent, properties.OriginY + properties.CurrentY - properties.SwatchHeight * 0.1f);
            image.ScaleAbsolute(w, properties.SwatchHeight);
            content.AddImage(image);

            string label = numClasses > 1 ? legendClass.Label : layerName;

            try
            {
              while (content.GetEffectiveStringWidth(label, false) > properties.ColumnWidth - properties.SwatchWidth - properties.ClassSpacing)
              {
                label = label.Substring(0, label.Length - 1);
              }
            }
            catch { }

            content.BeginText();
            content.SetFontAndSize(properties.BaseFont, properties.FontSize);
            content.SetRGBColorFill(0, 0, 0);
            content.ShowTextAligned(PdfContentByte.ALIGN_LEFT, label, properties.OriginX + properties.CurrentX + indent + properties.SwatchWidth + properties.ClassSpacing, properties.OriginY + properties.CurrentY + (properties.SwatchHeight - properties.FontSize) / 2, 0);
            content.EndText();

            properties.CurrentY -= properties.ClassSpacing;
          }
        }
      }
//.........這裏部分代碼省略.........
開發者ID:ClaireBrill,項目名稱:GPV,代碼行數:101,代碼來源:PdfMap.cs

示例13: setCheckBoxes


//.........這裏部分代碼省略.........
         cb.ShowTextAligned (0, "x", 456, 478, 0);
     };
     if (chBoxes [5].Checked)
     {
         cb.ShowTextAligned (0, "x", 517, 478, 0);
     };
     if (chBoxes [6].Checked)
     {
         cb.ShowTextAligned (0, "x", 456, 464, 0);
     };
     if (chBoxes [7].Checked)
     {
         cb.ShowTextAligned (0, "x", 456, 450, 0);
     };
     if (chBoxes [8].Checked)
     {
         cb.ShowTextAligned (0, "x", 456, 435, 0);
     };
     if (chBoxes [9].Checked)
     {
         cb.ShowTextAligned (0, "x", 456, 421, 0);
     };
     if (chBoxes [10].Checked)
     {
         cb.ShowTextAligned (0, "x", 456, 406, 0);
     };
     if (chBoxes [11].Checked)
     {
         cb.ShowTextAligned (0, "x", 467, 392, 0);
     };
     if (chBoxes [12].Checked)
     {
         cb.ShowTextAligned (0, "x", 467, 377, 0);
     };
     if (chBoxes [13].Checked)
     {
         cb.ShowTextAligned (0, "x", 142, 363, 0);
     };
     if (chBoxes [14].Checked)
     {
         cb.ShowTextAligned (0, "x", 207, 363, 0);
     };
     if (chBoxes [15].Checked)
     {
         cb.ShowTextAligned (0, "x", 286, 363, 0);
     };
     if (chBoxes [16].Checked)
     {
         cb.ShowTextAligned (0, "x", 365, 363, 0);
     };
     if (chBoxes [17].Checked)
     {
         cb.ShowTextAligned (0, "x", 42, 267, 0);
     };
     if (chBoxes [18].Checked)
     {
         cb.ShowTextAligned (0, "x", 42, 253, 0);
     };
     if (chBoxes [19].Checked)
     {
         cb.ShowTextAligned (0, "x", 42, 239, 0);
     };
     if (chBoxes [20].Checked)
     {
         cb.ShowTextAligned (0, "x", 42, 224, 0);
     };
     if (chBoxes [21].Checked)
     {
         cb.ShowTextAligned (0, "x", 42, 209, 0);
     };
     if (chBoxes [22].Checked)
     {
         cb.ShowTextAligned (0, "x", 42, 196, 0);
     };
     if (chBoxes [23].Checked)
     {
         cb.ShowTextAligned (0, "x", 168, 267, 0);
     };
     if (chBoxes [24].Checked)
     {
         cb.ShowTextAligned (0, "x", 168, 253, 0);
     };
     if (chBoxes [25].Checked)
     {
         cb.ShowTextAligned (0, "x", 168, 239, 0);
     };
     if (chBoxes [26].Checked)
     {
         cb.ShowTextAligned (0, "x", 168, 223, 0);
     };
     if (chBoxes [27].Checked)
     {
         cb.ShowTextAligned (0, "x", 168, 209, 0);
     };
     if (chBoxes [28].Checked)
     {
         cb.ShowTextAligned (0, "x", 168, 196, 0);
     };
     cb.EndText();
 }
開發者ID:Apophes,項目名稱:Lieferschein,代碼行數:101,代碼來源:PDFManager.cs

示例14: setText

        static void setText(PdfContentByte cb,EditText[] edTxt)
        {
            cb.BeginText ();
            cb.ShowTextAligned (0,edTxt[0].Text, 42, 477, 0);
            cb.ShowTextAligned (0, edTxt[1].Text, 42, 463, 0);
            cb.ShowTextAligned (0, edTxt[2].Text, 42, 448, 0);
            cb.ShowTextAligned (0, edTxt[3].Text, 42, 434, 0);
            cb.ShowTextAligned (0, edTxt[4].Text, 42, 419, 0);
            cb.ShowTextAligned (0, edTxt[5].Text, 42, 405, 0);
            cb.ShowTextAligned (0, edTxt[6].Text, 42, 390, 0);
            cb.ShowTextAligned (0, edTxt[7].Text, 42, 376, 0);
            cb.ShowTextAligned (0, edTxt[8].Text, 42, 323, 0);
            cb.ShowTextAligned (0, edTxt[9].Text, 42, 309, 0);
            cb.ShowTextAligned (0, edTxt[10].Text, 42, 295, 0);
            cb.ShowTextAligned (0, edTxt[11].Text, 115, 323, 0);
            cb.ShowTextAligned (0, edTxt[12].Text, 115, 309, 0);
            cb.ShowTextAligned (0, edTxt[13].Text, 115, 295, 0);
            cb.ShowTextAligned (0, edTxt[14].Text, 217, 323, 0);
            cb.ShowTextAligned (0, edTxt[15].Text, 217, 309, 0);
            cb.ShowTextAligned (0, edTxt[16].Text, 217, 295, 0);
            cb.ShowTextAligned (0, edTxt[17].Text, 242, 323, 0);
            cb.ShowTextAligned (0, edTxt[18].Text, 242, 309, 0);
            cb.ShowTextAligned (0, edTxt[19].Text, 242, 295, 0);
            cb.ShowTextAligned (0, edTxt[20].Text, 265, 323, 0);
            cb.ShowTextAligned (0, edTxt[21].Text, 265, 309, 0);
            cb.ShowTextAligned (0, edTxt[22].Text, 265, 295, 0);
            cb.ShowTextAligned (0, edTxt[23].Text, 137, 267, 0);
            cb.ShowTextAligned (0, edTxt[24].Text, 137, 253, 0);
            cb.ShowTextAligned (0, edTxt[25].Text, 137, 238, 0);
            cb.ShowTextAligned (0, edTxt[26].Text, 137, 223, 0);
            cb.ShowTextAligned (0, edTxt[27].Text, 137, 209, 0);
            cb.ShowTextAligned (0, edTxt[28].Text, 137, 195, 0);
            cb.ShowTextAligned (0, edTxt[29].Text, 262, 267, 0);
            cb.ShowTextAligned (0, edTxt[30].Text, 262, 253, 0);
            cb.ShowTextAligned (0, edTxt[31].Text, 262, 238, 0);
            cb.ShowTextAligned (0, edTxt[32].Text, 262, 223, 0);
            cb.ShowTextAligned (0, edTxt[33].Text, 262, 209, 0);
            cb.ShowTextAligned (0, edTxt[34].Text, 262, 195, 0);
            cb.ShowTextAligned (0, edTxt[35].Text, 293, 323, 0);
            cb.ShowTextAligned (0, edTxt[36].Text, 293, 309, 0);
            cb.ShowTextAligned (0, edTxt[37].Text, 293, 295, 0);
            cb.ShowTextAligned (0, edTxt[38].Text, 293, 281, 0);
            cb.ShowTextAligned (0, edTxt[39].Text, 293, 267, 0);
            cb.ShowTextAligned (0, edTxt[40].Text, 293, 253, 0);
            cb.ShowTextAligned (0, edTxt[41].Text, 293, 238, 0);
            cb.ShowTextAligned (0, edTxt[42].Text, 293, 223, 0);
            cb.ShowTextAligned (0, edTxt[43].Text, 293, 209, 0);
            cb.ShowTextAligned (0, edTxt[44].Text, 293, 195, 0);
            cb.ShowTextAligned (0, edTxt[45].Text, 499, 323, 0);
            cb.ShowTextAligned (0, edTxt[46].Text, 499, 309, 0);
            cb.ShowTextAligned (0, edTxt[47].Text, 499, 295, 0);
            cb.ShowTextAligned (0, edTxt[48].Text, 499, 281, 0);
            cb.ShowTextAligned (0, edTxt[49].Text, 499, 267, 0);
            cb.ShowTextAligned (0, edTxt[50].Text, 499, 253, 0);
            cb.ShowTextAligned (0, edTxt[51].Text, 499, 238, 0);
            cb.ShowTextAligned (0, edTxt[52].Text, 499, 223, 0);
            cb.ShowTextAligned (0, edTxt[53].Text, 499, 209, 0);
            cb.ShowTextAligned (0, edTxt[54].Text, 499, 195, 0);
            cb.ShowTextAligned (0, edTxt[55].Text, 550, 323, 0);
            cb.ShowTextAligned (0, edTxt[56].Text, 550, 309, 0);
            cb.ShowTextAligned (0, edTxt[57].Text, 550, 295, 0);
            cb.ShowTextAligned (0, edTxt[58].Text, 550, 281, 0);
            cb.ShowTextAligned (0, edTxt[59].Text, 550, 267, 0);
            cb.ShowTextAligned (0, edTxt[60].Text, 550, 253, 0);
            cb.ShowTextAligned (0, edTxt[61].Text, 550, 238, 0);
            cb.ShowTextAligned (0, edTxt[62].Text, 550, 223, 0);
            cb.ShowTextAligned (0, edTxt[63].Text, 550, 209, 0);
            cb.ShowTextAligned (0, edTxt[64].Text, 550, 195, 0);

            cb.EndText ();
        }
開發者ID:Apophes,項目名稱:Lieferschein,代碼行數:71,代碼來源:PDFManager.cs

示例15: DrawDateInfo

// ---------------------------------------------------------------------------            
    /**
     * Draws some text on every calendar sheet.
     * 
     */
    protected void DrawDateInfo(string day, int d, PdfContentByte directcontent) {
      directcontent.BeginText();
      directcontent.SetFontAndSize(bf, 18);
      float x, y;
      x = OFFSET_LOCATION;
      y = OFFSET_BOTTOM + HEIGHT + 24;
      directcontent.ShowTextAligned(
        Element.ALIGN_LEFT,
        "Day " + d, x, y, 0
      );
      x = OFFSET_LEFT + WIDTH;
      directcontent.ShowTextAligned(
        Element.ALIGN_RIGHT,
        day, x, y, 0
      );
      directcontent.EndText();
    }
開發者ID:,項目名稱:,代碼行數:22,代碼來源:


注:本文中的iTextSharp.text.pdf.PdfContentByte.EndText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。