Package com.lowagie.text

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


  public static void testRtfTable()
          throws DocumentException
  {
    Document document = new Document(new Rectangle(455, 600), 0, 0, 0, 0);
    RtfWriter2.getInstance(document, System.out);
    document.open();

    Table table = new Table (7, 2);
    boolean[][] occupiedCells = new boolean[7][2];
    float[] cellWidths = { 10, 10, 10, 10, 10, 10, 10 };
    table.setWidths(cellWidths);
View Full Code Here


    document.setPageSize(pageSize);
    document.setMargins(marginLeft, marginRight, marginTop, marginBottom);

    if (awaitOpenDocument)
    {
      document.open();
      awaitOpenDocument = false;
    }

    final PdfContentByte directContent = writer.getDirectContent();
    final Graphics2D graphics = new PdfGraphics2D(directContent, width, height, metaData);
View Full Code Here

    document.setPageSize(pageSize);
    document.setMargins(0, 0, 0, 0);

    if (awaitOpenDocument)
    {
      document.open();
      awaitOpenDocument = false;
    }

    final Graphics2D graphics = new PdfGraphics2D(writer.getDirectContent(), width, height, metaData);
    // and now process the box ..
View Full Code Here

                            if (inputCommand.getOutputPdfVersion() != null) {
                                pdfWriter.setPdfVersion(inputCommand.getOutputPdfVersion().charValue());
                            }
                            // step 3: we open the document
                            pdfDocument.addCreator(ConsoleServicesFacade.CREATOR);
                            pdfDocument.open();
                        }
                    }
                    // step 4: we add content
                    pdfReader.selectPages(boundsString);
                    pdfWriter.addDocument(pdfReader);
View Full Code Here

      // The mapView is not scaled to the document, we assume the mapView
      // has the right ratio.

      // Write document title and metadata
      document.open();
      PdfContext context = new PdfContext(writer);
      context.initSize(page.getBounds());
      // first pass of all children to calculate size
      page.calculateSize(context);
      if (resize) {
View Full Code Here

        page.getConstraint().setHeight(height);
        document = new Document(new Rectangle(width, height), 0, 0, 0, 0);
        writer = PdfWriter.getInstance(document, baos);
        // Render in correct colors for transparent rasters
        writer.setRgbTransparencyBlending(true);
        document.open();
        baos.reset();
        context = new PdfContext(writer);
        context.initSize(page.getBounds());
      }
      // Actual drawing
View Full Code Here

    PageFormat pageFormat = HomePrintableComponent.getPageFormat(this.home.getPrint());
    Document pdfDocument = new Document(new Rectangle((float)pageFormat.getWidth(), (float)pageFormat.getHeight()));
    try {
      // Get a PDF writer that will write to the given PDF output stream
      PdfWriter pdfWriter = PdfWriter.getInstance(pdfDocument, outputStream);
      pdfDocument.open();
     
      // Set PDF document description
      pdfDocument.addAuthor(System.getProperty("user.name", ""));
      String pdfDocumentCreator = this.preferences.getLocalizedString(
          HomePDFPrinter.class, "pdfDocument.creator");   
View Full Code Here

  public void export(FacesContext facesContext, DataTable table, String filename, boolean pageOnly, int[] excludeColumns, String encodingType, MethodExpression preProcessor, MethodExpression postProcessor) throws IOException {
    try {
          Document document = new Document(PageSize.A4.rotate());
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          PdfWriter.getInstance(document, baos);
          document.open();
         
          if(preProcessor != null) {
          preProcessor.invoke(facesContext.getELContext(), new Object[]{document});
        }
         
View Full Code Here

//          image.scaleAbsolute(100, 100);
//          image.setAbsolutePosition(450, 730);
//          writer.addDirectImageSimple(image);
//     
     
      doc.open();
       PdfPTable headerTable= new PdfPTable(2);
          Image ii = Image.getInstance("c:/smi-logo.gif");
          ii.setAlignment(Element.ALIGN_RIGHT);
          ii.scalePercent(25);
      
View Full Code Here

            pf.setPaper(paper);
            fmt.format(pf);
            Document document = new Document(new Rectangle(
                    (float) bounds.getWidth(), (float) bounds.getHeight()));
            PdfWriter writer = PdfWriter.getInstance(document, out);
            document.open();
            for (int i = 0; i < pageStore.getPageCount(); ++i) {
                document.newPage();
                PdfContentByte pcb = writer.getDirectContent();
                Graphics2D g = pcb.createGraphics(
                        (float) pf.getWidth(), (float) pf.getHeight());
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.