| Skype: | TextControlSupport | |
| Orders: | 877-462-4772 |

TX Text Control ActiveX Server is an is usually deployed in ASP, however, it is equally possible to use it with ASP.NET. This demonstration shows you how to create a WinForms application in Visual Studio .NET that creates PDF, DOC and RTF files from data entered on a web page. This demo requires Adobe Reader (free download) to be installed.
The following is not the entire source code to this sample application, just the parts in which TX Text Control ActiveX Server is called. To see the entire source code, please download the ASP project files (see link above).
<%@ Page aspCompat="True" Language="vb" ... %> [...] tx.Load(Server.MapPath("template.rtf"), 0, 5, 0) tx.Find("Title:") TableId = tx.TableAtInputPos ' loop through the DropDownLists ' to get the selected values For i = 0 To (DropDownList2.Items.Count - 1) If DropDownList2.Items(i).Selected Then text_noteMaker = DropDownList2.Items(i).Text End If Next For i = 0 To (DropDownList1.Items.Count - 1) If DropDownList1.Items(i).Selected Then text_typeOfMeeting = DropDownList1.Items(i).Text End If Next ' fill the table with the content tx.TableCellText(TableId,1,2) = TextBox1.Text tx.TableCellText(TableId,2,2) = text_noteMaker tx.TableCellText(TableId,1,4) = text_typeOfMeeting tx.TableCellText(TableId,2,4) = Calendar1.SelectedDate.Date [...] data = tx.SaveToMemoryBuffer(data, exportFormat, 0) Response.Clear if exportFormat = 12 then Response.ContentType = "application/pdf" Response.AddHeader("Content-Disposition", "attachment;_ filename=meeting_minutes.pdf") Response.BinaryWrite(data) else if exportFormat = 9 then Response.ContentType = "application/doc" Response.AddHeader("Content-Disposition", "attachment;_ filename= meeting_minutes.doc") Response.BinaryWrite(data) else if exportFormat = 5 Response.ContentType = "application/rtf" Response.AddHeader("Content-Disposition", "attachment;_ filename=meeting_minutes.rtf") Response.Write(data) end if Response.End
We would be delighted to assist you with this or any other TX Text Control ActiveX Server demonstration program. Please contact the Support Department.