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

This demonstration shows how to get data from a web site form into a PDF file. As an example, we have taken the Licensing Agreement that needs to be signed before we are able to send you the trial version of TX Text Control Server. 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).
Dim lc, tx Dim OutputBuffer Dim TableID Dim TotalSum Dim CurrentRow Dim article_sum Dim i ' Create TX Text Control Server Edition Set lc = Server.CreateObject("TX.TextControl.LicManager") Set tx = Server.CreateObject("TX.TextControl.110") tx.EnableAutomationServer tx.ViewMode = 1 tx.FormatSelection = 1 ' Load the template file tx.Load Server.MapPath("license.doc"), 0, 9, 0 ' Set page settings tx.PageWidth = tx.LoadSaveAttribute(0) tx.PageHeight = tx.LoadSaveAttribute(1) tx.PageMarginL = tx.LoadSaveAttribute(2) tx.PageMarginT = tx.LoadSaveAttribute(3) tx.PageMarginR = tx.LoadSaveAttribute(4) tx.PageMarginB = tx.LoadSaveAttribute(5) ' Now fill the the document with the values from the form tx.Find "Department", 0, 16 TableID = tx.TableAtInputPos tx.TableCellText(TableID, 1, 2) = Request.Form("PERSONAL[FirstName]") tx.TableCellText(TableID, 2, 2) = Request.Form("PERSONAL[Title]") tx.TableCellText(TableID, 3, 2) = Request.Form("PERSONAL[Department]") tx.TableCellText(TableID, 4, 2) = Request.Form("PERSONAL[Street]") tx.TableCellText(TableID, 5, 2) = Request.Form("PERSONAL[State]") tx.TableCellText(TableID, 6, 2) = FindCountryByCode(Request.Form_ ("COUNTRY[Code]")) tx.TableCellText(TableID, 7, 2) = Request.Form("PERSONAL[Telephone]") tx.TableCellText(TableID, 1, 4) = Request.Form("PERSONAL[LastName]") tx.TableCellText(TableID, 2, 4) = Request.Form("PERSONAL[Position]") tx.TableCellText(TableID, 3, 4) = Request.Form("PERSONAL[Company]") tx.TableCellText(TableID, 4, 4) = Request.Form("PERSONAL[City]") tx.TableCellText(TableID, 5, 4) = Request.Form("PERSONAL[ZipCode]") tx.TableCellText(TableID, 6, 4) = Request.Form("PERSONAL[EMail]") tx.TableCellText(TableID, 7, 4) = Request.Form("PERSONAL[Fax]") ' Write the contents as a PDF document to a variable and return it to ' the client OutputBuffer = tx.SaveToMemoryBuffer(OutputBuffer, 12, 0) Response.Clear Response.ContentType = "application/pdf" Response.AddHeader "Content-Disposition", "attachment;_ filename=txlicense.pdf" Response.BinaryWrite(OutputBuffer)
We would be delighted to assist you with this or any other TX Text Control ActiveX Server demonstration program. Please contact the Support Department.