Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfPTable


      titleCell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT);
      break;
    }
   
    /* compose */
    PdfPTable t = new PdfPTable(new float[] {100F});
    switch(titlePosition) {
    case TopLeft:
    case TopCenter:
    case TopRight:
      titleCell.setVerticalAlignment(PdfPCell.ALIGN_BOTTOM);
      t.addCell(titleCell);
      t.addCell(imgCell);
      break;
    case BottomLeft:
    case BottomCenter:
    case BottomRight:
      titleCell.setVerticalAlignment(PdfPCell.ALIGN_TOP);
      t.addCell(imgCell);
      t.addCell(titleCell);
      break;
    }
   
    /* add */
    PdfPCell tCell = new PdfPCell(t);
View Full Code Here


      imageTable.completeRow();
      doc.add(imageTable);
    }
    if(contentTable) {
      doc.add(Chunk.NEXTPAGE);
      PdfPTable toc = new PdfPTable(new float[] {80F, 20F});
      for(String fn : contentsMap.keySet()) {
        toc.addCell(new Paragraph(fn));
        toc.addCell(new Paragraph(contentsMap.get(fn)));
      }
      doc.add(toc);
    }
    doc.close();
  }
View Full Code Here

 
  public void onEndPage(PdfWriter writer, Document document) {
    if(pageNumbers) {
      currentPageNumber = writer.getPageNumber();
      PdfContentByte cb = pwriter.getDirectContent();
      PdfPTable pageTable = new PdfPTable(new float[] {100F});
      pageTable.setTotalWidth(100F);
      PdfPCell c = new PdfPCell(new Paragraph("Seite " + writer.getPageNumber()));
      c.setBorder(0);
      c.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT);
      pageTable.addCell(c);
      pageTable.writeSelectedRows(0, -1, 480F, 30F, cb);
     
    }
  }
View Full Code Here

        // step 4
        document.add(new Paragraph("StrutsSchoolWeb - Times Table"));
        document.add(new Paragraph(new Date().toString()));
        document.add(Chunk.NEWLINE);

        PdfPTable table = null, tableOuter = null;
        PdfPCell cell = null, cellOuter = null;
        int columns = 0;
        tableOuter = new PdfPTable(tableColumns);
        tableOuter.setWidthPercentage(100);
        tableOuter.setSpacingBefore(0);
        for (Iterator<Integer> it = numbs.iterator(); it.hasNext();) {
            int i = it.next();
            columns++;
            table = new PdfPTable(5);
            table.setWidthPercentage(24);
            table.setSpacingBefore(0);
            cell = new PdfPCell(new Phrase(i + " Times Table"));
            cell.setColspan(5);
            cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
            cell.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
            table.addCell(cell);
            ArrayList<QuestionData> list = generateTable(i);
            for (QuestionData qd : list) {
                cell = new PdfPCell(new Phrase(Integer.toString(qd.getFactor1())));
                cell.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                table.addCell(cell);
                cell = new PdfPCell(new Phrase(qd.getOperation()));
                cell.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                table.addCell(cell);
                cell = new PdfPCell(new Phrase(Integer.toString(qd.getFactor2())));
                cell.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                table.addCell(cell);
                cell = new PdfPCell(new Phrase("="));
                cell.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                table.addCell(cell);
                if (ans) {
                    cell = new PdfPCell(new Phrase(Integer.toString(qd.getAnswer())));
                    cell.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                    cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                    table.addCell(cell);
                } else {
                    cell = new PdfPCell();
                    cell.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                    cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                    table.addCell(cell);
                }
            }
            cellOuter = new PdfPCell(table);
            cellOuter.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
            cellOuter.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
View Full Code Here

        //document.add(new Paragraph("Seq:"+seq));
        //  for(QuestionData qd: qdList) {
        //      document.add(new Paragraph(qd.toStringQuestionAndAnswer()));
        //  }

        PdfPTable table = null;
        PdfPCell cell = null;
        int columns = 0;

        PdfPTable tableInner = null;
        PdfPCell cellInner = null;

        table = new PdfPTable(tableColumns);
        table.setWidthPercentage(100);
        table.setSpacingBefore(0);


        for (QuestionData qd : qdList) {
            columns++;

            tableInner = new PdfPTable(3); //Grade 3 questions should be 3 cols only (2 digits and 1 op-code)

            cellInner = new PdfPCell(new Paragraph(" "));
            cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
            cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
            tableInner.addCell(cellInner);

            charList = QuestionData.getIntChars(qd.getFactor1());
            if (charList.size() == 1) {
                cellInner = new PdfPCell(new Paragraph(" "));
                cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                tableInner.addCell(cellInner);

                cellInner = new PdfPCell(new Paragraph(charList.get(0).toString()));
                cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                tableInner.addCell(cellInner);
            } else if (charList.size() >= 2) {
                cellInner = new PdfPCell(new Paragraph(charList.get(0).toString()));
                cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                tableInner.addCell(cellInner);

                cellInner = new PdfPCell(new Paragraph(charList.get(1).toString()));
                cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                tableInner.addCell(cellInner);
            }
            cellInner = new PdfPCell(new Paragraph(qd.getOperation()));
            cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
            cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
            tableInner.addCell(cellInner);

            charList = QuestionData.getIntChars(qd.getFactor2());
            if (charList.size() == 1) {
                cellInner = new PdfPCell(new Paragraph(" "));
                cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                tableInner.addCell(cellInner);

                cellInner = new PdfPCell(new Paragraph(charList.get(0).toString()));
                cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                tableInner.addCell(cellInner);
            } else if (charList.size() >= 2) {
                cellInner = new PdfPCell(new Paragraph(charList.get(0).toString()));
                cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                tableInner.addCell(cellInner);

                cellInner = new PdfPCell(new Paragraph(charList.get(1).toString()));
                cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                tableInner.addCell(cellInner);
            }
            // Add top answer line
            cellInner = new PdfPCell(new Paragraph(" "));
            cellInner.setColspan(3);
            cellInner.setBorder(PdfPCell.TOP);
            cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
            tableInner.addCell(cellInner);

            if (showAnswers == true) {
                charList = QuestionData.getIntChars(qd.getAnswer());
                switch (charList.size()) {
                    case 3:
                        cellInner = new PdfPCell(new Paragraph(charList.get(0).toString()));
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);

                        cellInner = new PdfPCell(new Paragraph(charList.get(1).toString()));
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);

                        cellInner = new PdfPCell(new Paragraph(charList.get(2).toString()));
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);

                        break;
                    case 2:
                        cellInner = new PdfPCell(new Paragraph(" "));
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);

                        cellInner = new PdfPCell(new Paragraph(charList.get(0).toString()));
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);

                        cellInner = new PdfPCell(new Paragraph(charList.get(1).toString()));
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);

                        break;
                    case 1:
                        cellInner = new PdfPCell(new Paragraph(" "));
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);

                        cellInner = new PdfPCell(new Paragraph(" "));
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);

                        cellInner = new PdfPCell(new Paragraph(charList.get(0).toString()));
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);

                        break;
                    default:
                        cellInner = new PdfPCell(new Paragraph(" "));
                        cellInner.setColspan(3);
                        cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
                        cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
                        tableInner.addCell(cellInner);
                }
            }
            //Add 1 blank lines for calculations
            cellInner = new PdfPCell(new Paragraph(" "));
            cellInner.setColspan(3);
            cellInner.setBorder(borders ? PdfPCell.NO_BORDER : PdfPCell.BOX);
            cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
            tableInner.addCell(cellInner);
            // Add lower Answer line
            cellInner = new PdfPCell(new Paragraph(" "));
            cellInner.setColspan(3);
            cellInner.setBorder(PdfPCell.TOP);
            cellInner.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
            tableInner.addCell(cellInner);

            cell = new PdfPCell(tableInner);
            // cell.addElement(tableInner);
            cell.setBorder(PdfPCell.BOX);
            cell.setBorderWidthRight(borderWidth);
View Full Code Here

    //        System.out.println(JavaEnabled);
    preface.add(new Paragraph("Host: " + hookedbrowser + "", smallBold));

    preface.add(new Paragraph("    Informations", normalFont));

    PdfPTable table = new PdfPTable(2);
    PdfPCell c1 = new PdfPCell(new Phrase("Property"));
    c1.setHorizontalAlignment(Element.ALIGN_CENTER);
    c1.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table.addCell(c1);
    PdfPCell c2 = new PdfPCell(new Phrase("Value"));
    c2.setHorizontalAlignment(Element.ALIGN_CENTER);
    c2.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table.addCell(c2);
    table.setHeaderRows(2);
    table.addCell("Operating System");
    table.addCell(osname);
    table.addCell("Date");
    table.addCell(datestamp);
    table.addCell("Hardware");
    table.addCell(Hardware);
    table.addCell("CPU");
    table.addCell(CPU);
    table.addCell("Screen Size");
    table.addCell(screensize);
    table.addCell("Touch Enabled");
    table.addCell(touchenabled);
   preface.add(table);

preface.add(new Paragraph("    Browser", normalFont));

    PdfPTable table3 = new PdfPTable(2);
    PdfPCell c13 = new PdfPCell(new Phrase("Property"));
    c13.setHorizontalAlignment(Element.ALIGN_CENTER);
    c13.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table3.addCell(c13);
    PdfPCell c23 = new PdfPCell(new Phrase("Value"));
    c23.setHorizontalAlignment(Element.ALIGN_CENTER);
    c23.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table3.addCell(c23);
    table3.setHeaderRows(2);
    table3.addCell("Version");
    table3.addCell(browserversion);
    table3.addCell("User Agent");
    table3.addCell(browserreportedname);
    table3.addCell("Platform");
    table3.addCell(browserplatform);
    table3.addCell("Plugins");
    table3.addCell(browserplugins);
   preface.add(table3);

preface.add(new Paragraph("    Components", normalFont));

    PdfPTable table2 = new PdfPTable(2);
    PdfPCell c12 = new PdfPCell(new Phrase("Property"));
    c12.setHorizontalAlignment(Element.ALIGN_CENTER);
    c12.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table2.addCell(c12);
    PdfPCell c22 = new PdfPCell(new Phrase("Value"));
    c22.setHorizontalAlignment(Element.ALIGN_CENTER);
    c22.setBackgroundColor(BaseColor.LIGHT_GRAY);

    table2.addCell(c22);
    table2.setHeaderRows(2);
    if (HasActiveX.equalsIgnoreCase("yes")){
         table2.addCell("ActiveX ");
        table2.addCell(HasActiveX);
    }
         table2.addCell("Java Activated");
         table2.addCell(JavaEnabled);
         table2.addCell("Flash");
         table2.addCell(HasFlash);
    if (VBScriptEnabled.equalsIgnoreCase("yes")){
         table2.addCell("VBS Activated");
         table2.addCell(VBScriptEnabled);}
    if (HasFoxit.equalsIgnoreCase("yes")){
         table2.addCell("Foxit Reader");
         table2.addCell(HasFoxit);}
    if (HasGoogleGears.equalsIgnoreCase("yes")){
         table2.addCell("Google Gears");
         table2.addCell(HasGoogleGears);}
    if (HasPhonegap.equalsIgnoreCase("yes")){
         table2.addCell("Phonegap ");
         table2.addCell(HasPhonegap);}
    if (HasQuickTime.equalsIgnoreCase("yes")){
          table2.addCell("QuickTime ");
         table2.addCell(HasQuickTime);}
    if (HasSilverlight.equalsIgnoreCase("yes")){
         table2.addCell("SilverLight ");
        table2.addCell(HasSilverlight);}
    if (HasRealPlayer.equalsIgnoreCase("yes")){
         table2.addCell("Real Player ");
        table2.addCell(HasRealPlayer);}
    if (HasVLC.equalsIgnoreCase("yes")){
        table2.addCell("VLC ");
        table2.addCell(HasVLC);}
    if (HasWMP.equalsIgnoreCase("yes")){
         table2.addCell("Windows Media Player ");
        table2.addCell(HasWMP);}
    if (HasWebRTC.equalsIgnoreCase("yes")){
        table2.addCell("Web RTC ");
         table2.addCell(HasWebRTC);}
    if (HasWebSocket.equalsIgnoreCase("yes")){
          table2.addCell("Web Sockets ");
         table2.addCell(HasWebSocket);}
    if (hasSessionCookies.equalsIgnoreCase("yes")){
       table2.addCell("Session Cookies");
        table2.addCell(hasSessionCookies);}
    if (hasPersistentCookies.equalsIgnoreCase("yes")){
         table2.addCell("Persistent Cookies");
    table2.addCell(hasPersistentCookies);}
       preface.add(table2);

   preface.add(new Paragraph("Hooked page", normalFont));

    PdfPTable table4 = new PdfPTable(2);
    PdfPCell c14 = new PdfPCell(new Phrase("Property"));
    c14.setHorizontalAlignment(Element.ALIGN_CENTER);
    c14.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table4.addCell(c14);
    PdfPCell c24 = new PdfPCell(new Phrase("Value"));
    c24.setHorizontalAlignment(Element.ALIGN_CENTER);
    c24.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table4.addCell(c24);
    table4.setHeaderRows(2);
    table4.addCell("Page Title");
    table4.addCell(pagetitle);
    table4.addCell("page URI");
    table4.addCell(pageuri);
    table4.addCell("Page referrer");
    table4.addCell(pagereferrer);
    table4.addCell("Hostname");
    table4.addCell(hostname);
   preface.add(table4);
        }

// REPORT: PROCESSING OFFLINE ZOMBIS
        Zombies[] off = OfflineClass.extractOffline(j);
        for (int i = 0; i < off.length; i++) {
            String sid = off[i].getSession();
            String url_ko = "" + BeefReport.url + "/api/hooks/" + sid + "?token=" + BeefReport.key +  "";
     //       System.out.println(url_k);
            String ko = BeefRequester.BeefGetRequest(url_ko);
            JSONObject jko = new JSONObject();
            jko = (JSONObject) JSONSerializer.toJSON(ko);
            String hookedbrowser = off[i].getIp();
            // host informations
             if (jko.containsKey("OsName")){osname = jko.getString("OsName");}
            if (jko.containsKey("DateStamp")){  datestamp = jko.getString("DateStamp");}
            if (jko.containsKey("Hardware")){  Hardware = jko.getString("Hardware");}
            if (jko.containsKey("CPU")){  CPU = jko.getString("CPU");}
            if (jko.containsKey("ScreenSize")){  screensize = jko.getString("ScreenSize");}
            if (jko.containsKey("TouchEnabled")){  touchenabled = jko.getString("TouchEnabled");}
            // Hooked page
           if (jko.containsKey("PageTitle")){   pagetitle = jko.getString("PageTitle");}
            if (jko.containsKey("PageURI")){  pageuri = jko.getString("PageURI");}
            if (jko.containsKey("PageReferrer")){  pagereferrer = jko.getString("PageReferrer");}
            if (jko.containsKey("HostName")){  hostname = jko.getString("HostName");}
            // browser
            if (jko.containsKey("BrowserPlatform")){  browserplatform = jko.getString("BrowserPlatform");}
            if (jko.containsKey("BrowserPlugins")){  browserplugins = jko.getString("BrowserPlugins");}
            if (jko.containsKey("BrowserReportedName")){  browserreportedname = jko.getString("BrowserReportedName");}
            if (jko.containsKey("BrowserVersion")){  browserversion = jko.getString("BrowserVersion");}
            // components
            if (jko.containsKey("HasActiveX")){  HasActiveX = jko.getString("HasActiveX");}
            if (jko.containsKey("HasFlash")){  HasFlash = jko.getString("HasFlash");}
            if (jko.containsKey("HasFoxit")){  HasFoxit = jko.getString("HasFoxit");}
            if (jko.containsKey("HasGoogleGears")){  HasGoogleGears = jko.getString("HasGoogleGears");}
            if (jko.containsKey("HasPhonegap")){  HasPhonegap = jko.getString("HasPhonegap");}
            if (jko.containsKey("HasQuickTime")){  HasQuickTime = jko.getString("HasQuickTime");}
            if (jko.containsKey("HasRealPlayer")){  HasRealPlayer = jko.getString("HasRealPlayer");}
           if (jko.containsKey("HasSilverlight")){ HasSilverlight = jko.getString("HasSilverlight");}
           if (jko.containsKey("HasVLC")){   HasVLC = jko.getString("HasVLC");}
           if (jko.containsKey("HasWMP")){   HasWMP = jko.getString("HasWMP");}
           if (jko.containsKey("HasWebRTC")){   HasWebRTC = jko.getString("HasWebRTC");}
           if (jko.containsKey("HasWebSocket")){   HasWebSocket = jko.getString("HasWebSocket");}
           if (jko.containsKey("JavaEnabled")){   JavaEnabled = jko.getString("JavaEnabled");}
           if (jko.containsKey("VBScriptEnabled")){ VBScriptEnabled = jko.getString("VBScriptEnabled");}
          if (jko.containsKey("hasPersistentCookies")){   hasPersistentCookies = jko.getString("hasPersistentCookies");}
           if (jko.containsKey("hasSessionCookies")){ hasSessionCookies = jko.getString("hasSessionCookies");}
    //        System.out.println(JavaEnabled);
    preface.add(new Paragraph("Host: " + hookedbrowser + "", smallBold));

    preface.add(new Paragraph("    Informations", normalFont));

    PdfPTable table = new PdfPTable(2);
    PdfPCell c1 = new PdfPCell(new Phrase("Property"));
    c1.setHorizontalAlignment(Element.ALIGN_CENTER);
    c1.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table.addCell(c1);
    PdfPCell c2 = new PdfPCell(new Phrase("Value"));
    c2.setHorizontalAlignment(Element.ALIGN_CENTER);
    c2.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table.addCell(c2);
    table.setHeaderRows(2);
    table.addCell("Operating System");
    table.addCell(osname);
    table.addCell("Date");
    table.addCell(datestamp);
    table.addCell("Hardware");
    table.addCell(Hardware);
    table.addCell("CPU");
    table.addCell(CPU);
    table.addCell("Screen Size");
    table.addCell(screensize);
    table.addCell("Touch Enabled");
    table.addCell(touchenabled);
   preface.add(table);

preface.add(new Paragraph("    Browser", normalFont));

    PdfPTable table3 = new PdfPTable(2);
    PdfPCell c13 = new PdfPCell(new Phrase("Property"));
    c13.setHorizontalAlignment(Element.ALIGN_CENTER);
    c13.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table3.addCell(c13);
    PdfPCell c23 = new PdfPCell(new Phrase("Value"));
    c23.setHorizontalAlignment(Element.ALIGN_CENTER);
    c23.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table3.addCell(c23);
    table3.setHeaderRows(2);
    table3.addCell("Version");
    table3.addCell(browserversion);
    table3.addCell("User Agent");
    table3.addCell(browserreportedname);
    table3.addCell("Platform");
    table3.addCell(browserplatform);
    table3.addCell("Plugins");
    table3.addCell(browserplugins);
   preface.add(table3);

preface.add(new Paragraph("    Components", normalFont));
    PdfPTable table2 = new PdfPTable(2);
    PdfPCell c12 = new PdfPCell(new Phrase("Property"));
    c12.setHorizontalAlignment(Element.ALIGN_CENTER);
    c12.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table2.addCell(c12);
    PdfPCell c22 = new PdfPCell(new Phrase("Value"));
    c22.setHorizontalAlignment(Element.ALIGN_CENTER);
    c22.setBackgroundColor(BaseColor.LIGHT_GRAY);

       table2.addCell(c22);
    table2.setHeaderRows(2);
    if (HasActiveX.equalsIgnoreCase("yes")){
         table2.addCell("ActiveX ");
        table2.addCell(HasActiveX);
    }
         table2.addCell("Java Activated");
         table2.addCell(JavaEnabled);
         table2.addCell("Flash");
         table2.addCell(HasFlash);
    if (VBScriptEnabled.equalsIgnoreCase("yes")){
         table2.addCell("VBS Activated");
         table2.addCell(VBScriptEnabled);}
    if (HasFoxit.equalsIgnoreCase("yes")){
         table2.addCell("Foxit Reader");
         table2.addCell(HasFoxit);}
    if (HasGoogleGears.equalsIgnoreCase("yes")){
         table2.addCell("Google Gears");
         table2.addCell(HasGoogleGears);}
    if (HasPhonegap.equalsIgnoreCase("yes")){
         table2.addCell("Phonegap ");
         table2.addCell(HasPhonegap);}
    if (HasQuickTime.equalsIgnoreCase("yes")){
          table2.addCell("QuickTime ");
         table2.addCell(HasQuickTime);}
    if (HasSilverlight.equalsIgnoreCase("yes")){
         table2.addCell("SilverLight ");
        table2.addCell(HasSilverlight);}
    if (HasRealPlayer.equalsIgnoreCase("yes")){
         table2.addCell("Real Player ");
        table2.addCell(HasRealPlayer);}
    if (HasVLC.equalsIgnoreCase("yes")){
        table2.addCell("VLC ");
        table2.addCell(HasVLC);}
    if (HasWMP.equalsIgnoreCase("yes")){
         table2.addCell("Windows Media Player ");
        table2.addCell(HasWMP);}
    if (HasWebRTC.equalsIgnoreCase("yes")){
        table2.addCell("Web RTC ");
         table2.addCell(HasWebRTC);}
    if (HasWebSocket.equalsIgnoreCase("yes")){
          table2.addCell("Web Sockets ");
         table2.addCell(HasWebSocket);}
    if (hasSessionCookies.equalsIgnoreCase("yes")){
       table2.addCell("Session Cookies");
        table2.addCell(hasSessionCookies);}
    if (hasPersistentCookies.equalsIgnoreCase("yes")){
         table2.addCell("Persistent Cookies");
    table2.addCell(hasPersistentCookies);}
       preface.add(table2);
//addEmptyLine(subPara, 1);
   preface.add(new Paragraph("Hooked page", normalFont));
   // addEmptyLine(subPara, 2);
    PdfPTable table4 = new PdfPTable(2);
    PdfPCell c14 = new PdfPCell(new Phrase("Property"));
    c14.setHorizontalAlignment(Element.ALIGN_CENTER);
    c14.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table4.addCell(c14);
    PdfPCell c24 = new PdfPCell(new Phrase("Value"));
    c24.setHorizontalAlignment(Element.ALIGN_CENTER);
    c24.setBackgroundColor(BaseColor.LIGHT_GRAY);
    table4.addCell(c24);
    table4.setHeaderRows(2);
    table4.addCell("Page Title");
    table4.addCell(pagetitle);
    table4.addCell("page URI");
    table4.addCell(pageuri);
    table4.addCell("Page referrer");
    table4.addCell(pagereferrer);
    table4.addCell("Hostname");
    table4.addCell(hostname);
   preface.add(table4);
     }

    Paragraph paragraph = new Paragraph();
   addEmptyLine(paragraph, 5);
View Full Code Here

   * Erzeugt den Tabellen-Header.
   * @throws DocumentException
   */
  public void createHeader() throws DocumentException
  {
    table = new PdfPTable(headers.size());
    int[] w = new int[headers.size()];
    for (int i = 0; i < headers.size(); i++)
      w[i] = widths.get(i).intValue();
    table.setWidths(w);
    table.setWidthPercentage(100);
View Full Code Here

    @Override
    protected void buildHeader() throws DocumentException, IOException, MalformedURLException {

        float[] widiths = {0.5f, 2f, 0.5f};
        PdfPTable table = new PdfPTable(widiths);
        table.setWidthPercentage(90);
        PdfPCell imageL = new PdfPCell();
        PdfPCell imageR = new PdfPCell();

        if (this.reportSettingsProperties.loadUseLeftImage()) {
            BufferedImage leftImg = ImageUtils.loadImage(ImageUtils.IMAGES_FOLDER + System.getProperty("file.separator") + ReportSettingsProperties.FILE_NAME_LEFT_IMAGE);
            if (leftImg != null) {
                Image leftPdfImage = Image.getInstance(leftImg, null);
                leftPdfImage = this.scaleImage(leftPdfImage, this.reportSettingsProperties.loadLeftImageSize());
                leftPdfImage.setAlignment(Image.ALIGN_MIDDLE);
                imageL.setImage(leftPdfImage);
                imageL.setHorizontalAlignment(Element.ALIGN_MIDDLE);
                imageL.setVerticalAlignment(Element.ALIGN_CENTER);
            }
        }

        if (this.reportSettingsProperties.loadUseRightImage()) {
            BufferedImage rightImg = ImageUtils.loadImage(ImageUtils.IMAGES_FOLDER + System.getProperty("file.separator") + ReportSettingsProperties.FILE_NAME_RIGHT_IMAGE);
            if (rightImg != null) {
                Image rightImage = Image.getInstance(rightImg, null);
                rightImage.setAlignment(Image.ALIGN_MIDDLE);
                imageR.setImage(rightImage);
                imageR.setHorizontalAlignment(Element.ALIGN_MIDDLE);
                imageR.setVerticalAlignment(Element.ALIGN_CENTER);
            }
        }

        table.addCell(imageL);
        Chunk par = new Chunk(this.reportSettingsProperties.loadTitle());
        par.setFont(new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadTitleFont())));
        Paragraph enc = new Paragraph(par);
        enc.setAlignment(Element.ALIGN_CENTER);
        PdfPCell cell = new PdfPCell();
        cell.addElement(enc);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        table.addCell(cell);
        table.addCell(imageR);
        this.document.add(table);
        this.writeEmptyLine();
    }
View Full Code Here

        }

        int amount = this.getAmountOfData();

        if (amount > 0) {
            PdfPTable patientTable = new PdfPTable(amount);
            patientTable.setWidthPercentage(90);

            Font title = new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadDataFont()));
            Font value = new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadDataValueFont()));

            // PUT HEADERS

            if (this.reportSettingsProperties.loadUseAge()) {
                Chunk a = new Chunk("Edad");
                a.setFont(title);
                PdfPCell ages = new PdfPCell(new Paragraph(a));
                ages.setHorizontalAlignment(Element.ALIGN_CENTER);
                ages.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(ages);
            }

            if (this.reportSettingsProperties.loadUseWeight()) {
                Chunk p = new Chunk("Peso" + System.getProperty("line.separator") + Units.kilograms);
                p.setFont(title);
                PdfPCell weight = new PdfPCell(new Paragraph(p));
                weight.setHorizontalAlignment(Element.ALIGN_CENTER);
                weight.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(weight);
            }

            if (this.reportSettingsProperties.loadUseHeight()) {
                Chunk h = new Chunk("Altura" + System.getProperty("line.separator") + Units.Centimetres);
                h.setFont(title);
                PdfPCell height = new PdfPCell(new Paragraph(h));
                height.setHorizontalAlignment(Element.ALIGN_CENTER);
                height.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(height);
            }

            if (this.reportSettingsProperties.loadUsePS()) {
                Chunk pss = new Chunk("PS" + System.getProperty("line.separator") + Units.pressure);
                pss.setFont(title);
                PdfPCell ps = new PdfPCell(new Paragraph(pss));
                ps.setHorizontalAlignment(Element.ALIGN_CENTER);
                ps.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(ps);
            }

            if (this.reportSettingsProperties.loadUsePD()) {
                Chunk pdd = new Chunk("PD" + System.getProperty("line.separator") + Units.pressure);
                pdd.setFont(title);
                PdfPCell pd = new PdfPCell(new Paragraph(pdd));
                pd.setHorizontalAlignment(Element.ALIGN_CENTER);
                pd.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(pd);
            }

            if (this.reportSettingsProperties.loadUseSmoke()) {
                Chunk sm = new Chunk("Fuma");
                sm.setFont(title);
                PdfPCell smooke = new PdfPCell(new Paragraph(sm));
                smooke.setHorizontalAlignment(Element.ALIGN_CENTER);
                smooke.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(smooke);
            }

            // PUT DATA

            if (this.reportSettingsProperties.loadUseAge()) {
                Chunk years = new Chunk(patient.getAge().toString());
                years.setFont(value);
                PdfPCell agesValue = new PdfPCell(new Paragraph(years));
                agesValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                agesValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(agesValue);
            }

            if (this.reportSettingsProperties.loadUseWeight()) {
                Chunk weightP = new Chunk(analysis.getClinicalInformation().getWeightAsString(false));
                weightP.setFont(value);
                PdfPCell weightValue = new PdfPCell(new Paragraph(weightP));
                weightValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                weightValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(weightValue);
            }

            if (this.reportSettingsProperties.loadUseHeight()) {
                Chunk heightP = new Chunk(analysis.getClinicalInformation().getHeightAsString(false));
                heightP.setFont(value);
                PdfPCell heightValue = new PdfPCell(new Paragraph(heightP));
                heightValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                heightValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(heightValue);
            }

            if (this.reportSettingsProperties.loadUsePS()) {
                Chunk psCk = new Chunk(analysis.getClinicalInformation().getSystolicPressureAsString(false));
                psCk.setFont(value);
                PdfPCell psValue = new PdfPCell(new Paragraph(psCk));
                psValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                psValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(psValue);
            }

            if (this.reportSettingsProperties.loadUsePD()) {
                Chunk pdCk = new Chunk(analysis.getClinicalInformation().getDiastolicPressureAsString(false));
                pdCk.setFont(value);
                PdfPCell pdValue = new PdfPCell(new Paragraph(pdCk));
                pdValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                pdValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(pdValue);
            }

            if (this.reportSettingsProperties.loadUseSmoke()) {
                Chunk smk = new Chunk(patient.getClinicalHistoryProxy().getIsSmoker());
                smk.setFont(value);
                PdfPCell smookeValue = new PdfPCell(new Paragraph(smk));
                smookeValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                smookeValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(smookeValue);
            }
            this.document.add(patientTable);
        }

        this.writeEmptyLine();
View Full Code Here

        int amount = this.getAmountOfIndex();

        if (amount > 0) {

            PdfPTable indicesTable = new PdfPTable(amount);
            indicesTable.setWidthPercentage(90);

            // PUT HEADER

            if (this.reportSettingsProperties.loadUseAOD()) {
                Chunk amp = new Chunk("Amplitud OD" + System.getProperty("line.separator") + Units.amplitude);
                amp.setFont(indexFont);
                PdfPCell amplitud = new PdfPCell(new Paragraph(amp));
                amplitud.setHorizontalAlignment(Element.ALIGN_CENTER);
                amplitud.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(amplitud);
            }

            if (this.reportSettingsProperties.loadUseIAR()) {
                Chunk aume = new Chunk("Aumentación" + System.getProperty("line.separator") + Units.amplitude);
                aume.setFont(indexFont);
                PdfPCell aumentacion = new PdfPCell(new Paragraph(aume));
                aumentacion.setHorizontalAlignment(Element.ALIGN_CENTER);
                aumentacion.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(aumentacion);
            }

            if (this.reportSettingsProperties.loadUseAOS()) {
                Chunk an = new Chunk("Ancho 50% OS" + System.getProperty("line.separator") + Units.miliseconds);
                an.setFont(indexFont);
                PdfPCell ancho = new PdfPCell(new Paragraph(an));
                ancho.setHorizontalAlignment(Element.ALIGN_CENTER);
                ancho.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(ancho);
            }

            if (this.reportSettingsProperties.loadUseIMC()) {
                Chunk m = new Chunk("Masa Corporal");
                m.setFont(indexFont);
                PdfPCell masa = new PdfPCell(new Paragraph(m));
                masa.setHorizontalAlignment(Element.ALIGN_CENTER);
                masa.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(masa);
            }

            if (this.reportSettingsProperties.loadUseFC()) {
                Chunk f = new Chunk("Frecuencia Card." + System.getProperty("line.separator") + "[ppm]");
                f.setFont(indexFont);
                PdfPCell freq = new PdfPCell(new Paragraph(f));
                freq.setHorizontalAlignment(Element.ALIGN_CENTER);
                freq.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(freq);
            }

            if (this.reportSettingsProperties.loadUseRS()) {
                Chunk r = new Chunk("Reflejo Sist." + System.getProperty("line.separator") + Units.miliseconds);
                r.setFont(indexFont);
                PdfPCell rs = new PdfPCell(new Paragraph(r));
                rs.setHorizontalAlignment(Element.ALIGN_CENTER);
                rs.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(rs);
            }

            if (this.reportSettingsProperties.loadUseAOD()) {
                Chunk ampCk = new Chunk(analysisResult.getAod().getValueAsString());
                ampCk.setFont(indexValueFont);
                PdfPCell ampValue = new PdfPCell(new Paragraph(ampCk));
                ampValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                ampValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(ampValue);
            }

            if (this.reportSettingsProperties.loadUseIAR()) {
                Chunk aumCk = new Chunk(analysisResult.getIar().getValueAsString());
                aumCk.setFont(indexValueFont);
                PdfPCell aum = new PdfPCell(new Paragraph(aumCk));
                aum.setHorizontalAlignment(Element.ALIGN_CENTER);
                aum.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(aum);
            }

            if (this.reportSettingsProperties.loadUseAOS()) {
                Chunk anchCk = new Chunk(analysisResult.getAos().getValueAsString());
                anchCk.setFont(indexValueFont);
                PdfPCell anch = new PdfPCell(new Paragraph(anchCk));
                anch.setHorizontalAlignment(Element.ALIGN_CENTER);
                anch.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(anch);
            }

            if (this.reportSettingsProperties.loadUseIMC()) {
                Chunk masCk = new Chunk(analysis.getClinicalInformation().getIMCasString());
                masCk.setFont(indexValueFont);
                PdfPCell mas = new PdfPCell(new Paragraph(masCk));
                mas.setHorizontalAlignment(Element.ALIGN_CENTER);
                mas.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(mas);
            }

            if (this.reportSettingsProperties.loadUseFC()) {
                Chunk freqCk = new Chunk(analysisResult.getHeartRateAsString());
                freqCk.setFont(indexValueFont);
                PdfPCell freqC = new PdfPCell(new Paragraph(freqCk));
                freqC.setHorizontalAlignment(Element.ALIGN_CENTER);
                freqC.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(freqC);
            }

            if (this.reportSettingsProperties.loadUseRS()) {
                Chunk rs = new Chunk(analysisResult.getT().getValueAsString());
                rs.setFont(indexValueFont);
                PdfPCell rsC = new PdfPCell(new Paragraph(rs));
                rsC.setHorizontalAlignment(Element.ALIGN_CENTER);
                rsC.setVerticalAlignment(Element.ALIGN_MIDDLE);
                indicesTable.addCell(rsC);
            }

            this.document.add(indicesTable);
        }
        this.writeEmptyLine();
View Full Code Here

TOP

Related Classes of com.itextpdf.text.pdf.PdfPTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.