ScroogeXHTML for the Java™ platform 6.2.0 – fast RTF to HTML5 and XHTML conversion

Habarisoft released version 6.2.0 of its RTF to HTML5 and XHTML converter library, ScroogeXHTML for the Java™ platform. The new version resolves 3 bugs and introduces 3 enhancements and new features, including support for table row height and text format changes within hyperlinks.

You can evaluate the new release with the online converter demo, which displays the configuration property values of the converter, and allows to modify many of them.

scrooge_portrait_logo_2016

 

ScroogeXHTML for the Java™ platform 6.1.0 – fast RTF to HTML5 and XHTML conversion

Habarisoft released version 6.1.0 of its RTF to HTML5 and XHTML converter library, ScroogeXHTML for the Java™ platform. The new version resolves 2 bugs and introduces 4 enhancements and new features, including support for table row height and text format changes within hyperlinks.

You can evaluate the new release with the online converter demo, which displays the configuration property values of the converter, and allows to modify many of them.

scrooge_portrait_logo_2016

 

ScroogeXHTML 6.0.1: merged table cells, Android™ platform support

Habarisoft released version 6.0.1 of its RTF to HTML5 and XHTML converter library, ScroogeXHTML for the Java™ platform. This version adds merged cell support for RTF table conversion, and easier usage on the Android platform.

Unbenannt

A short introduction to major changes is available on the ScroogeXHTML home page, in the Getting Started (PDF documentation), in the API documentation, and in this blog post.

You can evaluate the final release with the online converter demo, which now displays the configuration property values of the converter, and allows to modify many of them.

scrooge_portrait_logo_2016

 

ScroogeXHTML for the Java™ platform 6.0 – fast RTF to HTML5 conversion

Habarisoft released version 6.0 of its RTF to HTML5 and XHTML converter library, ScroogeXHTML for the Java™ platform.

The new major version resolves 5 bugs and introduces more than 30 enhancements and new features.

A short introduction to major changes is available on the ScroogeXHTML home page, in the Getting Started (PDF documentation), in the API documentation, and in this blog post.

You can evaluate the final release with the online converter demo, which now displays the configuration property values of the converter, and allows to modify many of them.

Bildschirmfoto am 2016-07-01 um 09.37.29

ScroogeXHTML for the Java™ platform 6.0: new features

The upcoming 6.0 release of ScroogeXHTML for the Java™ platform introduces useful new features. Here is a short overview:

Embedding images with HTML Data URI scheme

The traditional MemoryPictureAdapter class in ScroogeXHTML for the Java platform generates image link elements which point to a resource location <img src=”…”>. This keeps the document small, but requires making the image resources accessible for the web browser at the given location.

In some cases however, it is useful to embed the whole image in-line in the web page as if they were external resources.

The new MemoryPictureAdapterBase64 class returns Data URIs for small JPEG and PNG images. By default, the size threshold is set to 32 kB.

Usage example:

scrooge = new ScroogeXHTML();
scrooge.setConvertPictures(true);
PictureAdapter adapter = new MemoryPictureAdapterBase64();
scrooge.setPictureAdapter(adapter);

The new class inherits from the old MemoryPictureAdapter, and will return the inherited result for images which exceed the size limit.

Data URIs are fully supported by most major browsers, and partially supported in Internet Explorer and Microsoft Edge.

Event listeners for DOM post processing

The converter internally uses a XML DOM tree to create the HTML document structure. Before converting the DOM to the result HTML5 String, the converter calls a sequence of post processing handlers, which apply optimizations and custom modifications on the DOM tree. Post processing handlers must implement the PostProcessListener interface.

The converter stores the event handlers in its PostProcessListeners property which is a list of PostProcessListener implementations. By default, the converter library creates and assigns post process handlers to perform these tasks

  • strip empty (whitespace-only) text nodes
  • strip empty span nodes
  • strip attribute-less span nodes
  • replace empty paragraph (<p>) nodes with <br> nodes

These default PostProcessListener implementations are located in the com.habarisoft.scroogexhtml.tidy package and use XPath to perform the DOM modification (see Stack Overflow example code).

Application code may create and add more post process listeners as needed.

On-line demo

The new demo page https://www.scroogexhtml.com/sxd6snap/ allows to upload and convert RTF files.

scrooge_portrait_logo_2016

ScroogeXHTML for the Java™ platform 6.0 – RTF to HTML5 converter preview

Habarisoft released the first public preview of version 6.0 of its RTF to HTML5 converter library, ScroogeXHTML for the Java™ platform.

Major changes

  • only HTML5 and XHTML will be supported  – for other markup language versions, ScroogeXHTML 5.X is still available
  • new DOM based post processing event listeners
  • new support for embedded JPEG and PNG images with HTML Data URI scheme
  • improved support for RTF tables
  • improved support for monospace fonts
  • improved conversion of \footnote
  • improved support for \listtable (paragraph numbering)

Continue reading “ScroogeXHTML for the Java™ platform 6.0 – RTF to HTML5 converter preview”

Query ActiveMQ Broker Statistics with Delphi

Broker Configuration

To configure ActiveMQ to use the statistics plugin add the following to the ActiveMQ XML configuration:

<plugins>
  <statisticsBrokerPlugin/>
</plugins>

The statistics plugin looks for messages sent to particular destinations.

Query running broker statistics

To query the running statistics of the message broker, the client sends an empty message to a Destination named ActiveMQ.Statistics.Broker, and sets the replyto field with the Destination you want to receive the result on. The statistics plugin will send a  MapMessage filled with the statistics for the running ActiveMQ broker.

Source code

program DestStatistics;

(**
  Requires ActiveMQ 5.3 or higher
  To configure ActiveMQ to use the statistics plugin, add the following to the ActiveMQ XML configuration:
  <broker>
  ...
    <plugins>
      <statisticsBrokerPlugin/>
    </plugins>
  ...
  </broker>

  Usage:
  ------
  DestStatistics [destination]
  If no destination is specified, the program returns the broker statistics

  Reference
  ---------
  http://activemq.apache.org/statisticsplugin.html
  https://issues.apache.org/activemq/browse/AMQ-2379
  http://rajdavies.blogspot.com/2009/10/query-statistics-for-apache-activemq.html

  You can also use wildcards too, and receive a separate message for every destination matched.
*)

{$APPTYPE CONSOLE}

uses
  SysUtils,
  BTCommAdapterIndy, BTMessageTransformerXMLMapOmni,
  BTJMSInterfaces, BTJMSConnection, BTSessionIntf, BTSerialIntf,
  BTStompTypes, BTTypes,
  Classes;

var
  Connection: IConnection;
  Session: ISession;
  Producer: IMessageProducer;
  Consumer: IMessageConsumer;
  Destination, ReplyQueue: IQueue;
  JMSMessage: ITextMessage;
  Reply: IMapMessage;
  MapNames: PMStrings;
  I: Integer;
  Key: string;

begin
  Connection := TBTJMSConnection.MakeConnection;
  try
    try
      // Create and assign the message transformer
      SetTransformer(Connection, TBTMessageTransformerXMLMapOmni.Create(nil));

      Connection.Start;
      Session := Connection.CreateSession(False, amAutoAcknowledge);

      // listen on reply queue
      ReplyQueue := Session.CreateQueue('Habari' + '?' +
        BTStompTypes.SH_TRANSFORMATION + '=' + TRANSFORMER_ID_MAP_XML);
      Consumer := Session.CreateConsumer(ReplyQueue);

      // create the pseudo destination
      if ParamCount = 0 then
      begin
        Destination := Session.CreateQueue('ActiveMQ.Statistics.Broker');
      end
      else
      begin
        Destination := Session.CreateQueue('ActiveMQ.Statistics.Destination.' + ParamStr(1));
      end;

      // display destination name
      WriteLn('Request statistics for ' + Destination.QueueName + ' ...');

      // create the message and set reply queue name
      JMSMessage := Session.CreateTextMessage;
      JMSMessage.JMSReplyTo := ReplyQueue;
      Producer := Session.CreateProducer(Destination);
      Producer.Send(JMSMessage);

      // read the result message
      Reply := Consumer.Receive(1000) as IMapMessage;

      // list the map key/values
      while Assigned(Reply) do
      begin
        MapNames := Reply.GetMapNames;
        for I := 0 to Length(MapNames) - 1 do
        begin
          Key := MapNames[I];
          WriteLn(Key + '=' + Reply.GetString(Key));
        end;
        WriteLn;
        Reply := Consumer.Receive(1000) as IMapMessage;
      end;

      WriteLn('No more message on queue ' + ReplyQueue.QueueName);

      Connection.Stop;

    except
      on E: Exception do
        WriteLn(E.Message);
    end;
  finally
    Connection.Close;
  end;

  WriteLn('Press any key');
  ReadLn;
end.

 


Query Statistics for Apache ActiveMQ with Delphi

Habari Client Libraries for Delphi and Free Pascal – new releases

4. December 2013 – New versions of all Habari message broker client libraries are available. The new release of Habari Client libraries is mainly a maintenance release. The new library versions are:

  • Habari Client for ActiveMQ 3.6 (tested with ActiveMQ version 5.9.0)
  • Habari Client for Apollo 1.6 (tested with Apollo version 1.6)
  • Habari Client for HornetQ 2.2 (tested with HornetQ version 2.3.1)
  • Habari Client for OpenMQ 2.6 (tested with OpenMQ version 5.0.1)
  • Habari Client for RabbitMQ 1.8 (tested with RabbitMQ version 3.2.1)

This release fixes several bugs and warnings. For a full list of changes please check the “Getting Started” documentation. More information, demo downloads, example code and the complete API reference are available on-line.

With Habari Client libraries, Delphi and Free Pascal developers can take advantage of message broker technology, which is distributed, loosely coupled, reliable and asynchronous, to build integrated systems, connecting clients using the peer-to-peer or the publish-and-subscribe communication model.

Habari Client Libraries

Habari Client Libraries for Delphi and Free Pascal – new releases

New versions of all Habari message broker client libraries is available. The new release of Habari Client libraries introduces new features, including improved Free Pascal support:

  • New: Remote Procedure Call (RPC) demo program
  • New: Heart-beating tests using built-in STOMP server
  • New: Connection parameter “subscribe.receipt” to request and verify broker confirmations for subscriptions
  • New: Connection pool example implementation with demo project
  • New: Tested with Free Pascal 2.6.2
  • New: Tested with Indy 10.6
  • New: Support for mixed compiler modes with Free Pascal
  • Improved: ESynapseError exceptions will be re-raised from Receive operations

With Habari Client libraries, Delphi and Free Pascal developers can take advantage of message broker technology, which is distributed, loosely coupled, reliable and asynchronous, to build integrated systems, connecting clients using the peer-to-peer or the publish-and-subscribe communication model.

Habari Client libraries provide access to enterprise quality messaging solutions. Supported message brokers include Apache ActiveMQ, Apollo, HornetQ, Open MQ, and RabbitMQ.

Habari Client Libraries