Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PDF download instead of displaying

Status
Not open for further replies.

TRACEYMARYLAND

Programmer
May 21, 2004
370
US
hi i have an asp page that display form....i fill this in and it then creates an FDF and that creates the PDF.

When i run the following down below it brings up....save
file download and is not just displaying the pdf file.
All other pdf files display correctly.


But then if i go back to the directory it has created the pdf correctly....i can click on this and it displays great....



So it looks like the server is not issuing the pdf when it is requested...

Any suggestions
i am basically working through this example

Thanks

' Create an instance of the Object
'
Set FdfAcx = Server.CreateObject("FdfApp.FdfApp")
'
' Use the fdfApp to feed the vars
'
Set myFdf = FdfAcx.FDFCreate
'
' Stuff the variables
'
myFdf.fdfsetvalue "FirstName", FirstName, false
myFdf.fdfsetvalue "MI", MI, false
myFdf.fdfsetvalue "LastName", LastName, false
myFdf.fdfsetvalue "SS1", SS1, false
myFdf.fdfsetvalue "SS2", SS2, false
myFdf.fdfsetvalue "SS3", SS3, false
myFdf.fdfsetvalue "StreetAddress", StreetAddress, false
myFdf.fdfsetvalue "City", City, false
myFdf.fdfsetvalue "State", State, false
myFdf.fdfsetvalue "Zip", Zip, false
If FilingStatus = 1 Then
MyFdf.fdfsetValue "StatusSingle", "X", false
End If
If FilingStatus = 2 Then
MyFdf.fdfsetValue "StatusMarried", "X", false
End If
If FilingStatus = 3 Then
MyFdf.fdfsetValue "MarriedBut", "X", false
End If
myFdf.fdfsetvalue "Allowances", Allowances, false
myFdf.fdfsetvalue "Additional", Additional, false
myFdf.fdfsetvalue "Exempt", Exempt, false
'
' Point to your pdf file
'
myFDF.fdfSetFile "Response.ContentType = "text/html"
'
' Save it to a file. If you were going to save the actual file past the point of printing
' You would want to create a naming convention (perhaps using social in the name)
' Have to use the physical path so you may need to incorporate Server.mapPath in
' on this portion.
'
myFDf.FDFSaveToFile "C:\TEST_LOCAL\PDF\CheckThis.fdf"
' Now put a link to the file on your page.
Response.Write "<a href='
' Close your Objects
'
myfdf.fdfclose
set fdfacx = nothing
%>


fdf
%FDF-1.2
%âãÏÓ
1 0 obj<</FDF<</F( 2 0 R>>>>
endobj
2 0 obj[<</T(FirstName)/V(fd)>><</T(MI)/V(d)>><</T(LastName)/V(1)>><</T(SS1)/V(11)>><</T(SS2)/V(1)>><</T(SS3)/V(1)>><</T(StreetAddress)/V(1)>><</T(City)/V(1)>><</T(State)/V(11)>><</T(Zip)/V(11)>><</T(StatusSingle)/V(X)>><</T(Allowances)>><</T(Additional)>><</T(Exempt)>>]
endobj
trailer
<</Root 1 0 R>>
%%EOF
 
I saw this
In order for IE to respond correctly to this action you need to have the file type, FDF registered in your Windows Explorer - View - Options - File Types tab. Make sure the following exist there:

Registered File Type : Adobe Acrobat Form Document
Extension : FDF
Content Type (MIME) : application/vnd.fdf
Opens With : Acrobat Reader (pointing to your copy of Exchange or Reader)

but i can't find file types tab in the windows explorer..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top