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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Caching of PDFs created from ASP

Status
Not open for further replies.

dbrom

Programmer
Feb 21, 2001
100
US
I am creating a PDF file from within my ASP page.
I downloaded Adobe FDF Toolkit, registered DLLs, configured MIME types.

Now, the problem I have is that when I write a sample PDF back to the client, it is cached and when I make changes in the ASP code, the file displayed to the client is the same as before.

I am developing an online application that allows actors to post their acting resumes online, and I want to provide a way for them to export the resume to the file format that can be printed accurately, so I chose PDF. Obviously, when a user makes a change to the resume, I want the changes to be made immediately, so that they can print their updated resume. The trick is, since the PDF file is cached, it shows the old version.

Here is a sample code (it's an Adobe sample that came with FDF toolkit):


<%@ Language=VBScript %>
<%
Set FdfAcX = Server.CreateObject(&quot;FdfApp.FdfApp&quot;)

Set outputFDF = FdfAcX.FDFCreate

outputFDF.FDFSetValue &quot;Date&quot;, &quot;December 31 1999&quot;, False
outputFDF.FDFSetValue &quot;Name&quot;, &quot;John Clays&quot;, False
outputFDF.FDFSetValue &quot;Address&quot;, &quot;12 Saratoga Ave&quot;, False
outputFDF.FDFSetValue &quot;City&quot;, &quot;Saratoga&quot;, False
outputFDF.FDFSetValue &quot;State&quot;, &quot;CA&quot;, False

outputFDF.FDFSetFile &quot;
Response.ContentType = &quot;application/vnd.fdf&quot;
Response.BinaryWrite outputFDF.FDFSaveToBuf

outputFDF.FDFClose
%>


Did anyone run into the same problem?
Is there any way I can avoid caching of PDF files
(Response.ExpiresAbsolute = #1/1/1980#
Response.AddHeader &quot;cache-control&quot;, &quot;no-store, must-revalidate, private&quot;
Response.AddHeader &quot;Pragma&quot;, &quot;no-cache&quot;)
does not seem to make any difference...

Thanks in advance!

<Dmitriy>
dbrom@crosswinds.net
 
I have never created pdf's, so you may want to disregard what im about to say,
but the code here: outputFDF.FDFSetFile &quot;
Appears to be writting this file to a webpage. My first question would be security issues, but my second question would be; should you be using something along the lines of \\ntmachine\pdfs\generatefdf1.pdf to create the file?
 
Thanks minoad,

but I think the code is correct. I am not a PDF creating guru myself, so I just grabbed the code straight from 4guysfromrolla.com

Thanks for your reply, though.

Anyone else wants to take a stab at it :) <Dmitriy>
dbrom@crosswinds.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top