Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.

New tutorial videos released

Blogged by Björn Meyer on September 08, 2008 and tagged with .NET, Video, Tutorial.

Recently, we released two new tutorial videos that show how TX Text Control .NET Server and TX Text Control .NET can be easily integrated into an ASP.NET web application and Windows Forms application, respectively.

You can watch these videos directly on our website:

 

Is the current input position currently visible?

Blogged by Björn Meyer on September 04, 2008 and tagged with .NET, Sample, Input Position, Scrolling.

I just saw an interesting request in our support department. When our users open such support cases, our engineers immediately begin creating sample applications tailored to the user's requirements. Providing fast, customer-oriented, and satisfying technical support is one of our most important business targets. Feel free to test our support department when you are having any questions. We spend a lot of time and effort to provide this kind of support quality.

Anyway, back to this specific requirement. A user wanted to know whether the current input position is in the visible area of the TextControl instance on the form. Generally, this task is quite easy. You simply need to compare the current input position and the scroll position with the height of the control itself. The same, also, for the horizontal position.

What you need to care about is the conversion between the used unit twips and the 1/100 inch for the width and height of controls in .NET. The following function returns true, if the current input position is currently visible.

private bool IsInputPositionVisible()
{
    // get resolution to calculate convert twips 1/100 inch
    Graphics g = textControl1.CreateGraphics();
    int DPI = (int)(1440 / g.DpiX);

    // get input and scroll positions and convert to 1/100 inch
    int inputPosX  = (textControl1.InputPosition.Location.X / DPI);
    int inputPosY  = (textControl1.InputPosition.Location.Y / DPI);
    int scrollPosX = (textControl1.ScrollLocation.X / DPI);
    int scrollPosY = (textControl1.ScrollLocation.Y / DPI);

    // check whether input position is inside visible area
    return ((inputPosX > scrollPosX && inputPosX < scrollPosX + textControl1.Width) &&
            (inputPosY > scrollPosY && inputPosY < scrollPosY + textControl1.Height))
            ? true : false;
}

Do you have any challenges programming with TX Text Control? Feel free to contact our support department.

Online Survey: Do you need to import Adobe PDF documents?

Blogged by Björn Meyer on August 28, 2008 and tagged with Adobe PDF, Survey.

Our R&D team is currently gathering some information for future developments and products. One very interesting field is the import of Adobe PDF documents.

The intention of the PDF format is to view or print documents in various platforms and applications. Sometimes, documents are stored in the PDF format without saving it's original format such as MS Word DOC, RTF or DOCX. PDF documents can't be easily imported like these word processing formats. Converting PDF documents back into a format that can be edited using a WYSIWYG editor is a very complex task.

To help our engineers, we would like to ask you about your thoughts and your experiences. We would greatly appreciate it if you could help us by completing the following survey. It takes you less than 2 minutes.

Start now:

http://www.textcontrol.com/surveys/pdf.htm

Thank you very much for your help.

MS Word compatible mail merge using TX Text Control .NET Server

Blogged by Björn Meyer on August 15, 2008 and tagged with .NET Server, Mail merge.

With version 14.0 of TX Text Control .NET Server, we introduced a complete new namespace: TXTextControl.DocumentServer. This namespace contains best practices for specific and typical server-side document service applications.

A common server-side application is template-based mail merging. This allows developers to merge templates with database content. A template consists of merge fields that can be bound to database fields. TX Text Control .NET Server provides additional functionality to build sophisticated mail merge applications.

A template that can be loaded into the MailMerge component can contain two different types of fields: General fields that are part of the main text and fields that are part of a merge block. Merge blocks are repeated based on the number of data rows in a given DataSet. The block is acting like a sub-report with a separate set of data values.

The following diagram shows the idea behind these blocks:

MailMerge merge blocks

The merge block consists of a number of merge fields. For each data row of the passed DataSet, all fields in the block are merged with the given data of the current row. Additionally, the BlockRowMerged event is fired when a complete block is merged. In the event arguments of this event, the merged block is returned as a byte array in the internal TX Text Control format. This allows you to change the content of a merged block row. This approach can be used, for example, to change the background color of a table row to realize alternating table row colors

Another event is fired when the complete template has been merged. This allows you to save the document into a file when the append parameter of the Merge method has been set to false. In this case, the resulting documents are not appended to the same document.

Using the following code, you can load a template into the MailMerge component:

mailMerge1.LoadTemplate("template.docx", TXTextControl.DocumentServer.FileFormat.WordprocessingML);

The Merge method is called to merge all fields in the template that are not part of a merge block:

mailMerge1.Merge(mergeData, true);

To pass the data for the blocks, the MergeBlocks method must be called. The passed DataSet must contain a DataTable for each block in the template. The name of the block must be the same as the DataTable name:

mailMerge1.MergeBlocks(mergeBlockData);

Each time a block row is merged, the BlockRowMerged event is fired and can be used as shown in the following code example. The returned byte array is loaded into a ServerTextControl instance for further processing. The changed document can be passed back to the e.MergedBlockRow property:

void mailMerge1_BlockRowMerged(object sender, TXTextControl.DocumentServer.MailMerge.BlockRowMergedEventArgs e)
{
    byte[] data = e.MergedBlockRow;
    serverTextControl1.Load(data, TXTextControl.BinaryStreamType.InternalUnicodeFormat);
}

Finally, the document can be saved in one of the supported file formats. The next two code lines save the merged document as an Adobe PDF document:

TXTextControl.SaveSettings sSettings = new TXTextControl.SaveSettings();
mailMerge1.SaveDocument("results.pdf", TXTextControl.StreamType.AdobePDF, sSettings);

The next illustration shows the complete MailMerge class and it's properties, methods and events. It gives an overview of the possibilities using the MailMerge component.

MailMerge class overview

Try that on your own by downloading the TX Text Control .NET Server trial version. It comes with a complete set of sample projects for Visual Studio 2005 and 2008 that shows the different functionality of our MailMerge component.

Download TX Text Control .NET Server Trial Version

Service Pack 2 for TX Text Control 14.0 released

Blogged by Jonathan Maron on July 24, 2008 and tagged with Service Pack.

Today, the following service packs were released:

  • Service Pack 2 for TX Text Control .NET Server 14.0
  • Service Pack 2 for TX Text Control .NET 14.0
  • Service Pack 2 for TX Text Control ActiveX Server 14.0
  • Service Pack 2 for TX Text Control ActiveX 14.0

Please take a look at the updated known issues list at:
http://www.textcontrol.com/support/issues/

You can download the service pack at:
http://www.textcontrol.com/downloads/sps/

As ever, our support team is waiting to answer your questions. Full contact details at:
http://www.textcontrol.com/support/

Archive

External verification page for ISO 9000:2000 certificate
ISO 9001:2000
certified