1. Praveen Rajarao
  2. PowerBuilder
  3. Tuesday, 21 November 2017 14:30 PM UTC

I am using a OLE Object container that uses a TiffViewer Control and a Microsoft Web Browser control to display JPG/TIF/PDF/Web Pages in my PowerBuilder 12.5 classic application. 

The new requirement is to use "authenticated user credentials" while viewing these images since not all of my application users have access to the location of these images due to security reasons. 

Is there an easy way to achieve this? Here is my current code to display images. 

// For TIF/ JPGs

ole_1.object.XAlign = 2
ole_1.bringtotop = TRUE
ole_1.object.
ole_1.object.LoadImage(img)
ole_1.object.XZoomValue = id_zoom
ole_1.object.ZoomByOriginal()
ole_1.object.SetScrollBarPos(0,0)
 
//For PDF/Web Pages I use navigate
w_image_view2.ole_2.object.navigate( Img ) 
René Ullrich Accepted Answer Pending Moderation
  1. Tuesday, 21 November 2017 15:42 PM UTC
  2. PowerBuilder
  3. # 1

If you use the Microsoft Webbrowser Control you can do a "ping" request using Microsoft Web XML ActiveX to send the credentials. After that you can use the URL in browser control without the credentials (they are cached).

I don't know if it is also working the same way with Powerbuilders Inet object.

You may google for ways to specifiy the credentials within the browser control. It is compley and I havn't got it to work.

Comment
  1. Praveen Rajarao
  2. Tuesday, 21 November 2017 15:50 PM UTC
Rene - Not sure how I can do this. Also I am looking to render JPG and TIF images using a Tiffviewer active x control. Can you give me more details of a possible solution please. Thanks for your time. 



Praveen

  1. Helpful
  1. René Ullrich
  2. Wednesday, 22 November 2017 06:40 AM UTC
Hi Praveen,



my solution is working with the webbrowser control. I don't know if its working with Tiffviewer.



I assume you get the file from a webserver by a http(s) request and you need to specify credentials for the request using basic authentication. This is not working if you want to load the files from a network drive where you need to login!



You may try this https://social.msdn.microsoft.com/Forums/en-US/2810c0b5-a0db-49a4-a35e-bc7da0df49ac/webbrowser-control-auto-login?forum=csharplanguage



My solution is to do a request to an url (may be a url only for this thing) that needs the same credentials. I use for this Msxml2.XMLHTTP or Msxml2.ServerXMLHTTP ActiveX. You may specify the credentials in header or in the open function. Because the browser caches the credentials you may request the url after that in the browser control without credentials. Maybe it is easier to load the file you want to view directly using the XML ActiveX, save it to a local temp file and show the local file? This should work with the Webbrowser and Tiffviewer.



 



HTH

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 21 November 2017 14:44 PM UTC
  2. PowerBuilder
  3. # 2

Hi Praveen;

   Are you looking for something like an Active Directory solution for permissions to a folder and its files?

Regards ... Chris

 

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 21 November 2017 16:16 PM UTC
Hi Praveen;



  I built a PB & PowerServer Web Apps to do this using PB's standard InkPicture control for one of my Canadian Government clients a few years back. However, all the imaging was done via the open source  product ImageMagick product that I called directly from PB Apps to perform the image manipulations. In the PowerServer Web App, I wrapped the ImageMagick functionality around a PB based Web Service that brokered the requests to & from the Web App over to ImageMagick.



FYI: Click Here!



Regards ... Chris



 

  1. Helpful
  1. Praveen Rajarao
  2. Tuesday, 21 November 2017 17:20 PM UTC
Chris - I was looking at the ImageMagick software and I think I can leverage the Encipher / Decipher image function they have. Do you have a working example somewhere as to how you have implemented this? That will help things move fast :-)



Thanks for your time. 

  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 21 November 2017 21:31 PM UTC
Hi Praveen;



   Yes, I have a PB native App example using ImageMagicK and a Web Service one as well.



PM me and I can send you which ever example you are looking for.



Regards ... Chris

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.