Example #1
0
 /* (non-Javadoc)
  * @see com.itextpdf.html2pdf.attach.ITagWorker#processTagChild(com.itextpdf.html2pdf.attach.ITagWorker, com.itextpdf.html2pdf.attach.ProcessorContext)
  */
 public virtual bool ProcessTagChild(ITagWorker childTagWorker, ProcessorContext context)
 {
     if (childTagWorker is TrTagWorker)
     {
         TableRowWrapper wrapper = ((TrTagWorker)childTagWorker).GetTableRowWrapper();
         tableWrapper.NewRow();
         foreach (Cell cell in wrapper.GetCells())
         {
             tableWrapper.AddCell(cell);
         }
         return(true);
     }
     else
     {
         if (childTagWorker is iText.Html2pdf.Attach.Impl.Tags.TableTagWorker)
         {
             if (((iText.Html2pdf.Attach.Impl.Tags.TableTagWorker)childTagWorker).header)
             {
                 Table header = ((iText.Html2pdf.Attach.Impl.Tags.TableTagWorker)childTagWorker).tableWrapper.ToTable(colgroupsHelper
                                                                                                                      );
                 String headerLang = header.GetAccessibilityProperties().GetLanguage();
                 tableWrapper.SetHeaderLang(headerLang);
                 for (int i = 0; i < header.GetNumberOfRows(); i++)
                 {
                     tableWrapper.NewHeaderRow();
                     for (int j = 0; j < header.GetNumberOfColumns(); j++)
                     {
                         Cell headerCell = header.GetCell(i, j);
                         if (headerCell != null)
                         {
                             tableWrapper.AddHeaderCell(headerCell);
                         }
                     }
                 }
                 return(true);
             }
             else
             {
                 if (((iText.Html2pdf.Attach.Impl.Tags.TableTagWorker)childTagWorker).footer)
                 {
                     Table footer = ((iText.Html2pdf.Attach.Impl.Tags.TableTagWorker)childTagWorker).tableWrapper.ToTable(colgroupsHelper
                                                                                                                          );
                     String footerLang = footer.GetAccessibilityProperties().GetLanguage();
                     tableWrapper.SetFooterLang(footerLang);
                     for (int i = 0; i < footer.GetNumberOfRows(); i++)
                     {
                         tableWrapper.NewFooterRow();
                         for (int j = 0; j < footer.GetNumberOfColumns(); j++)
                         {
                             Cell footerCell = footer.GetCell(i, j);
                             if (footerCell != null)
                             {
                                 tableWrapper.AddFooterCell(footerCell);
                             }
                         }
                     }
                     return(true);
                 }
             }
         }
         else
         {
             if (childTagWorker is ColgroupTagWorker)
             {
                 if (colgroupsHelper != null)
                 {
                     colgroupsHelper.Add(((ColgroupTagWorker)childTagWorker).GetColgroup().FinalizeCols());
                     return(true);
                 }
             }
             else
             {
                 if (childTagWorker is CaptionTagWorker)
                 {
                     tableWrapper.SetCaption((Div)childTagWorker.GetElementResult());
                     return(true);
                 }
             }
         }
     }
     return(false);
 }