Adobe Acrobat Reader ActiveX, src parameter

390 views
Skip to first unread message

Imons

unread,
Nov 3, 2009, 10:50:13 AM11/3/09
to ff-activex-host
Hi all,

i need to embed the adobe reader as an activex plugin because i need
the scriptability of the component.
i can embed the reader as an activex plugin and call its API but when
i sepcify a PDF document as a param, it won't load it.

Code:

if(Prototype.Browser.IE) {
document.write('<object classid="clsid:CA8A9780-280D-11CF-
A24D-444553540000" id="pdfview" width="100%" height="70%">');
document.write('<param name="src" value="N:/BrowserIndependedObjects/
PDF/acro.pdf">');
document.write('</object>');
}
else {
document.write('<object type="application/x-itst-activex"
clsid="{CA8A9780-280D-11CF-A24D-444553540000}" id="pdfview"
width="100%" height="70%">');
document.write('<param name="src" value="N:/BrowserIndependedObjects/
PDF/acro.pdf" />');
document.write('</object>');

// workaround
//document.getElementById("pdfview").src = document.getElementById
("pdfview").firstElementChild.getAttribute("value");
}

The "workaround" sets the "src" property of the activex component
which causes the component to load the pdf document.

I used the r33 tag version from the repository and built it with VS
2005 and the latest Xulrunner SDK. I also modified the source in
"ffactivex.cpp" to pass parameters which doesn't use the "param_"
prefix.

I also use this approach for another plugin (eDrawings) and there i
specify the target file successfully in the same way.

Thanks & Regards
Simon

Leeor Aharon

unread,
Nov 4, 2009, 10:04:10 AM11/4/09
to ff-acti...@googlegroups.com
Hi Simon,

I'll try to debug the issue when I have some time. Hopefully next week or so.

Leeor.

Imons

unread,
Nov 11, 2009, 9:42:05 AM11/11/09
to ff-activex-host
Hi Leeor,

today i found another issue. Sometimes when i used the Adobe Reader
ActiveX Plugin i got the following exception when i closed the browser
window:

sw: BlumBrowser.exe - Application Error
---------------------------
The instruction at "0x0700609c" referenced memory at "0x00000014". The
memory could not be "read".
Click on OK to terminate the program
---------------------------
OK

I also get this exception when i use the debugger with a breakpoint in
the NPP_Destroy method but it doesn't happen in the ff-activex code.

After some reading i found out that this is an issue with Adobe Reader
Version 9 when its used through ActiveX.

I think i have fixed this issue by adding a call to
"CoFreeUnusedLibraries" somewhere in the clean up code. I've never got
the exception since i've added that line. Maybe you can reproduce that
error while trying to fix the issue i described a week ago. I think
you will better know where to put the free call, i've just inserted it
in the NPP_Destroy method because it was the last method before the
exception. ^^

Regards
Simon

On 4 Nov., 16:04, Leeor Aharon <leeor.aha...@gmail.com> wrote:
> Hi Simon,
>
> I'll try to debug the issue when I have some time. Hopefully next week or
> so.
>
> Leeor.
>

Leeor Aharon

unread,
Nov 15, 2009, 3:41:50 AM11/15/09
to ff-acti...@googlegroups.com
Hi Simon,

Can you please try and move the call to CoFreeUnusedLibraries to the AxHost destructor? Add it to the very end of the function, just before it returns.
Seems to me like a better place for it since it's the AxHost that manages the ActiveX dll that's loaded.

If you can confirm that it works well from there as well, then I'll do some testing here and commit the change.

Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "ff-activex-host" group.
To post to this group, send email to ff-acti...@googlegroups.com
To unsubscribe from this group, send email to ff-activex-ho...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/ff-activex-host?hl=en
-~----------~----~----~----~------~----~------~--~---


Simon

unread,
Nov 16, 2009, 12:47:10 AM11/16/09
to ff-activex-host
Hi Leeor,

after some tests it looks like that it is working from there as well.
Hm, but i think it didn't fix the issue hundret percent, i got the
exception one time last week. But not as often as before the fix. And
my project leader, who got the exception every time he used my test
site, didn't get it either since the fix. So it may be a good idea to
add this line to the destructor and clean up a little but, even if it
works only in 90% of the test cases.

Regards
Simon

On 15 Nov., 09:41, Leeor Aharon <leeor.aha...@gmail.com> wrote:
> Hi Simon,
>
> Can you please try and move the call to CoFreeUnusedLibraries to the AxHost
> destructor? Add it to the very end of the function, just before it returns.
> Seems to me like a better place for it since it's the AxHost that manages
> the ActiveX dll that's loaded.
>
> If you can confirm that it works well from there as well, then I'll do some
> testing here and commit the change.
>
> Thanks.
>
> > ff-activex-ho...@googlegroups.com<ff-activex-host%2Bunsu...@googlegroups.com>

Leeor Aharon

unread,
Nov 16, 2009, 2:53:25 AM11/16/09
to ff-acti...@googlegroups.com
So what you're saying is - the fix is more reliable when done in NPP_Destroy than in the AxHost destructor, right?

--

You received this message because you are subscribed to the Google Groups "ff-activex-host" group.
To post to this group, send email to ff-acti...@googlegroups.com.
To unsubscribe from this group, send email to ff-activex-ho...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ff-activex-host?hl=.



Simon

unread,
Nov 16, 2009, 3:15:52 AM11/16/09
to ff-activex-host
No, it behaves the same whether its in NPP_Destroy or in the
destructor. The fix itself is not 100 percent reliable. But it does
work better for us then without the fix so its your decision whether
you will include this in the official tree or not.
The real bug is somewhere in the Adobe code so we don't have the
chance to fix this either.

On 16 Nov., 08:53, Leeor Aharon <leeor.aha...@gmail.com> wrote:
> So what you're saying is - the fix is more reliable when done in NPP_Destroy
> than in the AxHost destructor, right?
>
> > <ff-activex-host%2Bunsu...@googlegroups.com<ff-activex-host%252Buns...@googlegroups.com>
>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/ff-activex-host?hl=en
> > > > -~----------~----~----~----~------~----~------~--~---
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "ff-activex-host" group.
> > To post to this group, send email to ff-acti...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > ff-activex-ho...@googlegroups.com<ff-activex-host%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages