HighDots Forums  

Please help! A problem to show a PDF document

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Please help! A problem to show a PDF document in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
q2005
 
Posts: n/a

Default Please help! A problem to show a PDF document - 09-16-2005 , 01:14 AM






Hi, all

I use following code on a web page to activate a php program, comServer.php,
on the server site to create a PDF file and show it when it's returned.
Quote:
my=document.createElement('form');
my.action='../../comServer.php';
my.target='_blank';
my.method='post';
document.body.appendChild(my);
xsValue="field1=1&field2=2&field3=3";
ar=xsValue.split("&");
for(i1 in ar){
my1=document.createElement('input');
my1.type='hidden';
j1=ar[i1].indexOf("=");
my1.name=ar[i1].substr(0,j1);
my1.value=ar[i1].substr(j1+1);
my.appendChild(my1);
}
my.submit();
my.removeNode(true);
Quote:
On server site, after the pdf is created, the following code will send it
out.
Quote:
header("Content-Type: application/pdf");
header("Content-Disposition: inline");
return file_get_contents(zTEMP_FOLDER . $sPdfFileName);
Quote:
On the client site the IE 6 browser most time shows the pdf content. But
sometimes it doesn't show anything. I check the PDF file was created without
problem. Thank you in advance!


Jack




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.