RdougK
asked on
FDF -> PDF via web
I am trying to create a web page that opens an adobe pdf with the pages fields populated from a database.
The concept seems simple. I can create the fdf file and MANUALLY select that FDF file and it opens the desired PDF with everything populated as it should be.
The problem I am having is getting the same thing to occur via the web. The fdf tool kit is installed on the server, the FDF file is created, the pdf file that the FDF points to is in place. My attempt is to simply call the fdf file to open expecting it to call its associated pdf file and display that pdf, populated to the user.
Where am I going wrong here??
I am using classic asp NOT asp.net
The result I get is a blank web page.
My code to call fdf file looks like this:
<A HREF="../../mydirectory/te stingsrver .fdf" TARGET="_blank">Test it!</A>
The concept seems simple. I can create the fdf file and MANUALLY select that FDF file and it opens the desired PDF with everything populated as it should be.
The problem I am having is getting the same thing to occur via the web. The fdf tool kit is installed on the server, the FDF file is created, the pdf file that the FDF points to is in place. My attempt is to simply call the fdf file to open expecting it to call its associated pdf file and display that pdf, populated to the user.
Where am I going wrong here??
I am using classic asp NOT asp.net
The result I get is a blank web page.
My code to call fdf file looks like this:
<A HREF="../../mydirectory/te
ASKER
I have:
ContentType = "application/vnd.fdf"
I have since modified my code from browsing around this site. I have changed my approach to:
strFilePath = Server.MapPath("/directory /next/myfd ffile.fdf" )
ContentType = "application/vnd.fdf"
Set objStream = Server.CreateObject("ADODB .Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile strFilePath
Response.AddHeader "Content-Disposition", "attachment; filename="&strFilePath
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
I am able to create the FDF.s with no problem. If I manually browse to them and double click them they redirect to the PDF specified and open with the fields populated per the fdf. What I am trying to do is cause the exact thing to happen, in a web browser (ie)
Hope that clarifies, but I fear I am so lost I may not be able to give good directions to help me!
I am fairly new to web programming!
ContentType = "application/vnd.fdf"
I have since modified my code from browsing around this site. I have changed my approach to:
strFilePath = Server.MapPath("/directory
ContentType = "application/vnd.fdf"
Set objStream = Server.CreateObject("ADODB
objStream.Open
objStream.Type = 1
objStream.LoadFromFile strFilePath
Response.AddHeader "Content-Disposition", "attachment; filename="&strFilePath
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
I am able to create the FDF.s with no problem. If I manually browse to them and double click them they redirect to the PDF specified and open with the fields populated per the fdf. What I am trying to do is cause the exact thing to happen, in a web browser (ie)
Hope that clarifies, but I fear I am so lost I may not be able to give good directions to help me!
I am fairly new to web programming!
> ContentType = "application/vnd.fdf"
does your browser support this type
does your browser support this type
ASKER
As far as I know. I have little access to the server, my admin installed the adobe fdf tool kit. It had instructions to make sure all the file associations were in check, he said they were but I have no way of checking this personally.
I'm talking about the client (browser!) not the server
ASKER
Ah, I see.
OK, remember "new to web programming".
I am assuming I am looking under Tools>internet options>programs tab >manage add-ons ??
For Adobe I have
Adobe PDF (AcroIEFavClient.dll)
Adobe PDF Conversion Toolbar Helper (AcroIEFavClient.dll)
Adobe PDF Link Helper (AcroIEHelperShim.dll)
Adobe PDF Reader (AcroPDF.dll)
Am I looking in the right place??
If I am what should I see or more importantly what do I need to do to make this association?
Thanks.
OK, remember "new to web programming".
I am assuming I am looking under Tools>internet options>programs tab >manage add-ons ??
For Adobe I have
Adobe PDF (AcroIEFavClient.dll)
Adobe PDF Conversion Toolbar Helper (AcroIEFavClient.dll)
Adobe PDF Link Helper (AcroIEHelperShim.dll)
Adobe PDF Reader (AcroPDF.dll)
Am I looking in the right place??
If I am what should I see or more importantly what do I need to do to make this association?
Thanks.
silly question: do think it will help you if you pimp just *your* browser, means you don't care about other people?
If not; you need to ltell your application to send a coomon Content-Type header, for example application/pdf
If not; you need to ltell your application to send a coomon Content-Type header, for example application/pdf
ASKER
I understand what you are saying, thats an issue I will be glad to deal with later. Maybe a dozen users will need this functionality. if it is simply a matter of installing something on their machine, configuring (pimping) their browser it won't be a problem.
In an effort to see if it is a matter of my browser I did find an example of something similar to what I want to do on the web at: http://www.planetpdf.com/developer/article.asp?ContentID=6492
The example works for me on their site and mine. So the server (and browser) must be OK.
In an effort to see if it is a matter of my browser I did find an example of something similar to what I want to do on the web at: http://www.planetpdf.com/developer/article.asp?ContentID=6492
The example works for me on their site and mine. So the server (and browser) must be OK.
so the link tells you waht I already did: either server needs to send application/pdf or if it sends application/vnd.fdf the browser nedds to support wthis
ASKER
Yeah. What I was looking for was why my approach was not working. Everything is obviously set up to work properly but my code is not working. An error of some sort on my end in my code.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
JACKPOT!! We have a winner! This is EXACTLY what I wanted to do. Although I ended up going another direction doing something more like the link above building the fdf in a buffer but the last reply IS the solution to the original problem I posed! THANKS!
ASKER
THANKS!
what Content-Type header does your server send for that file?