Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: fdfAddTemplate Help Please
Conf: (P-PDF) Developers, Msg: 89308
From: cfrance12
Date: 6/7/2003 02:30 AM

I am trying to use fdfAddTemplate (ASP) to create and fill with data a new template for each record of a record set. The problem us this, my code never spawns the .pdf. It writes the buffer stream right into the browser window. I have double checked the path to the pdf and that the tempkate name exists IN that .pdf. I have a feeling that I am missing something very minor - I know I had this working before...


Anyway, below is my code:

Any help will be greatly appreciated:

code snippet:

Dim FdFAcX, objFdf
Dim rsList, DataConn, strSQL

Set FdfAcX = Server.CreateObject("FdfApp.FdfApp")
Set objFdf = FdfAcX.FDFCreate
Set rsList = Server.CreateObject("ADODB.Recordset")
Set DataConn = Server.CreateObject("ADODB.Connection")
DSNtemp="DRIVER={SQL Server};SERVER=33SERVER;UID=sa;PWD=;DATABASE=SCCU"

DataConn.Open DSNtemp

strSQL = "SELECT * FROM tblAddressBook WHERE LastName Like 'Shipe'"
rsList.Open strSQL, DataConn



'Loop through the recordset.
While Not(rsList.EOF)
'Add a "new" template. The "myTemplate" variable name must match the template name in the .PDF file being called.
objFdf.FDFAddTemplate true, "http://172.20.16.2/sccu/docs/env.PDF", "myTemplate", true


'Set variables
FirstName = rsList("FirstName") & ":"


custname = rsList("FirstName") & " " & rsList("LastName")
Address = rsList("Address1")
City = rsList("City")
ST = rsList("State")
Zip = rsList("Zip")
CityLine = rsList("City") & ", " & rsList("State") & " " & rsList("Zip")



'Set values - form field name, variable name, FALSE(if text)
objFdf.FDFSetValue "txtName", custname, False
objFdf.FDFSetValue "txtAddr", Address, False
objFdf.FDFSetValue "txtCityLine", CityLine, False
objFdf.FDFSetValue "txtFirst", FirstName, False
objFdf.FDFSetValue "txtAcct", Account, False



rsList.MoveNext
i = i + 1
Wend

'Write the data back to the buffer stream.
Response.ContentType = "application/vnd.fdf"
Response.BinaryWrite objFdf.FDFSaveToBuf



'Close the object and clean-up.
objFdf.FDFClose
Set objFdf = Nothing
Set FdfAcX = Nothing

rsList.Close
Set rsList = Nothing

DataConn.Close
Set DataConn = Nothing


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.