コード例 #1
0
 public static void Create(IElementListener document, int invoiceNumber, InvoiceEntity invoiceEntity, CompanyInformationEntity companyInformationEntity, DateTime now)
 {
     var table = new PdfPTable(2) { WidthPercentage = 100 };
     table.AddCell(GetCompanyNameAndSlogan(invoiceEntity, companyInformationEntity));
     table.AddCell(GetInvoiceTitle());
     table.AddCell(GetCompanyAddress(invoiceEntity, companyInformationEntity));
     table.AddCell(GetInvoiceDetails(invoiceNumber,now));
     document.Add(table);
 }
コード例 #2
0
 // implementation of the Element-methods
 /// <summary>
 /// Processes the element by adding it (or the different parts) to an
 /// IElementListener.
 /// </summary>
 /// <param name="listener">the IElementListener</param>
 /// <returns>true if the element was processed successfully</returns>
 public bool Process(IElementListener listener)
 {
     try {
         foreach (IElement ele in this) {
             listener.Add(ele);
         }
         return true;
     }
     catch (DocumentException de) {
         de.GetType();
         return false;
     }
 }
コード例 #3
0
        // implementation of the Element-methods

        /// <summary>
        /// Processes the element by adding it (or the different parts) to an
        /// <see cref="iTextSharp.text.IElementListener"/>.
        /// </summary>
        /// <param name="listener">an IElementListener</param>
        /// <returns>true if the element was processed successfully</returns>
        public virtual bool Process(IElementListener listener)
        {
            try {
                foreach (IElement ele in this)
                {
                    listener.Add(ele);
                }
                return(true);
            }
            catch (DocumentException) {
                return(false);
            }
        }
コード例 #4
0
 /**
  * Processes the element by adding it (or the different parts) to an
  * <CODE>ElementListener</CODE>.
  *
  * @param       listener        an <CODE>ElementListener</CODE>
  * @return <CODE>true</CODE> if the element was processed successfully
  */
 public override bool Process(IElementListener listener)
 {
     try {
         foreach (IElement element in ((Section)this.element))
         {
             listener.Add(element);
         }
         return(true);
     }
     catch (DocumentException) {
         return(false);
     }
 }
コード例 #5
0
ファイル: List.cs プロジェクト: aakkssqq/CreatePDFCSharp
        // implementation of the Element-methods

        /// <summary>
        /// Processes the element by adding it (or the different parts) to an
        /// IElementListener.
        /// </summary>
        /// <param name="listener">an IElementListener</param>
        /// <returns>true if the element was processed successfully</returns>
        public bool process(IElementListener listener)
        {
            try {
                foreach (IElement ele in list)
                {
                    listener.Add(ele);
                }
                return(true);
            }
            catch (DocumentException de) {
                de.GetType();
                return(false);
            }
        }
コード例 #6
0
        private void AddAllGeneralSum(TypeReport predicate, IElementListener doc)
        {
            if (predicate == TypeReport.All)
            {
                var sum = _materialAidEmployeesGeneralSum + _awardEmployeesGeneralSum + _culturalEmployeesGeneralSum +
                          _travelEventEmployeesGeneralSum + _wellnessEventEmployeesGeneralSum + _tourEventEmployeesGeneralSum +
                          _giftEmployeesGeneralSum;

                doc.Add(new Paragraph($"Cумма - {sum} {Сurrency}", Font)
                {
                    Alignment = Element.ALIGN_RIGHT
                });

                AddEmptyParagraph(doc, 2);
            }
        }
コード例 #7
0
    private static void GenerateContent(IElementListener document, PdfContentByte directContent, Invoice invoice)
    {
        AddIssuingCompany(directContent, invoice);
        AddInvoiceHeadingPart(directContent, invoice);

        document.Add(GetHeaderPart(invoice));
        document.Add(new Paragraph("\n"));
        document.Add(new Paragraph("\n"));
        document.Add(new Paragraph("\n"));
        document.Add(new Paragraph("\n"));

        document.Add(GetCompaniesPart(invoice));
        document.Add(new Paragraph("\n"));
        document.Add(GetInvoiceLinesPart(invoice));
        document.Add(new Paragraph("\n"));
        document.Add(GetFooterPart(invoice));
    }
コード例 #8
0
        private void CreateDocumentBody(IElementListener document, AnalysisFile analysisFile)
        {
            var table = new PdfPTable(2)
            {
                SpacingBefore = 25.0f
            };

            table.SetWidths(new[] { 1, 2 });

            AddRow(table, "File name", analysisFile.FileName);
            AddRow(table, "Performed by", analysisFile.UserId.ToString());
            AddRow(table, "Analysis status", Enum.GetName(analysisFile.Status));
            AddRow(table, "Status change date", analysisFile.Date.ToString(CultureInfo.InvariantCulture));
            if (analysisFile.Status == OperationStatus.Complete)
            {
                AddHighlightedResultRow(table, analysisFile.Result);
            }

            document.Add(table);
        }
コード例 #9
0
        private static void AddPersonalInfo(IElementListener document, EmployeeDetailsModel user)
        {
            var table = new PdfPTable(1)
            {
                WidthPercentage = 100
            };

            table.DefaultCell.Border = Rectangle.NO_BORDER;
            table.SpacingBefore      = 20;
            var headerCell = new PdfPCell {
                Border = Rectangle.NO_BORDER
            };
            var headerPhrase = new Phrase("Personal Info");

            headerCell.Phrase       = headerPhrase;
            headerPhrase.Font.Color = BaseColor.BLUE;
            table.AddCell(headerCell);
            table.AddCell(user.Description.Title);
            table.AddCell(user.Description.Text);
            document.Add(table);
        }
コード例 #10
0
        private static void AddExperience(IElementListener document, EmployeeDetailsModel user)
        {
            var table = new PdfPTable(2)
            {
                WidthPercentage = 100
            };

            table.SetWidths(new int[] { 1, 4 });
            table.DefaultCell.Border = Rectangle.NO_BORDER;
            table.SpacingBefore      = 20;
            var headerCell = new PdfPCell {
                Border = Rectangle.NO_BORDER, Colspan = 2
            };
            var headerPhrase = new Phrase("Experience");

            headerCell.Phrase       = headerPhrase;
            headerPhrase.Font.Color = BaseColor.BLUE;
            table.AddCell(headerCell);
            foreach (var experience in user.Experiences)
            {
                var endDate = experience.EndDate != null?experience.EndDate?.ToString("MMMM yyyy",
                                                                                      CultureInfo.CreateSpecificCulture("en-us"))
                                  : "Current time";

                var years = new Phrase(experience.BeginDate.ToString("MMMM yyyy",
                                                                     CultureInfo.CreateSpecificCulture("en-us")) + " -\n" + endDate);
                var yearsCell = new PdfPCell(years)
                {
                    Border = Rectangle.NO_BORDER, Rowspan = 2
                };
                table.AddCell(yearsCell);
                table.AddCell(experience.Position);
                table.AddCell(experience.Description);
            }
            document.Add(table);
        }
コード例 #11
0
        // these Element methods are irrelevant for a table stub.

        virtual public bool Process(IElementListener listener)
        {
            return(false);
        }
コード例 #12
0
 /// <summary>
 /// Create the slice header
 /// </summary>
 /// <param name="doc">
 /// The <see cref="Document"/>
 /// </param>
 /// <param name="state">
 /// The current <see cref="HtmlRenderer.RendererState"/>
 /// </param>
 private void CreateSliceHeader(IElementListener doc, RendererState state)
 {
     Table headerTable = this.CreateSliceHeaderTable(state);
     PdfPTable table = CreatePdf(headerTable);
     if (table != null)
     {
         doc.Add(table);
         table.DeleteBodyRows();
     }
 }
コード例 #13
0
ファイル: Section.cs プロジェクト: hjgode/iTextSharpCF
 // implementation of the Element-methods
 /// <summary>
 /// Processes the element by adding it (or the different parts) to an
 /// IElementListener.
 /// </summary>
 /// <param name="listener">the IElementListener</param>
 /// <returns>true if the element was processed successfully</returns>
 public bool Process(IElementListener listener)
 {
     try {
         foreach (IElement ele in this) {
             listener.Add(ele);
         }
         return true;
     }
     catch (DocumentException de) {
         de.GetType();
         return false;
     }
 }
コード例 #14
0
 /* (non-Javadoc)
  * @see com.itextpdf.text.Element#process(com.itextpdf.text.ElementListener)
  */
 public bool Process(IElementListener listener)
 {
     throw new iTextSharp.tool.xml.exceptions.NotImplementedException();
 }
コード例 #15
0
 public bool Process(IElementListener listener)
 {
     return(true);
 }
コード例 #16
0
ファイル: IncCell.cs プロジェクト: pixelia-es/RazorPDF2
 public bool Process(IElementListener listener)
 {
     return true;
 }
コード例 #17
0
 /*
  * (non-Javadoc)
  *
  * @see com.itextpdf.text.Element#process(com.itextpdf.text.ElementListener)
  */
 public bool Process(IElementListener listener)
 {
     throw new NotSupportedException();
 }
コード例 #18
0
 // these Element methods are irrelevant for a table stub.
 
 virtual public bool Process(IElementListener listener) {
     return false;
 }
コード例 #19
0
ファイル: Row.cs プロジェクト: hjgode/iTextSharpCF
 // implementation of the Element-methods
 /// <summary>
 /// Processes the element by adding it (or the different parts) to a
 /// IElementListener.
 /// </summary>
 /// <param name="listener">an IElementListener</param>
 /// <returns>true if the element was processed successfully</returns>
 public bool Process(IElementListener listener)
 {
     try {
         return listener.Add(this);
     }
     catch (DocumentException de) {
         de.GetType();
         return false;
     }
 }
コード例 #20
0
ファイル: Graphic.cs プロジェクト: mohsenmetn/itextsharp
 public bool Process(IElementListener listener)
 {
     // TODO Auto-generated method stub
     return(false);
 }
コード例 #21
0
ファイル: MarkedSection.cs プロジェクト: bmictech/iTextSharp
 /**
 * Processes the element by adding it (or the different parts) to an
 * <CODE>ElementListener</CODE>.
 *
 * @param       listener        an <CODE>ElementListener</CODE>
 * @return <CODE>true</CODE> if the element was processed successfully
 */
 public override bool Process(IElementListener listener)
 {
     try {
         foreach (IElement element in ((Section)this.element)) {
             listener.Add(element);
         }
         return true;
     }
     catch (DocumentException) {
         return false;
     }
 }
コード例 #22
0
 /* (non-Javadoc)
  * @see com.itextpdf.text.Element#process(com.itextpdf.text.ElementListener)
  */
 virtual public bool Process(IElementListener listener) {
     throw new iTextSharp.tool.xml.exceptions.NotImplementedException();
 }
コード例 #23
0
 public bool Process(IElementListener listener) => true;
コード例 #24
0
     // implementation of the Element-methods
 
     /// <summary>
     /// Processes the element by adding it (or the different parts) to an
     /// <see cref="T:iTextSharp.text.IElementListener"/>
     /// </summary>
     /// <param name="listener">an IElementListener</param>
     /// <returns>true if the element was processed successfully</returns>
     public override bool Process(IElementListener listener) 
     {
         try 
         {
             bool localDestination = (reference != null && reference.StartsWith("#"));
             bool notGotoOK = true;
             foreach (Chunk chunk in this.Chunks) 
             {
                 if (name != null && notGotoOK && !chunk.IsEmpty()) 
                 {
                     chunk.SetLocalDestination(name);
                     notGotoOK = false;
                 }
                 if (localDestination) 
                 {
                     chunk.SetLocalGoto(reference.Substring(1));
                 }
                 else if (reference != null)
                     chunk.SetAnchor(reference);
                 listener.Add(chunk);
             }
             return true;
         }
         catch (DocumentException) 
         {
             return false;
         }
     }
コード例 #25
0
ファイル: PdfBody.cs プロジェクト: abdullah-raja/DBProject
 public override bool Process(IElementListener listener)
 {
     return(false);
 }
コード例 #26
0
 /*
  * (non-Javadoc)
  *
  * @see com.itextpdf.text.Element#process(com.itextpdf.text.ElementListener)
  */
 public bool Process(IElementListener listener)
 {
     throw new NotSupportedException();
 }
コード例 #27
0
ファイル: PdfBody.cs プロジェクト: yu0410aries/itextsharp
 public override bool Process(IElementListener listener)
 {
     return false;
 }
コード例 #28
0
ファイル: List.cs プロジェクト: jomamorales/createPDF
 // implementation of the Element-methods
 /// <summary>
 /// Processes the element by adding it (or the different parts) to an
 /// IElementListener.
 /// </summary>
 /// <param name="listener">an IElementListener</param>
 /// <returns>true if the element was processed successfully</returns>
 public bool Process(IElementListener listener)
 {
     try {
         foreach (IElement ele in list) {
             listener.Add(ele);
         }
         return true;
     }
     catch (DocumentException) {
         return false;
     }
 }
コード例 #29
0
        private void AddNameReport(ReportModel model, IElementListener doc)
        {
            switch (model.Type)
            {
            case TypeReport.All:
                doc.Add(new Paragraph("Звіт по всім дотаційним заходам члена профспілки", FontBold)
                {
                    Alignment = Element.ALIGN_CENTER
                });
                break;

            case TypeReport.MaterialAid:
                doc.Add(new Paragraph("Звіт по матеріальним допомогам члена профспілки", FontBold)
                {
                    Alignment = Element.ALIGN_CENTER
                });
                break;

            case TypeReport.Award:
                doc.Add(new Paragraph("Звіт по матеріальним заохоченням члена профспілки", FontBold)
                {
                    Alignment = Element.ALIGN_CENTER
                });
                break;

            case TypeReport.Travel:
                doc.Add(new Paragraph("Звіт по поїздкам члена профспілки", FontBold)
                {
                    Alignment = Element.ALIGN_CENTER
                });
                break;

            case TypeReport.Wellness:
                doc.Add(new Paragraph("Звіт по оздоровленням члена профспілки", FontBold)
                {
                    Alignment = Element.ALIGN_CENTER
                });
                break;

            case TypeReport.Tour:
                doc.Add(new Paragraph("Звіт по путівкам члена профспілки", FontBold)
                {
                    Alignment = Element.ALIGN_CENTER
                });
                break;

            case TypeReport.Cultural:
                doc.Add(new Paragraph("Звіт по культурно-просвітницьким закладам члена профспілки", FontBold)
                {
                    Alignment = Element.ALIGN_CENTER
                });
                break;

            case TypeReport.Gift:
                doc.Add(new Paragraph("Звіт по подарункам члена профспілки", FontBold)
                {
                    Alignment = Element.ALIGN_CENTER
                });
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
コード例 #30
0
        /**
        * Processes the element by adding it (or the different parts) to an
        * <CODE>ElementListener</CODE>.
        *
        * @param    listener    an <CODE>ElementListener</CODE>
        * @return    <CODE>true</CODE> if the element was processed successfully
        */

        virtual public bool Process(IElementListener listener)
        {
            try
            {
                return listener.Add(this);
            }
            catch (DocumentException)
            {
                return false;
            }
        }
コード例 #31
0
	    public bool Process(IElementListener listener) {
		    // TODO Auto-generated method stub
		    return false;
	    }