Monthly Archives: February 2006

Multithreaded Html to Image

Html snapshot ActiveX is a thread safe COM component. It uses single apartment COM threading model. So if you want to use multiple instances of html snapshot in several threads, you can create work threads and in each work thread create the html snapshot object, then you can convert html to image in the threads.

 

html to fax with html snapshot

Some people may want to fax a html document in their application. First it is necessary to convert the html document into image that the fax driver can understand. Fax machines typically support TIFF format which supports multiple encoding scheme. Html Snapshot has full support for TIFF encoding. It supports LZW, CCITT3, CCITT4 and RLE (Pack bits) encoding. So you can easily convert a html document into fax compatible TIFF file with Html Snapshot.

 

If you are using Windows Faxing Service to send a fax, remember that it has some special requirements on the TIFF file.

The fax service will accept a TIFF file for transmission if it has the following properties:

  • Compression is either 1 (no compression) or 4 (CCITT Group 4 fax encoding)
  • Image width is 1728 pixels
  • X-Resolution < = 204dpi and Y-Resolution <= 200dpi
  • All the pages have the same Y-resolution

 There is a detailed html to TIFF demo in the trial version of html snapshot. you can find it under demovbscripttifftest.vbs. Feel free to drop us an email if you have other questions.

 

 

Text to speech in IIS

Some customers want to convert text to audio in web sites with Active TTS. They may use ASP, ASP.Net as program languages and use IIS as the web server.

If they query the voice installed on the system in such script languages, they will find there are only SAPI4 voices listed. The reason behind it is that SAPI5 voices needs more privilege than the normal IIS user account. IIS has its special account management. It is possible to set the account in IIS to use SAPI5 voices. You can refer to html to image in IIS for some ideas. But here I am suggesting an alternative way.

We have provided a TTSService demo in the trial version of Active TTS. It is a win32 service program. The work flow is:

1. TTS Service is started when windows starts. It runs at background with a SYSTEM or administrator account.  It listens to a private port for local HTTP connection.

2. In ASP or ASP.Net, handle the http request from web user. Compose the text that is to be converted to audio. Save the text to a local disk file. Send the text file name and the audio file name in a HTTP request to the port TTS Services listens to.

3. TTS Service reads the file name and converts the text into audio with the help of Active TTS object. The audio will be saved into the audio file name embedded in the HTTP request.

4. ASP or ASP.Net send response to the web user to tell the conversion is completed.

We can provide TTSService source codes to those who are interested. It is written in Delphi. For those who don’t program in Delphi, it is still useful to refer to it for understanding the ideas.

 

eee.jpg