Package com.itextpdf.text

Examples of com.itextpdf.text.Document


       
        zuVersteuerndesEinkommen = bruttogehalt + sonstBezug - sonstAbzug;
        gesSteuerabzug = lohnsteuer + kirchensteuer + soli;
        gesSozialversicherungsabzug = krankenversicherung + pflegeversicherung + rentenversicherung + arbeitslosenversicherung;
       
        Document document = new Document(new Rectangle(PageSize.A4));
        document.setPageCount(1);
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(FILE));
        writer.setPageEvent(new PDFHeaderFooterWriter());
        document.open();
        addMetaData(document);
        addPage(document);
        document.close();
        Desktop.getDesktop().open(new File(FILE));
      } catch (Exception e){
        e.printStackTrace();
      }
    }
View Full Code Here


      }
    }
   
    public PDFExport(int[][] persAndAusgezID, String filePath, PDF whatsNext) throws DocumentException, InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException, MalformedURLException, IOException {
     
      Document document = new Document(new Rectangle(PageSize.A4));
      document.setPageCount(1);
      PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(filePath));
      writer.setPageEvent(new PDFHeaderFooterWriter());
      document.open();
      addMetaData(document);
     
      for(int i = 0; i < persAndAusgezID.length; i++){
        if(i > 0)
          document.newPage();
          ResultSet rs = DataMgr.getInstance().getResultSet("" +
              "SELECT "+
              ""+
              "`gehaltausgezahlt`.`BuchungsDat`, "+
              "`gehaltausgezahlt`.`GehBrutto`, "+
              "`gehaltausgezahlt`.`GehNetto`, "+
              "`gehaltausgezahlt`.`RVAN`, "+
              "`gehaltausgezahlt`.`KVAN`, "+
              "`gehaltausgezahlt`.`ALVAN`, "+
              "`gehaltausgezahlt`.`PVAN`, "+
              "`gehaltausgezahlt`.`RVANProz`, "+
              "`gehaltausgezahlt`.`KVANProz`, "+
              "`gehaltausgezahlt`.`ALVANProz`, "+
              "`gehaltausgezahlt`.`PVANProz`, "+
              "`gehaltausgezahlt`.`LSt`, "+
              "`gehaltausgezahlt`.`KiSt`, "+
              "`gehaltausgezahlt`.`Soli`, "+
              "`gehaltausgezahlt`.`sonstBezug`, "+
              "`gehaltausgezahlt`.`sonstAbzug`, "+
              ""+
              "`personen`.`Anrede`, "+
              "`personen`.`Nachname`, "+
              "`personen`.`Vorname`, "+
              "`personen`.`Strasse`, "+
              "`personen`.`GebDat`, "+
              "`personen`.`Kinder`, "+
              ""+
              "`plz_ort_vorwahl`.`Plz`, "+
              "`plz_ort_vorwahl`.`Ort`, "+
              "`plz_ort_vorwahl`.`Zusatz` AS OrtZusatz,"+
              ""+
              "`bundeslaender`.`Name` AS BundeslandName,"+
              "`bundeslaender`.`KiStSatz`,"+
              ""+
              "`krankenkasse`.`Name` AS KrankenkasseName,"+
              ""+
              "`religion`.`Name` AS ReligionName "+
              ""+
              "FROM (((`gehaltausgezahlt` "+
                "INNER JOIN `personen` "+
                  "ON(`gehaltausgezahlt`.`PersID` = `personen`.`PersID`)) "+
                "INNER JOIN `plz_ort_vorwahl` "+
                  "ON (`personen`.`PlzID` = `plz_ort_vorwahl`.`PlzID`)) "+
                "INNER JOIN `bundeslaender` "+
                  "ON (`plz_ort_vorwahl`.`BLID` = `bundeslaender`.`BLID`)) "+
                "INNER JOIN `krankenkasse`"+
                  "ON (`personen`.`KrKasseID` = `krankenkasse`.`KrKasseID`) "+
                "INNER JOIN `religion`"+
                  "ON (`personen`.`ReligionID` = `religion`.`ReligionID`) "+
                ""+
              "WHERE `gehaltausgezahlt`.`GehAusID` = '"+persAndAusgezID[i][0]+"' "+
                "AND `gehaltausgezahlt`.`PersID` = '"+persAndAusgezID[i][1]+"'");
 
         
          if(rs.next()){
            //gehaltausgezahlt
            date = rs.getDate("BuchungsDat");
            bruttogehalt = rs.getDouble("GehBrutto");
            nettogehalt = rs.getDouble("GehNetto");
            rentenversicherung = rs.getDouble("RVAN");
            krankenversicherung = rs.getDouble("KVAN");
            arbeitslosenversicherung = rs.getDouble("ALVAN");
            pflegeversicherung = rs.getDouble("PVAN");
            prozentRentenversicherung = rs.getDouble("RVANProz");
            prozentKrankenversicherung = rs.getDouble("KVANProz");
            prozentArbeitslosenversicherung = rs.getDouble("ALVANProz");
            prozentPflegeversicherung = rs.getDouble("PVANProz");
            lohnsteuer = rs.getDouble("LSt");
            kirchensteuer = rs.getDouble("KiSt");
            soli = rs.getDouble("Soli");
            sonstBezug = rs.getDouble("sonstBezug");
            sonstAbzug = rs.getDouble("sonstAbzug");
           
            //personen
            anrede = rs.getString("Anrede");
            nachname = rs.getString("Nachname");
            vorname = rs.getString("Vorname");
            strasse = rs.getString("Strasse");
            gebDate = rs.getDate("GebDat");
            kinder = rs.getDouble("Kinder");
           
            //plz_ort_vorwahl
            plz = rs.getString("Plz");
            ort = rs.getString("Ort")
             + rs.getString("OrtZusatz");
            
            //bundeslaender
            bundesland = rs.getString("BundeslandName");
            prozentKirchensteuer = rs.getDouble("KiStSatz");
           
            //krankenkasse
            krankenkasse = rs.getString("KrankenkasseName");
           
            //religion
            religion = rs.getString("ReligionName");
          }
          zuVersteuerndesEinkommen = bruttogehalt + sonstBezug - sonstAbzug;
          gesSteuerabzug = lohnsteuer + kirchensteuer + soli;
          gesSozialversicherungsabzug = krankenversicherung + pflegeversicherung + rentenversicherung + arbeitslosenversicherung;
        addPage(document);
      }
        document.close();
       
        if(whatsNext == PDF.ANZEIGEN || whatsNext == PDF.ANZEIGEN_DRUCKEN)
          Desktop.getDesktop().open(new File(filePath));
       
        if(whatsNext == PDF.DRUCKEN || whatsNext == PDF.ANZEIGEN_DRUCKEN)
View Full Code Here

    }
   
    public PDFExport() {
     
      try {
        Document document = new Document(new Rectangle(PageSize.A4));
        document.setPageCount(1);
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(FILE));
        writer.setPageEvent(new PDFHeaderFooterWriter());
        document.open();
        addMetaData(document);
        addPage(document);
        document.close();
        Desktop.getDesktop().open(new File(FILE));
      } catch (Exception e){
        e.printStackTrace();
      }
    }
View Full Code Here

   * Creates an instance of the concatenation class.
   * @param os  the OutputStream for the PDF document
   * @param smart  do we want PdfCopy to detect redundant content?
   */
  public PdfConcatenate(OutputStream os, boolean smart) throws DocumentException {
    document = new Document();
    if (smart)
      copy = new PdfSmartCopy(document, os);
    else
      copy = new PdfCopy(document, os)
  }
View Full Code Here

   * Creates an instance of the concatenation class.
   * @param os  the OutputStream for the PDF document
   * @param smart  do we want PdfCopy to detect redundant content?
   */
  public PdfConcatenate(OutputStream os, boolean smart) throws DocumentException {
    document = new Document();
    if (smart)
      copy = new PdfSmartCopy(document, os);
    else
      copy = new PdfCopy(document, os)
  }
View Full Code Here

    setRequiredGender(requiredGender);
  }

  public void run() {
    try {
      Document document = new Document();
      PdfWriter.getInstance(document, new FileOutputStream(file));
      document.open();
      addContent(document);
      document.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    setCompetitionTitle(competitionTitle);
  }

  public void run() {
    try {
      Document document = new Document(PageSize.A4.rotate());
      PdfWriter.getInstance(document, new FileOutputStream(file));
      document.open();
      addContent(document);
      document.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    setCompetitionTitle(competitionTitle);
  }

  public void run() {
    try {
      Document document = new Document();
      PdfWriter.getInstance(document, new FileOutputStream(file));
      document.open();
      addContent(document);
      document.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    PdfCopyFieldsImp(OutputStream os, char pdfVersion) throws DocumentException {
        super(new PdfDocument(), os);
        pdf.addWriter(this);
        if (pdfVersion != 0)
            super.setPdfVersion(pdfVersion);
        nd = new Document();
        nd.addDocListener(pdf);
    }
View Full Code Here

        {
            // Initialize the table with the appropriate number of columns
            initTable();

            // Initialize the Document and register it with PdfWriter listener and the OutputStream
            Document document = new Document(PageSize.A4.rotate(), 60, 60, 40, 40);
            document.addCreationDate();

            PdfWriter writer = PdfWriter.getInstance(document, out);
            writer.setPageEvent(new PdfPageEventHelper()
            {

                @Override
                public void onEndPage(PdfWriter writer, Document document)
                {

                    Rectangle rect = writer.getBoxSize("art");
                    ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER, new Phrase(
                        TagConstants.EMPTY_STRING,
                        smallFont), (rect.getLeft() + rect.getRight()) / 2, rect.getBottom() - 18, 0);

                }

            });

            // Fill the virtual PDF table with the necessary data
            generatePDFTable();

            document.open();
            document.add(this.tablePDF);
            document.close();

        }
        catch (Exception e)
        {
            throw new PdfGenerationException(e);
View Full Code Here

TOP

Related Classes of com.itextpdf.text.Document

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.