Package org.apache.xmlgraphics.java2d.ps

Examples of org.apache.xmlgraphics.java2d.ps.EPSDocumentGraphics2D.drawString()


            g2d.setColor(Color.RED);
            g2d.setFont(new Font("sans-serif", Font.PLAIN, 36));
            g2d.drawString("Hello world!", 140, 140);
            g2d.setColor(Color.RED.darker());
            g2d.setFont(new Font("serif", Font.PLAIN, 36));
            g2d.drawString("Hello world!", 140, 180);

            //Cleanup
            g2d.finish();
        } finally {
            IOUtils.closeQuietly(out);
View Full Code Here


      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();
      out.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

      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();
      out.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
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.