Solved

HTML embed tag not refresh PDF file

Posted on 2011-09-17
4
1,071 Views
Last Modified: 2012-05-12
I have a simple HTML embed tag shown below...

<embed id="pdf" width="700" src="printjobs/out/1.pdf" height="850"></embed>

The content in the PDF file is created dynamically using jsp backend. The problem is that once a filename is used it does not refresh the file to show the current content. The previous content is locked in memory. I can delete the temp file and it will work once then get stuck again. Any suggestions or better yet offer an inexpensive solution for displaying PDF files without using Adobe.

This is a jsp application that must support IE7 and above. I am currently testing with IE7

Thanks
rf
0
Comment
Question by:ivron001
  • 2
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 36553810
do it this way

<embed id="pdf" width="700" src="printjobs/out/1.pdf?date=newUniqueNumberEverytime" height="850"></embed>

just append a new value for the date query string parameter.

Since you browser will cache a resource by default
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36553819
<<Since you browser will cache a resource by default>>
I meant that your browser will cache the response to a URL query by default, and by appending a new number every time, you are creating a new query only
0
 

Author Comment

by:ivron001
ID: 36553849
Thanks Genius... I am actually using a simular approach by attaching a version number to the end of the file. Your method is better because I don't have to manage the deletion of old files. I would prefer to somehow replace and use the updated copy if possible. A lot of print jobs are ran in a day and I don't know what type of effect creating so many versions of the same file will have over time since the previous versions still exist in memory. I am going to run some test and see.

0
 

Author Comment

by:ivron001
ID: 36554361
Sorry gurvinder372... I just looked at my response again and noticed that your rank is Genius and not your nickname. Hope I did not offend you by calling you that. I have tried a few more things but yours still is the best solution so once again thanks so much for responding. I am going to go with your solution.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now