xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Buchtík, Michal" <Bucht...@dlsystem.cz>
Subject RE: How to show PDF file in jsp page ?
Date Mon, 04 Nov 2002 10:25:21 GMT
Is the browser IE?
Try this: Add the parameter to GET query, so the URL will end with .pdf

like this: http://...../getPdf.jsp?id=xxxx&dummy=.pdf

Michal

-----Original Message-----
From: Jiri_Nejedly@orcz.cz [mailto:Jiri_Nejedly@orcz.cz]
Sent: Monday, November 04, 2002 11:51 AM
To: fop-user@xml.apache.org
Subject: How to show PDF file in jsp page ?


I successfully created PDF , but now I don't know how to make browser show
it like PDF (Acrobat is installed, when I open file directly in browser,
all is ok).
If I use this code:

File inputFile = new File(pdfFile);
FileReader fr = new FileReader(inputFile);
int c;
while( (c = in.read()) != -1)
out.write(c);
fr.close()

, it shows only

%PDF-1.3 %^??­ 4 0 obj << /Type /Info /Producer (null) >> endobj 5 0 obj
<< /Length 518 /Filter [ /ASCII85Decode /FlateDecode ] >> stream
GasIe]5GM?%,Cdrr.2-t77e1)A-gNlh$SBW3]IXolHoP1:b%cI[r>4J(X"OY7ipn7qX1?O^,cK@?

lku6;kXe'1hU0KY_)ImgG*1CNnEe%YAdYqXKst:k4#- ...



When I placed on JSP page this line

response.setContentType("application/pdf");

, the result is similar:

%PDF-1.3
%^??­
4 0 obj
<< /Type /Info
/Producer (FOP 0.20.3) >>
endobj
5 0 obj
<< /Length 518 /Filter [ /ASCII85Decode /FlateDecode ]
 >>
stream
...

What must I do, to make browser use Acrobat plugin ? Thanks.

Mime
View raw message