Package org.pdfclown.documents.contents.composition

Examples of org.pdfclown.documents.contents.composition.BlockComposer.showText()


      StandardType1Font.FamilyEnum.Times,
      true,
      false
      );
    composer.setFont(titleFont,48);
    blockComposer.showText("Welcome"); blockComposer.showBreak();
    StandardType1Font bodyFont = new StandardType1Font(
      document,
      StandardType1Font.FamilyEnum.Times,
      false,
      false
View Full Code Here


      StandardType1Font.FamilyEnum.Times,
      false,
      false
      );
    composer.setFont(bodyFont,16);
    blockComposer.showText("This is an on-the-fly servlet-driven PDF sample document generated by PDF Clown for Java.");
    blockComposer.end();

    // Move past the closed block!
    frame.y = blockComposer.getBoundBox().getMaxY() + 30;
    frame.height -= (blockComposer.getBoundBox().getHeight() + 30);
View Full Code Here

    if(image == null)
    {
      blockComposer.begin(frame,AlignmentXEnum.Left,AlignmentYEnum.Top);
      composer.setFont(bodyFont,12);
      composer.setFillColor(new DeviceRGBColor(1,0,0));
      blockComposer.showText("The file you uploaded wasn't a valid JPEG image!");
      blockComposer.end();

      // Move past the closed block!
      frame.y = blockComposer.getBoundBox().getMaxY() + 20;
      frame.height -= (blockComposer.getBoundBox().getHeight() + 20);
View Full Code Here

    }
    else
    {
      blockComposer.begin(frame,AlignmentXEnum.Left,AlignmentYEnum.Top);
      composer.setFont(bodyFont,12);
      blockComposer.showText("Here it is the image you uploaded: ");
      blockComposer.end();

      // Move past the closed block!
      frame.y = blockComposer.getBoundBox().getMaxY() + 20;
      frame.height -= (blockComposer.getBoundBox().getHeight() + 20);
View Full Code Here

          false,
          false
          ),
        7
        );
      blockComposer.showText(comment);
      blockComposer.end();
    }

    composer.flush();
  }
View Full Code Here

        );
    }
    catch(Exception e)
    {}
    composer.setFillColor(new DeviceRGBColor(115f/255,164f/255,232f/255));
    blockComposer.showText("showText() methods return the actual bounding box of the shown text, allowing to precisely determine its location on the page.");
    blockComposer.end();

    composer.setStrokeColor(new DeviceRGBColor(115f/255,164f/255,232f/255));

    // 3. Inserting contents...
View Full Code Here

    Font decorativeFont = Font.get(
      document,
      getInputPath() + java.io.File.separator + "fonts" + java.io.File.separator + "Ruritania-Outline.ttf"
      );
    composer.setFont(decorativeFont,56);
    blockComposer.showText("Chapter 1");
    blockComposer.showBreak();
    composer.setFont(decorativeFont,32);
    blockComposer.showText("Down the Rabbit-Hole");
    // End the title block!
    blockComposer.end();
View Full Code Here

      );
    composer.setFont(decorativeFont,56);
    blockComposer.showText("Chapter 1");
    blockComposer.showBreak();
    composer.setFont(decorativeFont,32);
    blockComposer.showText("Down the Rabbit-Hole");
    // End the title block!
    blockComposer.end();

    // Update the block frame to begin after the title!
    frame = new Rectangle2D.Double(
View Full Code Here

      getInputPath() + java.io.File.separator + "fonts" + java.io.File.separator + "TravelingTypewriter.otf"
      );
    composer.setFont(bodyFont,14);
    composer.beginLocalState();
    composer.setFont(decorativeFont,28);
    blockComposer.showText("A");
    composer.end();
    blockComposer.showText("lice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, 'and what is the use of a book,' thought Alice 'without pictures or conversation?'");
    // Define new-paragraph first-line offset!
    Dimension breakSize = new Dimension(24,8); // Indentation (24pt) and top margin (8pt).
    // Begin a new paragraph!
View Full Code Here

    composer.setFont(bodyFont,14);
    composer.beginLocalState();
    composer.setFont(decorativeFont,28);
    blockComposer.showText("A");
    composer.end();
    blockComposer.showText("lice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, 'and what is the use of a book,' thought Alice 'without pictures or conversation?'");
    // Define new-paragraph first-line offset!
    Dimension breakSize = new Dimension(24,8); // Indentation (24pt) and top margin (8pt).
    // Begin a new paragraph!
    blockComposer.showBreak(breakSize);
    blockComposer.showText("So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her.");
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.