Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

opening a PDF file in OLE olecustomcontrol

3,542 views
Skip to first unread message

shailendrapatel

unread,
Jul 25, 2006, 9:27:49 AM7/25/06
to
i was opeing pdf file run time in olecustomcontrol PB7 by
ole_1.object.src = pdf_file_name now i migrated the code to
pb9.02 i'm getting error "error acessing external object
property "
i want to open a PDF from PB9 run time into window to show a
pdf file( saved report) run time to user i dont know the
solution .
i was working fine in pb7

Brad Wery [TeamSybase]

unread,
Jul 25, 2006, 9:33:07 AM7/25/06
to
If it's the Adobe Reader OCX that you have placed on the window you can
display the PDF like so:

ole_1.object.loadfile(pdf_file_name)

Brad

Brad Wery [TeamSybase]

unread,
Jul 25, 2006, 10:45:19 AM7/25/06
to
Instead of selecting "Create New" from the OLE window, select "Insert
Object". The insert object tab will display all available objects that
can be inserted on your window. Find Adobe Acrobat... in the list and
select it.

Now you can use the following code to display your file:

ole_1.object.loadfile(pdf_file_name)

Brad

shailendra patel wrote:
> thank you very much for your reply .
> i had Adobe Acrobet 7.0 now previously i had Adobe Acrobet
> 6.0
> when i insert a ole conrol into window selecting create new
> adobe acrobat 7.0 document . it ask for a file path i
> clicked cancel and inserted ole control in window , still
> giving same error message , do i have to instrall any adobe
> acrobet patch/update . it looks like adobe problem . here i
> attached a export file of window
>

Brad Wery [TeamSybase]

unread,
Jul 25, 2006, 12:47:58 PM7/25/06
to
I get the same error with Adobe 7. I remember it working with the Adobe
Reader 6 activex control. You could installs Adobe Reader 6 then use the
.ocx found in the appropriate activex folder.

As for getting PB to work with Adobe 7. Hopefully someone else will jump
in because I'm not sure exactly what needs to be done to fix the problem.

Brad

shailendra Patel wrote:
> thank you
> i can not see adobeacrobat into insert control
> so i clicked on register new and selected acropdf.dll then i
> gave
> message acropdf.dll is not marked as supporting
> self-registration.
> however, the function "dllregisterserver" was found do you
> wish to register this file as control " and i registerd .
> when i selected this
> control into window it is giving message OLE control is
> missing critical interface "IPersiststrorage" i can not find
> any file with the
> name "dllregisterserver" or "IPersiststrorage" what i
> should do to
> remove this erro i upgraded adobe acrobat to 7.08 and pb i
> got is 9.02 build 7661 . now what i should do , please
> advise me .
> i attached a message copy
>

Brad Wery [TeamSybase]

unread,
Jul 25, 2006, 1:20:02 PM7/25/06
to
I just came across this:

http://groups.google.ca/group/sybase.public.powerbuilder.general/browse_thread/thread/ebb2c4be59af831/5024c133009c2fd5?lnk=st&q=&rnum=1&hl=en#5024c133009c2fd5

It appears that you could insert and use an IE control instead of the
Adobe control.

Brad

Brad Wery [TeamSybase]

unread,
Jul 25, 2006, 2:48:19 PM7/25/06
to
It worked great for me. What happens if you open the actual Internet
Explorer browser and put the path and file name in the address bar. Does
it open the pdf in the browser or does it open it in Adobe like it did
in PowerBuilder? Maybe it's an IE-Adobe configuration setting.

Brad

shailendra Patel wrote:
> than k you
> now i used microsoft web browser insted of adobe .
> but when i run it open another session to open a file not
> opening
> into window . into window ole object it gives the message
> internet
> exporer was unableo to linkto web page you requested . it
> run fine
> once after that it started giving this message .
> i'm doing by ole_1.Object.Navigate(pdf_file_file_name)
> i attached two file one code and another screen shot .
>
>

Brad Wery [TeamSybase]

unread,
Jul 25, 2006, 3:22:45 PM7/25/06
to
It could be an Adobe setting.

Open Adobe and go to the Edit\Preferences menu option. Select the
Internet option found in the list on the left. Make sure that the
"Display PDF in Browser" option is checked.

Hope this does it for you.

Brad

shailendra patel wrote:
> when i copied the filename with complete path into internet
> exporer , it opened the file not inside the exporer but
> opened
> adobe seperately.
> so it is exporer or abobe setting ? have idea whats required
> to be changed to solve this problem i want to open it
> inside/into the
> window where i have ole object.

Harry Schurink

unread,
Jul 26, 2006, 5:04:57 AM7/26/06
to
Do you really need the pfd to integrate in your gui?

I stopped messing around with that ole displaying, Just kick it to windows
and let windows handle it.
This way it also doesn't matter what kind of file you are displaying, as
long als the registry knows about it.

(local external function)
FUNCTION long ShellExecuteA( ulong hWnd, string Operation, string lpFile,
string lpParameters, string lpDirectory, int nShowCmd ) LIBRARY
"shell32.dll"

(The script)
string ls_null
ShellExecuteA( 0, "open", 'whateverfile.pdf', ls_null, ls_null, 1 )

Note: this can also be a jpg, doc, whatever.....


<shailendra patel> schreef in bericht
news:44c61c55.436...@sybase.com...

gokulka...@gmail.com

unread,
Jun 16, 2016, 4:53:40 AM6/16/16
to
hi ,

Can any tell where i am see the ole control name in powerbuilder tool.
I try ,but i can't find that.


Thank you

jishaj...@gmail.com

unread,
May 24, 2017, 9:51:59 AM5/24/17
to
I also have same problem . In administrator user it will open in ole itself , but in other users it will open in acrobat reader .

Kalyani Kharche

unread,
Apr 12, 2022, 1:46:37 AM4/12/22
to
Hello Bred,

Can you assist from where I can download Adobe Reader OCX control? I wanted to develop this functionality.
0 new messages