You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Chris Faulkner <ch...@ntlworld.com> on 2002/03/26 14:01:57 UTC

Overlap text on an image and cache in IE

Hi 

Two things - I hope people can help.

1. Is it possible tooverlap an image on a page with some other object ( eg an image, a table or some text string). I have a PNG which has been placed on the page and 
I'd like to add some text and maybe another image over the top ofthe PNG.

2. In IE 5.5, I had a JSP page serving PDFs with FOP. As part of general application improvements, I was eliminating the possibility of caching of some of the pages. I 
added this to my JSP which sent back the PDF.

<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy
%>

The JSP continued to work in Netscape and Opera but failed in IE. I took the caching directives out and it started to work again in IE. I probably didn't need the no-
cache stuff in any case for this page but I am still mystified about IE's behaviour.

Thanks

Chris



Re: JSP returning PDF

Posted by Patrick Lanphier <pm...@artemisgroup.com>.
All one really has to do is example in PHP

function stall_browser($records,$file){
  Header("Cache-Control: must-revalidate");
  $minutes = floor(round(($records * .82)/60,2));  //Calulated at .77
  $seconds = (round(($records * .82)/60,2)-$minutes) *60;
  $offset = 60 * 60 * 24 * 0;
  $ExpireString = gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
  Header("Expires: " . $ExpireString);
  echo "<META HTTP-EQUIV=Expires CONTENT=\"$ExpireString\">";

 {put what you would like to see here on the page}
 {flush}
 {feed a small bitstream until completed}
 for ($i=0;$i<2;$i++) echo str_repeat (' ',512) ."\n";

 {when finished send}
   echo "<div align='center'><a href='http://www.energywatchdog.com/usi/ind
  echo "</body>\n";
  echo "</html>\n";
  echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=http://www.energywatchdo
  exit;
};

The refresh redirect is to the new PDF file.  If you do this any other way
that I have tried it works in some browsers and not others this appears to
work in all broswers.

Patrick Lanphier
The Artemis Group
http://www.artemisgroup.com
phone: 814-235-0444
  fax: 800-582-9710

On Fri, 19 Apr 2002, Chris Faulkner wrote:

> Hi
>
> I'm using FOP in a JSP to return dynamically created PDF documents to browsers. I'm using the usual method of embedding FOP as described on the web site. It works great. The main problem is that the
> PDFs take about 20 seconds to generate and then, since they are 500K or so, a while to download depending on connection speed.
>
> I'd like to be able to put a message on an intermediate page which could refresh and only return the PDF when it is ready. At the moment, they are just seeing a blank page until the PDF is complete. Does
> anyone have any ideas for this ? Can I flush some output to the page to advise them to be patient, then reset the response and send the PDF when it is ready?
>
> Alternatively. I was thinking of doing something a bit more ambitious which would be to output the PDF to a database blob, then send back a page which refreshes to a JSP which keeps checking whether
> the PDF has been finished. When it is, I could fetch the data outofthe BLOB and send it back.
>
> I have seen other sites where the PDF was output to a static file on the website. Then the JSP would refresh and keep checking until the file was present. When the file was created, the page would
> appear with a link to the file. The main problem with this is security. There is the potential that everyone would have access to all PDFs on the web site, although on a site without listings, they'd need to be
> making pretty inspired guesses to find and download it.
>
> How do others get around this ? I imagine its quite a common problem.
>
> Thanks
>
>
> Chris
>
>


JSP returning PDF

Posted by Chris Faulkner <ch...@ntlworld.com>.
Hi 

I'm using FOP in a JSP to return dynamically created PDF documents to browsers. I'm using the usual method of embedding FOP as described on the web site. It works great. The main problem is that the 
PDFs take about 20 seconds to generate and then, since they are 500K or so, a while to download depending on connection speed. 

I'd like to be able to put a message on an intermediate page which could refresh and only return the PDF when it is ready. At the moment, they are just seeing a blank page until the PDF is complete. Does 
anyone have any ideas for this ? Can I flush some output to the page to advise them to be patient, then reset the response and send the PDF when it is ready?

Alternatively. I was thinking of doing something a bit more ambitious which would be to output the PDF to a database blob, then send back a page which refreshes to a JSP which keeps checking whether 
the PDF has been finished. When it is, I could fetch the data outofthe BLOB and send it back.

I have seen other sites where the PDF was output to a static file on the website. Then the JSP would refresh and keep checking until the file was present. When the file was created, the page would 
appear with a link to the file. The main problem with this is security. There is the potential that everyone would have access to all PDFs on the web site, although on a site without listings, they'd need to be 
making pretty inspired guesses to find and download it.

How do others get around this ? I imagine its quite a common problem.

Thanks


Chris



Re: document properties

Posted by Keiron Liddle <ke...@aftexsw.com>.
At the moment these things are not available.

The creation date can be set from the current date and the title can come 
from the fo:title.
It may be possible to create an extension to handle the other values 
similar to the bookmark extension.

So these values have been considered but they are not implemented yet.

On 2002.04.11 22:34 Chris Faulkner wrote:
> Hello
> 
> Is there anyway to set document author, creation date and so on with FOP
> in the production of the documents ? I can't see it anything in the spec
> and FO is all about formatting objects so I suppose not. But f
> anyone knows of a way to do it or other software (hopefully open source)
> which will do it after the event, that would be very useful.
> 
> In Acrobat 4 reader (File->Document Info->Security), there are other
> document-wide properties that it would be nice to be able to set, for
> setting passwords and so on.  Can these be set ?
> 
> Thanks
> 
> Chris

document properties

Posted by Chris Faulkner <ch...@ntlworld.com>.
Hello

Is there anyway to set document author, creation date and so on with FOP in the production of the documents ? I can't see it anything in the spec and FO is all about formatting objects so I suppose not. But f 
anyone knows of a way to do it or other software (hopefully open source) which will do it after the event, that would be very useful.

In Acrobat 4 reader (File->Document Info->Security), there are other document-wide properties that it would be nice to be able to set, for setting passwords and so on.  Can these be set ?

Thanks

Chris