Package com.lowagie.text

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


        try {
            Document document = new Document(PageSize.A4, 50, 50, 50, 50);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            PdfWriter writer = PdfWriter.getInstance(document, baos);
            writer.setPageEvent(new PDFEventListener());
            document.open();


            Paragraph p = new Paragraph(
                LocaleUtils.getLocalizedString("archive.search.pdf.title", "monitoring"),
                FontFactory.getFont(FontFactory.HELVETICA,
View Full Code Here


            setCompressionSettingOnWriter(inputCommand, pdfWriter);

            // set pdf version
            setPdfVersionSettingOnWriter(inputCommand, pdfWriter, Character.valueOf(pdfReader.getPdfVersion()));

            currentDocument.open();
            PdfImportedPage importedPage = pdfWriter.getImportedPage(pdfReader, currentPage);
            pdfWriter.addPage(importedPage);
            currentDocument.close();
            FileUtility.renameTemporaryFile(tmpFile, outFile, inputCommand.isOverwrite());
            LOG.debug("File " + outFile.getCanonicalPath() + " created.");
View Full Code Here

                currentDocument.addCreator(ConsoleServicesFacade.CREATOR);

                setCompressionSettingOnWriter(inputCommand, pdfWriter);
                setPdfVersionSettingOnWriter(inputCommand, pdfWriter, Character.valueOf(pdfReader.getPdfVersion()));

                currentDocument.open();
            }
            importedPage = pdfWriter.getImportedPage(pdfReader, currentPage);
            pdfWriter.addPage(importedPage);
            // if it's time to close the document
            if ((isTimeToClose) || (currentPage == n)
View Full Code Here

                currentDocument.addCreator(ConsoleServicesFacade.CREATOR);

                setCompressionSettingOnWriter(inputCommand, pdfWriter);
                setPdfVersionSettingOnWriter(inputCommand, pdfWriter, Character.valueOf(pdfReader.getPdfVersion()));

                currentDocument.open();
            }

            importedPage = pdfWriter.getImportedPage(pdfReader, currentPage);
            pdfWriter.addPage(importedPage);
View Full Code Here

                currentDocument.addCreator(ConsoleServicesFacade.CREATOR);

                setCompressionSettingOnWriter(inputCommand, pdfWriter);
                setPdfVersionSettingOnWriter(inputCommand, pdfWriter, Character.valueOf(pdfReader.getPdfVersion()));

                currentDocument.open();
            }

            importedPage = pdfWriter.getImportedPage(pdfReader, currentPage);
            pdfWriter.addPage(importedPage);
            // if it's time to close the document
View Full Code Here

              //set pdf version
        setPdfVersionSettingOnWriter(inputCommand, pdfWriter, Character.valueOf(pdfReader.getPdfVersion()));
           
        //set creator
            currentDocument.addCreator(ConsoleServicesFacade.CREATOR);
            currentDocument.open();
           
        for (int count = 1; count <= n; count++) {
          pdfWriter.addPage(pdfWriter.getImportedPage(pdfReader, count));                               
              }
        pdfReader.close();
View Full Code Here

                setPdfVersionSettingOnWriter(inputCommand, pdfWriter);
                setCompressionSettingOnWriter(inputCommand, pdfWriter);

                pdfDocument.addCreator(ConsoleServicesFacade.CREATOR);
                pdfDocument.open();

                PdfImportedPage page;

                boolean finished1 = false;
                boolean finished2 = false;
View Full Code Here

          if (preProcessor != null) {
          preProcessor.invoke(context.getELContext(), new Object[]{document});
        }

            if (!document.isOpen()) {
                document.open();
            }
         
        document.add(exportPDFTable(context, table, pageOnly, selectionOnly, encodingType));
       
        if(postProcessor != null) {
View Full Code Here

    // 打开rtf文档
    Document document = new Document();
    FileOutputStream myFile = new FileOutputStream(filePath);
    RtfWriter2 rtfWriter2 = RtfWriter2.getInstance(document, myFile);
    document.open();
    // TODO 加文档标题,即项目名 有待居中
    RtfFont projectNameFont = new RtfFont("Arial", 35, RtfFont.STYLE_BOLD);
    Paragraph paragraph = new Paragraph();
    // Use the RtfFonts when creating the text.
    paragraph.add(new Chunk(projectName, projectNameFont));
View Full Code Here

    // Apply preferences and build metadata.
    prepareWriter(model, writer, request);
    buildPdfMetadata(model, document, request);

    // Build PDF document.
    document.open();
    buildPdfDocument(model, document, writer, request, response);
    document.close();

    // Write content type and also length (determined via byte array).
    response.setContentType(getContentType());
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.