I am actually working on an ASP project which purpose is to generate letters and print them.The generation and printing part is working well.Now I have to add an other option that which include a save button that also allow to save those letters in PDF format in a specific location.Can anyone please help me.Thank you.
Below is my code:
-------------------------------------------------------------------
<head>
<script type="text/javascript">
window.onload =function()
{
var content = window.opener.LoadLetterinPreview();
document.getElementById("print").innerHTML=content;
var url = window.opener.LoadLetterinPreview_url();
document.getElementById("url").innerHTML=url;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
}
<script type="text/javascript">
document.oncontextmenu = function() { //disable right click button
return false;
}
}
function GetFrom(which)
{
xmlHttp=GetXmlHttpObject();
if (CheckxmlHttp(xmlHttp)) return;
var url = "./app_ajax_getassignment_asp.asp?";
switch(which) //if script will be used to make asynchronous more than one call
{
case 1: //Update mapping(missing and complete apps)
var str = document.getElementById("url").innerHTML;
str = str.replace(/&/g, "&");
url += "a=updatemapping&"+str;
Idk if this is what you are looking for or not. What I would try to do is open the PDF in a new window. If the user has Adobe on their machine then they will be able to save it.
If you already have the PDF generated and have the path then this will probably be of more use.
Sorry for the limited response... If this was ASP.NET I could give you a better answer :P
And if the content is *NOT* already PDF, then you will have to use an ActiveX component to generate the PDF. The only really good one is AspPdf, available at www.asppdf.com I use it for several things; it works quite well. Very speedy, too.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.