Package org.apache.xmlgraphics.java2d

Examples of org.apache.xmlgraphics.java2d.GraphicContext


        boolean painted = false;
        ByteArrayOutputStream baout = new ByteArrayOutputStream();
        PCLGenerator tempGen = new PCLGenerator(baout, gen.getMaximumBitmapResolution());
        try {
            GraphicContext ctx = (GraphicContext)pclContext.getGraphicContext().clone();

            AffineTransform prepareHPGL2 = new AffineTransform();
            prepareHPGL2.scale(0.001, 0.001);
            ctx.setTransform(prepareHPGL2);

            PCLGraphics2D graphics = new PCLGraphics2D(tempGen);
            graphics.setGraphicContext(ctx);
            graphics.setClippingDisabled(false /*pclContext.isClippingDisabled()*/);
            Rectangle2D area = new Rectangle2D.Double(
View Full Code Here


        PDFResources res = pdfDoc.getFactory().makeResources();
        PDFResourceContext context = new PDFResourceContext(res);
        PDFGraphics2D pattGraphic = new PDFGraphics2D(textAsShapes, fontInfo,
                                        pdfDoc, context, pageRef,
                                        "", 0);
        pattGraphic.setGraphicContext(new GraphicContext());
        pattGraphic.gc.validateTransformStack();
        pattGraphic.setRenderingHints(this.getRenderingHints());
        pattGraphic.setOutputStream(outputStream);

        GraphicsNode gn = pp.getGraphicsNode();
View Full Code Here

        root = builder.build(ctx, doc);
        ctx = null;
        builder = null;

        final PSGraphics2D graphics = new PSGraphics2D(false, cos, this.getLogger());
        graphics.setGraphicContext(new GraphicContext());
        root.paint(graphics);
    }
View Full Code Here

        PDFResources res = pdfDoc.getFactory().makeResources();
        PDFResourceContext context = new PDFResourceContext(res);
        PDFGraphics2D pattGraphic = new PDFGraphics2D(textAsShapes, specialFontInfo,
                                        pdfDoc, context, getPageReference(),
                                        "", 0);
        pattGraphic.setGraphicContext(new GraphicContext());
        pattGraphic.gc.validateTransformStack();
        pattGraphic.setRenderingHints(this.getRenderingHints());
        pattGraphic.setOutputStream(outputStream);

        GraphicsNode gn = pp.getGraphicsNode();
View Full Code Here

      FontInfo fontInfo = PDFDocumentGraphics2DConfigurator.createFontInfo(c, false);

      OutputStream out = new FileOutputStream("example_eps.eps");
      EPSDocumentGraphics2D g2d = new EPSDocumentGraphics2D(false);
      g2d.setGraphicContext(new GraphicContext());
      g2d.setCustomTextHandler(new NativeTextHandler(g2d, fontInfo));
      g2d.setupDocument(out, 200, 100);
      g2d.setFont(new Font("Arial", Font.PLAIN, 12));
      g2d.drawString("Hi there Arial", 50, 50);
      g2d.finish();
View Full Code Here

   */
  public static void main(String[] args) {
    try {
      OutputStream out = new FileOutputStream("example_eps_simple.eps");
      EPSDocumentGraphics2D g2d = new EPSDocumentGraphics2D(false);
      g2d.setGraphicContext(new GraphicContext());
      g2d.setCustomTextHandler(new NativeTextHandler(g2d, null));
      g2d.setupDocument(out, 200, 100);
      g2d.setFont(new Font("Helvetica", Font.PLAIN, 12));
      g2d.drawString("Hi there Helvetica", 50, 50);
      g2d.finish();
View Full Code Here

TOP

Related Classes of org.apache.xmlgraphics.java2d.GraphicContext

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.