示例#1
0
// ===========================================================================
    public void Write(Stream stream) {
      // step 1
      using (Document document = new Document(PageSize.A4.Rotate())) {
        // step 2
        PdfWriter.GetInstance(document, stream);
        // step 3
        document.Open();
        // step 4
        List<string> days = PojoFactory.GetDays();
        IPdfPTableEvent Pevent = new AlternatingBackground();
        foreach (string day in days) {
          PdfPTable table = GetTable(day);
          table.TableEvent = Pevent;
          document.Add(table);
          document.NewPage();
        }
      }
    }
// ===========================================================================
        public void Write(Stream stream)
        {
            // step 1
            using (Document document = new Document(PageSize.A4.Rotate())) {
                // step 2
                PdfWriter.GetInstance(document, stream);
                // step 3
                document.Open();
                // step 4
                List <string>   days   = PojoFactory.GetDays();
                IPdfPTableEvent Pevent = new AlternatingBackground();
                foreach (string day in days)
                {
                    PdfPTable table = GetTable(day);
                    table.TableEvent = Pevent;
                    document.Add(table);
                    document.NewPage();
                }
            }
        }