Package com.itextpdf.text

Examples of com.itextpdf.text.Phrase


         * Personal Details
         */
        PdfPTable table = new PdfPTable(2); // 2 columns.

        ArrayList<PdfPCell> cellList = new ArrayList<PdfPCell>();
        cellList.add(new PdfPCell(new Phrase("Passenger (Full Name):")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getFamilyname() + " " + this.travelerP.getFirstname())));
        cellList.add(new PdfPCell(new Phrase("Home Address Line 1:")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getHomeaddress1())));
        cellList.add(new PdfPCell(new Phrase("Home Address Line 2:")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getHomeaddress2())));
        cellList.add(new PdfPCell(new Phrase("City:")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getCity())));
        cellList.add(new PdfPCell(new Phrase("Country:")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getCountry())));
        cellList.add(new PdfPCell(new Phrase("Postal Code:")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getPostalcode())));
        cellList.add(new PdfPCell(new Phrase("Telephone Number:")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getMobilephone())));
        cellList.add(new PdfPCell(new Phrase("Fax:")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getBusinessfax())));
        cellList.add(new PdfPCell(new Phrase("I.D:")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getIdnumber())));


        cellList.add(new PdfPCell(new Phrase("Nationality Of Passport:")));
        cellList.add(new PdfPCell(new Phrase(this.travelD.getCountry())));
        cellList.add(new PdfPCell(new Phrase("Passport Number:")));
        cellList.add(new PdfPCell(new Phrase(this.travelD.getPassportnumber())));
        cellList.add(new PdfPCell(new Phrase("Company Contact:")));
        cellList.add(new PdfPCell(new Phrase(this.travelerP.getBusinessphone())));
        cellList.add(new PdfPCell(new Phrase("Destination:")));
        cellList.add(new PdfPCell(new Phrase(this.itinerary.getDestinationCity())));
        cellList.add(new PdfPCell(new Phrase("Date of Departure:")));
        cellList.add(new PdfPCell(new Phrase("")));
        //cellList.add(new PdfPCell(new Phrase(this.itinerary.getDatefrom().toString())));

        cellList.add(new PdfPCell(new Phrase("Date of Return:")));
        cellList.add(new PdfPCell(new Phrase("")));
        //cellList.add(new PdfPCell(new Phrase(this.itinerary.getDateto().toString())));
        cellList.add(new PdfPCell(new Phrase("Ticket Number/ Reference Number:")));
        cellList.add(new PdfPCell(new Phrase(this.viewForX.getTicketnum())));
        cellList.add(new PdfPCell(new Phrase("Voyager Number:")));
        cellList.add(new PdfPCell(new Phrase(this.viewForX.getVoyagernum())));

        for (int i = 0; i < cellList.size(); i++) {
            if (i % 2 == 0) {
                cellList.get(i).setBorder(Rectangle.NO_BORDER);
            }
            table.addCell(cellList.get(i));
        }
        document.add(table);

        /**
         * Forex Breakdown
         */
        table = new PdfPTable(2);
        cellList = new ArrayList<PdfPCell>();
        newLine(document);
        document.add(new Paragraph("Forex Breakdown", mediumFont));
        newLine(document);
        cellList.add(new PdfPCell(new Phrase("Travellers Cheques:")));
        cellList.add(new PdfPCell(new Phrase(this.viewForX.getCurrencycheque()
                + " "
                + this.viewForX.getTravelerscheques())));

        cellList.add(new PdfPCell(new Phrase("Foreign Cash:")));
        cellList.add(new PdfPCell(new Phrase(this.viewForX.getCurrencycash()
                + " "
                + this.viewForX.getCash())));

        cellList.add(new PdfPCell(new Phrase("CC Type (VISA, DINERS, ETC):")));
        cellList.add(new PdfPCell(new Phrase(this.viewForX.getCctype())));

        cellList.add(new PdfPCell(new Phrase("Number:")));
        cellList.add(new PdfPCell(new Phrase("Please fill in here")));
        cellList.add(new PdfPCell(new Phrase("Last 3 digits:")));
        cellList.add(new PdfPCell(new Phrase("Please fill in here")));
        cellList.add(new PdfPCell(new Phrase("Expiry Date:")));
       
        cellList.add(new PdfPCell(new Phrase("Please fill in here")));
        //cellList.add(new PdfPCell(new Phrase(this.viewForX.getCcexpirydate().toString())));

        cellList.add(new PdfPCell(new Phrase("Amount:")));
        cellList.add(new PdfPCell(new Phrase(this.viewForX.getCurrencycc()
                + " "
                + this.viewForX.getCcpaymentamount())));

        for (int i = 0; i < cellList.size(); i++) {
            if (i % 2 == 0) {
                cellList.get(i).setBorder(Rectangle.NO_BORDER);
            }
            table.addCell(cellList.get(i));
        }

        document.add(table);

        /**
         * Delivery Information
         */
        table = new PdfPTable(2);
        cellList = new ArrayList<PdfPCell>();
        newLine(document);
        document.add(new Paragraph("Delivery Information", mediumFont));
        newLine(document);
        cellList.add(new PdfPCell(new Phrase("Delivery - Date and Time:")));
        cellList.add(new PdfPCell(new Phrase(this.viewForX.getDateofrequired().toString())));
        cellList.add(new PdfPCell(new Phrase("Date and Time: Will be confirmed by Forex Consultant:")));
        cellList.add(new PdfPCell(new Phrase(this.viewForX.getDatewillbeconfirmed().toString())));

        for (int i = 0; i < cellList.size(); i++) {
            if (i % 2 == 0) {
                cellList.get(i).setBorder(Rectangle.NO_BORDER);
            }
            table.addCell(cellList.get(i));
        }

        document.add(table);

        /**
         * Additional Information
         */
        table = new PdfPTable(2);
        cellList = new ArrayList<PdfPCell>();
        newLine(document);
        document.add(new Paragraph("Additional Information", mediumFont));
        newLine(document);
        cellList.add(new PdfPCell(new Phrase("Reason for trael:")));
        cellList.add(new PdfPCell(new Phrase(this.viewForX.getReasonfortravel())));

        for (int i = 0; i < cellList.size(); i++) {
            if (i % 2 == 0) {
                cellList.get(i).setBorder(Rectangle.NO_BORDER);
            }
View Full Code Here


        FacesContext.getCurrentInstance().responseComplete();
        System.out.println("File Generated");
    }

    public void newLine(Document document) throws DocumentException {
        document.add(new Phrase(""));
    }
View Full Code Here

         * Personal Details
         */
        PdfPTable table = new PdfPTable(2); // 2 columns.

        ArrayList<PdfPCell> cellList = new ArrayList<PdfPCell>();
        cellList.add(new PdfPCell(new Phrase("Staff ID:")));
        cellList.add(new PdfPCell(new Phrase(this.profileRef.getStaffid())));
        cellList.add(new PdfPCell(new Phrase("Title:")));
        cellList.add(new PdfPCell(new Phrase(this.profileRef.getTitle())));
        cellList.add(new PdfPCell(new Phrase("Surname:")));
        cellList.add(new PdfPCell(new Phrase(this.profileRef.getFamilyname())));
        cellList.add(new PdfPCell(new Phrase("First Name:")));
        cellList.add(new PdfPCell(new Phrase(this.profileRef.getFirstname())));

        for (int i = 0; i < cellList.size(); i++) {
            if (i % 2 == 0) {
                cellList.get(i).setBorder(Rectangle.NO_BORDER);
            }
            table.addCell(cellList.get(i));
        }
        document.add(table);

        /**
         * Travel Details
         */
        table = new PdfPTable(2);
        cellList = new ArrayList<PdfPCell>();
        newLine(document);
        document.add(new Paragraph("Travel", mediumFont));
        newLine(document);
        cellList.add(new PdfPCell(new Phrase("Application Name:")));
        cellList.add(new PdfPCell(new Phrase(this.appRef.getDescription())));
        cellList.add(new PdfPCell(new Phrase("Date of Initial Departure:")));
        cellList.add(new PdfPCell(new Phrase(df.format(this.travelRef.getDatedeparture()))));

        cellList.add(new PdfPCell(new Phrase("Date of Final Return:")));
        cellList.add(new PdfPCell(new Phrase(df.format(this.travelRef.getDatereturn()))));

        cellList.add(new PdfPCell(new Phrase("Purpose of Travel:")));
        cellList.add(new PdfPCell(new Phrase(this.travelRef.getDescription())));

        for (int i = 0; i < cellList.size(); i++) {
            if (i % 2 == 0) {
                cellList.get(i).setBorder(Rectangle.NO_BORDER);
            }
            table.addCell(cellList.get(i));
        }

        document.add(table);

        /**
         * Itinerary Details
         */
        table = new PdfPTable(4);
        table.setWidthPercentage(90f);
        table.setHeaderRows(1);
        cellList = new ArrayList<PdfPCell>();
        newLine(document);
        document.add(new Paragraph("Itinerary", mediumFont));
        newLine(document);
        cellList.add(new PdfPCell(new Phrase("Date", bold)));
        cellList.add(new PdfPCell(new Phrase("Destination", bold)));
        cellList.add(new PdfPCell(new Phrase("Leave Type", bold)));
        cellList.add(new PdfPCell(new Phrase("Travel Day/ Work Day", bold)));


        for (Itinerary i : hops) {
            //cellList.add(new PdfPCell(new Phrase(df.format(i.getDate()))));
            cellList.add(new PdfPCell(new Phrase("BLANK")));
            cellList.add(new PdfPCell(new Phrase(i.getDestinationCity())));
            cellList.add(new PdfPCell(new Phrase(i.getLeavetype())));
            cellList.add(new PdfPCell(new Phrase(i.getTravelday())));
        }

        for (int i = 0; i < cellList.size(); i++) {
            table.addCell(cellList.get(i));
        }
        document.add(table);

        /**
         * Quote CostCenter
         */
        table = new PdfPTable(2);
        cellList = new ArrayList<PdfPCell>();
        newLine(document);
        document.add(new Paragraph("Quotes", mediumFont));
        newLine(document);
        cellList.add(new PdfPCell(new Phrase("Cost Center:")));
        cellList.add(new PdfPCell(new Phrase(this.quoteRef.getCostcenter())));

        for (int i = 0; i < cellList.size(); i++) {
            if (i % 2 == 0) {
                cellList.get(i).setBorder(Rectangle.NO_BORDER);
            }
            table.addCell(cellList.get(i));
        }

        document.add(table);

        /**
         * Flight Quotes
         */
        table = new PdfPTable(4);
        table.setWidthPercentage(90f);
        table.setHeaderRows(1);
        cellList = new ArrayList<PdfPCell>();
        newLine(document);
        document.add(new Paragraph("Flight Quotes", mediumFont));
        newLine(document);
        cellList.add(new PdfPCell(new Phrase("From", bold)));
        cellList.add(new PdfPCell(new Phrase("To", bold)));
        cellList.add(new PdfPCell(new Phrase("Airline", bold)));
        cellList.add(new PdfPCell(new Phrase("Cost Quoted", bold)));


        for (Flightquotes f : flights) {
            cellList.add(new PdfPCell(new Phrase(f.getFlightfromCity())));
            cellList.add(new PdfPCell(new Phrase(f.getFlighttoCity())));
            cellList.add(new PdfPCell(new Phrase(f.getQuotesource())));
            cellList.add(new PdfPCell(new Phrase(f.getCurrency() + " " + f.getQuotecost().toString())));
        }

        for (int i = 0; i < cellList.size(); i++) {
            table.addCell(cellList.get(i));
        }
        document.add(table);

        /**
         * Car Quotes
         */
        table = new PdfPTable(4);
        table.setWidthPercentage(90f);
        table.setHeaderRows(1);
        cellList = new ArrayList<PdfPCell>();
        newLine(document);
        document.add(new Paragraph("Flight Quotes", mediumFont));
        newLine(document);
        cellList.add(new PdfPCell(new Phrase("Collect Date", bold)));
        cellList.add(new PdfPCell(new Phrase("Return Date", bold)));
        cellList.add(new PdfPCell(new Phrase("Rental Company", bold)));
        cellList.add(new PdfPCell(new Phrase("Cost Quoted", bold)));


        for (Carquotes c : cars) {
            cellList.add(new PdfPCell(new Phrase(df.format(c.getDatecollect()))));
            cellList.add(new PdfPCell(new Phrase(df.format(c.getDatereturn()))));
            cellList.add(new PdfPCell(new Phrase(c.getProvider())));
            cellList.add(new PdfPCell(new Phrase(c.getCurrency() + " " + c.getQuotecost().toString())));
        }

        for (int i = 0; i < cellList.size(); i++) {
            table.addCell(cellList.get(i));
        }
        document.add(table);

        /**
         * Accommodation Quotes
         */
        table = new PdfPTable(5);
        table.setWidthPercentage(90f);
        table.setHeaderRows(1);
        cellList = new ArrayList<PdfPCell>();
        newLine(document);
        document.add(new Paragraph("Accomodation Quotes", mediumFont));
        newLine(document);
        cellList.add(new PdfPCell(new Phrase("Location", bold)));
        cellList.add(new PdfPCell(new Phrase("Checkin Date", bold)));
        cellList.add(new PdfPCell(new Phrase("Checkout Date", bold)));
        cellList.add(new PdfPCell(new Phrase("Hotel", bold)));
        cellList.add(new PdfPCell(new Phrase("Cost Quoted", bold)));


        for (Accomodationquotes a : hotels) {
            cellList.add(new PdfPCell(new Phrase(a.getCity())));
            cellList.add(new PdfPCell(new Phrase(df.format(a.getDatecheckin()))));
            cellList.add(new PdfPCell(new Phrase(df.format(a.getDatecheckout()))));
            cellList.add(new PdfPCell(new Phrase(a.getAccomodationprovider())));
            cellList.add(new PdfPCell(new Phrase(a.getCurrency() + " " + a.getQuotecost().toString())));
        }

        for (int i = 0; i < cellList.size(); i++) {
            table.addCell(cellList.get(i));
        }
View Full Code Here

        if (fit) {
            this.image = image;
            setPadding(borderWidth / 2);
        }
        else {
            column.addText(this.phrase = new Phrase(new Chunk(image, 0, 0, true)));
            setPadding(0);
        }
    }
View Full Code Here

     * @param chunk the text
     */
    public void addText(final Chunk chunk) {
        if (chunk == null || composite)
            return;
        addText(new Phrase(chunk));
    }
View Full Code Here

                yLine = compositeColumn.yLine;
                linesWritten += compositeColumn.linesWritten;
                descender = compositeColumn.descender;
                if (!Float.isNaN(compositeColumn.firstLineY) && !compositeColumn.firstLineYDone) {
                    if (!simulate)
                        showTextAligned(canvas, Element.ALIGN_LEFT, new Phrase(item.getListSymbol()), compositeColumn.leftX + listIndentation, compositeColumn.firstLineY, 0);
                    compositeColumn.firstLineYDone = true;
                }
                if ((status & NO_MORE_TEXT) != 0) {
                    compositeColumn = null;
                    ++listIdx;
View Full Code Here

            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();
View Full Code Here

    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");
View Full Code Here

   * @param fontStyle der Schrift-Style.
   * @return die erzeugte Zelle.
   */
  public PdfPCell getDetailCell(String text, int align, BaseColor backgroundColor, BaseColor textColor, int fontStyle)
  {
    PdfPCell cell = new PdfPCell(new Phrase(notNull(text), FontFactory.getFont(FontFactory.HELVETICA, 8, fontStyle, textColor != null ? textColor : BaseColor.BLACK)));
    cell.setHorizontalAlignment(align);
    cell.setBackgroundColor(backgroundColor != null ? backgroundColor : BaseColor.WHITE);
    return cell;
  }
View Full Code Here

   * @return die erzeugte Zelle.
   */
  public PdfPCell getDetailCell(double value)
  {
    Font f = FontFactory.getFont(FontFactory.HELVETICA, 8f, Font.NORMAL, value >= 0.01d ? BaseColor.BLACK : BaseColor.RED);
    PdfPCell cell = new PdfPCell(new Phrase(HBCI.DECIMALFORMAT.format(value), f));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    return cell;
  }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.Phrase

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.