White Papers/API and Connectors

From Docs

Jump to: navigation, search

Get PDF

< DiType White Papers

DiType provides a rendering API and connectors for some popular programming languages. APIs for Java and C# provide new interfaces and legacy versions that are compatible with the current interfaces. The Java and C# APIs and Connectors are described in the following sections.

Contents

Universal Plugin Connector

Many interactive applications use DITYPE core uniformly. They

  • initiate a session,
  • set formatting options,
  • repeatedly send documents for formatting,
  • retrieve formatting log and display it to the user while the formatting goes on.

Instead of reimplementing the same algorithms in each program, a Universal Plugin Connector is introduced. A prototype version of *UPC* is currently used to run the Web Demo, a web-based AJAX-enriched formatter application with interface similar to that of XEP assistant.

UPC provides the calls via XML-RPC, the protocol used in AJAX and inside DITYPE core, a robust way to interconnect pieces of a program written using diverse technologies and even running on different computers. Applications connect to UPC and use it as a proxy to format documents and receive formatting logs. An application becomes an XML-RPC client, a simple role supported by well-developed libraries in most programming languages and environments.


Java API and Connectors

DiType provides a number of Java APIs that allow you to write your own code in Java to process XSL-FO and XML documents in multiple environments. The Java APIs and Connectors include a servlet component and an Ant connector.

Java APIs and Connectors include the following:

  • Ditype Java API documentation and DiType Java references.
  • An example of Ditype usage in command line application. The example illustrates how to call Ditype to process SAX input.
  • Readily deployed servlet component with complete source code.
  • Ant connector with complete source code.
  • jEdit plug-in with complete source code.
  • <oXygen/> XML Editor plug-in with complete source code.
  • Cocoon connector with complete source code.

Servlet Component

The servlet component provides the ability to use the DiType formatter for implementing web-applications. With the servlet component, it is possible to do the following:

  • Design electronic libraries where all the books are stored on the server in XML/XSL format. Each e-library user has the opportunity to download any book in either PDF or PostScript format.
  • Design a web service where each user can upload an XML/XSL-FO document to the server, or specify the URL of the document, and download the PDF or PostScript output.

Ant Connector

Apache Ant is a Java-based build tool used for automating software build processes, and is popular among java-programmers. It is similar to make but is written in the Java language and extended using Java classes.

Of course, a significant part of every project is good documentation. DiType Ant component gives an opportunity to create a task, which can format XML documents to a printable format - PDF or PostScript.

jEdit connector

jEdit is a mature programmer's text editor. jEdit is written in Java and runs on Windows, Linux, Mac OS X and a number of other operating systems. The product is available under the GNU General Public License. There are dozens of plug-ins for numerous application areas. All this makes it the most commonly used among java developers.

jEdit connector is jEdit plug-in, which gives an opportunity to format XML documents directly from the editor.

<oXygen/> XML Editor connector

The simple look of the <oXygen/> XML Editor combined with the complete coverage of the XML editing features have made it popular in both the corporate and academic worlds. It provides the necessary tools for the document creation and presentation.

oXygen connector is plug-in, which gives an opportunity to format XML documents directly from the editor by choosing "Plugins->Ditype" from context menu.

Apache Cocoon connector

Apache Cocoon is a web development framework built around the concepts of pipeline, separation of concerns and component-based web development. The framework focuses on XML and XSLT publishing and is built using the Java programming language.

DiType Connector for Apache Cocoon is a PDF/PostScript/XEP serializer for Cocoon. It generates PDF, PostScript or XEP documents from XML/XSL Formatting Objects instances.

Enterprise Java Beans

This component contains a Java Enterprise Bean wrapper for DiType. The bean runs on a remote computer in a Java application server; clients connect to the bean, call its methods to format XSL FO document and receive the formatting results over the network.


C# API and Connectors

DiType provides a C# API, which is a.Net based library that allows you to write your own code in the.Net environment to process XSL-FO and XML documents. The.Net API includes the following:

  • RenderX.DiType.dll : The.Net assembly. The assembly is strongly named and can be installed to the %SYSTEMROOT%\assembly directory.
  • DiType.Net API source code.
  • DiType.Net API documentation.
  • Examples directory containing sources and binaries of examples written in C# and VB.Net.
  • build.proj : An MSBuild project file to build from the sources.

DiType.NET provides two-level API for document processing via DiType Formatter. The first level is DiType Cliser Client implementation for .NET environment. There are 4 common steps to format documents with Client usage:

  1. Creating Client instance;
  2. Connecting to the server;
  3. Formatting multiple documents via the client instance;
  4. Shutting down the client.

The Client instance connects to DiType server at localhost:19790. You may need to change this value if your DiType server is launched on another computer or is using another port. To change the default values simply set DITYPE_HOST and DITYPE_DATA_PORT environment variables to desired values.

The second level of DiType .NET API is based on the first level and provides simple interface for document processing - create a formatter instance and format documents.


C API and Connectors

This package includes:

  • C API source code.
  • C API documentation.
  • Examples directory containing sources and binaries of examples written in C.
  • Files to build from sources

C++ API and Connectors

This package includes:

  • C++ API source code.
  • C++ API documentation.
  • Examples directory containing sources and binaries of examples written in C++.
  • Files to build from sources

Python API and Connectors

Python API provides high-level API for document processing via DiType Formatter.

Package contents:

  • source code.
  • API documentation.
  • Example (see diclick.py).

Python API uncludes the following modules:

  • diclient.py - client side CLISER-protocol implementation.
  • formatter.py - interface to DiType formatting engine
  • logger.py - reference implementation for processing log events.

Angelina Andriasyan

Personal tools