Home
Categories
Dictionnary
Download
Project Details
Changes Log
FAQ
License

EPS driver


    1  Dependencies
    2  EPSDriverUtils Utility class
       2.1  Adding a title to the EPS document
    3  Usage example

The EPS driver allows to serialize JavaFX content as an Encapsulated Postcript file.

Dependencies

You should use the jfxConverter-eps.jar in addition to the jfxConverter.jar. Note that the PowerPoint driver uses any version of the jlibeps library.

Note that several versions of the jlibeps library exist: The last version is the one which is used for the moment, but the EPS converter will work with any of these versions.

EPSDriverUtils Utility class

The EPSDriverUtils encapsulate the usage of the converter. for example:

      EPSDriverUtils epsUtils = new PPTDriverUtils();
      epsUtils.convert(node, file);      

Adding a title to the EPS document

A title will be added to the output EPS file by default, but it is possible to specify it by using:
      EPSDriverUtils epsUtils = new EPSDriverUtils();
      epsUtils.convert(node, title, file);      

Usage example

      // create the Scene graph
      JFXInvoker invoker = JFXInvoker.getInstance();
      invoker.invokeBlocking(new Runnable() {
        @Override
        public void run() {
          StackPane root = new StackPane();
          Scene scene = new Scene(root, 300, 250);
          Stage stage = new Stage();
          stage.setScene(scene);
          start(stage);
      
          Line line = new Line(0, 0, 200, 200);
          line.setStroke(Color.RED);     
         
          root.getChildren().add(line);
          primaryStage.show();
        }
      });
      
      // perform the conversion
      EPSDriverUtils epsUtils = new EPSDriverUtils();
      epsUtils.convert(node, file);


Categories: drivers

Copyright 2016-2018 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence