コード例 #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
        // 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 process successfully</returns>
        public bool Process(IElementListener listener)
        {
            try {
                return(listener.Add(this));
            }
            catch (DocumentException) {
                return(false);
            }
        }
コード例 #3
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 virtual bool Process(IElementListener listener)
 {
     try {
         return(listener.Add(element));
     }
     catch (DocumentException) {
         return(false);
     }
 }
コード例 #4
0
ファイル: Cell.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 override bool process(IElementListener listener)
        {
            try {
                return(listener.Add(this));
            }
            catch (DocumentException de) {
                de.GetType();
                return(false);
            }
        }
コード例 #5
0
        private void AddPlaceForSignatureAccountant(IElementListener document)
        {
            var builder = new StringBuilder();

            builder.Append("Головний бухгалтер ППО ОНУ імені І.І.Мечникова ");
            builder.Append(new string('_', 10));
            builder.Append(' ').Append(' ');
            builder.Append(new string('_', 18));

            document.Add(_pdfHelper.AddParagraph(builder.ToString(), Element.ALIGN_RIGHT));
        }
コード例 #6
0
 private void AddPeriod(ReportModel model, IElementListener doc)
 {
     doc.Add(new Paragraph($"за період з {model.StartDate:dd/MM/yyyy}р по {model.EndDate:dd/MM/yyyy}р", FontBold)
     {
         Alignment = Element.ALIGN_CENTER
     });
     if (model.Type == TypeReport.All)
     {
         AddEmptyParagraph(doc, 2);
     }
 }
コード例 #7
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;
     }
 }
コード例 #8
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);
            }
        }
コード例 #9
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;
            }
        }
コード例 #10
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;
     }
 }
コード例 #11
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;
     }
 }
コード例 #12
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;
         }
     }
コード例 #13
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();
     }
 }
コード例 #14
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;
     }
 }
コード例 #15
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();
            }
        }
コード例 #16
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;
     }
 }