Hello,
I have a web page which needs to print a pdf file when the javascript
is called.
I have the java script as
function printPDF(PrintString)
{
var status = 0;
var AccroApp;
var p;
var a;
try
{
AccroApp = new
ActiveXObject('AcroExch.App');
p = new ActiveXObject('AcroExch.PDDoc');
a = new ActiveXObject('AcroExch.AvDoc');
if (PrintString !='')
{
var Str = new String();
Str=PrintString;
p.Open(PrintString);
a = p.OpenAVDoc(p.GetFileName);
i = p.GetNumPages;
a.PrintPagesSilent(0,i,0,0,0);
a.Close(0);
p.Close;
AcroApp.Exit;
}
catch (e)
{
if (e.number != 0)
{
alert("Unable to Print - " + e.description);
}
}
But it throws an exception "Automation server cannot create object". I
have Acrobat 7.0 full version installed in my system. It will of agreat
help for me if anyone can tell me, how to solve this issue.
Thanks & Regards,
Pavan