Ejemplo n.º 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);
 }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 5
0
        // 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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));
    }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 11
0
        // these Element methods are irrelevant for a table stub.

        virtual public bool Process(IElementListener listener)
        {
            return(false);
        }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 13
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;
     }
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 15
0
 public bool Process(IElementListener listener)
 {
     return(true);
 }
Ejemplo n.º 16
0
 public bool Process(IElementListener listener)
 {
     return true;
 }
Ejemplo n.º 17
0
 /*
  * (non-Javadoc)
  *
  * @see com.itextpdf.text.Element#process(com.itextpdf.text.ElementListener)
  */
 public bool Process(IElementListener listener)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 18
0
 // these Element methods are irrelevant for a table stub.
 
 virtual public bool Process(IElementListener listener) {
     return false;
 }
Ejemplo n.º 19
0
 // 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;
     }
 }
Ejemplo n.º 20
0
 public bool Process(IElementListener listener)
 {
     // TODO Auto-generated method stub
     return(false);
 }
Ejemplo n.º 21
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;
     }
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 23
0
 public bool Process(IElementListener listener) => true;
Ejemplo n.º 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;
         }
     }
Ejemplo n.º 25
0
 public override bool Process(IElementListener listener)
 {
     return(false);
 }
Ejemplo n.º 26
0
 /*
  * (non-Javadoc)
  *
  * @see com.itextpdf.text.Element#process(com.itextpdf.text.ElementListener)
  */
 public bool Process(IElementListener listener)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 27
0
 public override bool Process(IElementListener listener)
 {
     return false;
 }
Ejemplo n.º 28
0
 // 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;
     }
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 31
0
	    public bool Process(IElementListener listener) {
		    // TODO Auto-generated method stub
		    return false;
	    }