Package com.itextpdf.text

Examples of com.itextpdf.text.Document.open()


      dd.createNewFile();
     
      FileOutputStream f=new FileOutputStream(dd);
      Document document = new Document();
      PdfWriter.getInstance(document, f);
      document.open();
      addTitlePage(document);
      addContent(document);
      document.close();
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


      int endPage = end;
      if (endPage > pageCount) {
        endPage = pageCount;
      }

      document.open();

      for (int i = start; i <= endPage; i++) {
        PdfImportedPage page = writer.getImportedPage(reader, i);
        writer.addPage(page);
      }
View Full Code Here

      Document document = new Document();
      InputOutputStream outputStream = new InputOutputStream();
      PdfCopy writer = new PdfCopy(document, outputStream);

      document.open();

      for (InputStream source : sources) {
        PdfReader reader = new PdfReader(source);
        int pageCount = reader.getNumberOfPages();
        for (int i = 1; i <= pageCount; i++) {
View Full Code Here

    }

    Document document = new Document(size, 15, 15, 10, 10);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PdfWriter writer = PdfWriter.getInstance(document, baos);
    document.open();
    populatePdf(document, writer, qr);

    // do we want to add a svg image?
    if (StringUtils.isNotBlank(svg)) {
      document.newPage();
View Full Code Here

        String FilePath = sc.getRealPath("/");
        String outPath = (FilePath==null)?"temp/" + FNAME:FilePath + "temp/" + FNAME;
        String pathForJavaScript = "./" + "temp/" + FNAME;
        PdfWriter.getInstance(document, new FileOutputStream(outPath));
        // step 3
        document.open();
        // step 4
        document.add(new Paragraph("StrutsSchoolWeb - Random Multiplication Questions"));
        document.add(new Paragraph(new Date().toString()));
        document.add(Chunk.NEWLINE);
        //document.add(new Paragraph("Seq:"+seq));
View Full Code Here

        String FilePath = sc.getRealPath("/");
        String outPath = (FilePath==null)?"temp/" + FNAME:FilePath + "temp/" + FNAME;
        String pathForJavaScript = "./" + "temp/" + FNAME;
        PdfWriter.getInstance(document, new FileOutputStream(outPath));
        // step 3
        document.open();
        // step 4
        document.add(new Paragraph("StrutsSchoolWeb - Times Table"));
        document.add(new Paragraph(new Date().toString()));
        document.add(Chunk.NEWLINE);
View Full Code Here

        BeefReport.logo = logo ;
        String FILE = BeefReport.repportf  ;
      Document document = new Document();
      try {
      PdfWriter.getInstance(document, new FileOutputStream(FILE));
      document.open();
      BeefReport.addMetaData(document);
      BeefReport.addTitlePage(document);
      BeefReport.addContent(document);
      document.close();
    } catch (Exception e) {
View Full Code Here

        try {
            Document doc = new Document();

            PdfWriter.getInstance(doc, new FileOutputStream(new File(applyFileNameMasks(outputPath, ((ImportedImage) model.get(0))))));
            doc.open();
           
            for(int i=0; i<modelSize; i++){
           
                String filepath = ((ImportedImage) model.get(i)).getPath();
                if(getExtension(filepath).equalsIgnoreCase("pdf")){
View Full Code Here

        try {
            Document doc = new Document();
           
            PdfWriter.getInstance(doc, new FileOutputStream(new File(applyFileNameMasks(outputPath, importedImage))));
            doc.open();
           
            String filepath = importedImage.getPath();
            if (getExtension(filepath).equalsIgnoreCase("pdf")) {
                ArrayList<BufferedImage> extractedImages = (ArrayList<BufferedImage>) PDFToImage.getBImagesFromPDF(importedImage.getPath(), 1, Integer.MAX_VALUE);
                for (BufferedImage currentImage : extractedImages) {
View Full Code Here

        try {
          // First - create a single PDF page from the tiff page.
          Document document = new Document(PageSize.A4, 0.0f, 0.0f, 0.0f, 0.0f);
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          PdfWriter.getInstance(document, baos);
          document.open();
          document.add(img);
          document.close();

          // Second - read the memory based PDF file and read the image. Write
          // this into PNG file.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.