bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed May 27, 2020 9:44 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Tue Feb 04, 2020 1:00 am 
Offline

Joined: Thu Jan 28, 2010 2:30 pm
Posts: 35
rdonnay wrote:
Trying to get an OCX to evaluate has become really frustrating.

Windows defender won't let me run the installation program for the SoraxSoft demo.


I installed the SoraxSoft Demo without any problems (32- and 64-bit) on Windows 10 Pro 1909, Build 18363,592 and active Windows Defender.

_________________
Best regards
Leon


Top
 Profile  
 
PostPosted: Tue Feb 04, 2020 8:14 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
I decided to ignore Windows Defender because it was verified by Google on the download.

I finished the installation.

Thanks.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Wed Feb 19, 2020 5:43 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
Hi Roger,

I was wondering if you already did some tests with this activeX?

I'm using the Acrobat reader and sometimes we have problems with the annoying toolbar coming up in de window. If this ActiveX is better to control, I would consider changing it.

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Wed Feb 19, 2020 9:38 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
Chris -

I determined that the problems with Acrobat were due to security issues.
Rather than try to find a replacement PDF reader I found that I could turn off security using a registry entry.
My customer's IT guys said it would be ok.

The below code makes Acrobat PDFs load much faster:
Code:
DC_RegWrite( HKEY_LOCAL_MACHINE,'SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown','bProtectedMode',0 )

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Thu Feb 20, 2020 6:08 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
Hi Roger,

Don't you have problems with that toolbar that appears in Acrobat?

I'm using the following, but it looks as it is sometimes ignored:
Code:
oPdf:setShowToolbar(False)
oPdf:setShowScrollbars(False)
oPdf:setView("Fit")
oPDF:loadFile(cPDFfile)

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Thu Feb 20, 2020 7:28 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
Quote:
Don't you have problems with that toolbar that appears in Acrobat?


Actually, this application is not using the Acrobat OCX, instead it is using XbpHtmlViewer.
This is because there are many more file types that are being viewed besides PDF.

Yes, the toolbar is very annoying but it only appears when the same PDF is viewed more than one time in sequence.
I am looking at techniques to solve this problem.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Thu Feb 20, 2020 8:56 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
rdonnay wrote:
Quote:
Yes, the toolbar is very annoying but it only appears when the same PDF is viewed more than one time in sequence.

Yes indeed, it is always when the same PDF is shown again.

We also have sometimes JPG of PNG files to show. Never thought about the htmlviewer to use instead of the Acobat Reader. I convert the images to pdf before showing them. Maybe your solution is better.

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Thu Feb 20, 2020 9:54 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
This is how I solved the problem with the Acrobat toolbar.

I discovered that if anything other than a .PDF is loaded into the html viewer, it does a reset to the Acrobat control that is inherited by the html viewer and no toolbar will appear the next time a PDF is loaded. Maybe it clears the file cache.

There will be a short flash in the viewer before the PDF appears but that appears to be acceptable.

Code:
ELSEIF cDocType $ {'.TXT','.PDF','.HTML','.XML','.HTM','.ZIP','.ICO','.BMP','.RTF'}
  // Send it to viewer
  IF cDocType == '.PDF'
    MemoWrit(DC_Curpath()+'\viewer.htm','  ')
    ::viewerObject:Navigate(DC_Curpath()+'\viewer.htm')
  ENDIF
  ::viewerObject:Navigate(cDoc)

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Fri Feb 21, 2020 3:37 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
Hi Roger,

I did some tests with the htmlviewer, and it is working fine. Much better to implement according to the Adobe acrobat reader. now we can show every type of document.

Thanks for the suggestion.

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Fri Feb 21, 2020 9:33 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
Chris -

I have created a sample program that I think will give you some ideas on how to handle file viewing in an Xbase++ application.

Here is FileViewer.Prg

The FileViewer.Zip also includes a file named Viewer.aapp
This should be copied to your C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroApp\ENU folder to overwrite the existing file.
It will suppress the toolbar that is in the free version of Acrobat Reader DC.

After working closely with 2 customers who use this file viewing system in their documents systems, we have all agreed on the best way to handle viewing of documents inside an Xbase++ application.

Here is the part of the code that does the viewing of the document.

If the document type is an image, then it is put into the viewer via an html file that makes sure the image is sized for viewing.

If the document type is not supported by XbpHtmlViewer, then a message is put in the viewer telling the user to double-click the document for viewing with the registered program for that extension type. A double-click will spawn it.

If the document type is not registered, then a message is put into the viewer that it cannot be viewed.

Code:
STATIC FUNCTION ViewDocument( oViewer, cDoc, lItemSelected, oBrowse )

LOCAL cHtml, cDocType := '', aRef, aData, lIsValidType, aBranch

cDocType := Upper(cDoc)
cDocType := Substr(cDocType,_AtLast(cDocType,'.'))

aBranch := DC_RegQueryBranch(HKEY_CURRENT_USER, ;
               'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\' + ;
               Lower(cDocType) + '\UserChoice')

IF Empty(aBranch)
  aBranch := DC_RegQueryBranch(HKEY_CURRENT_USER, ;
               'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\' + ;
               Lower(cDocType) + '\OpenWithProgids')

ENDIF

lIsValidType := !Empty(aBranch)

IF cDocType $ {'.JPG','.PNG', '.GIF', '.TIFF', '.TIF'}
  // Send image to viewer in a <IMG> tag
  IF !lItemSelected
    cHtml := '<img src="' + cDoc + '" width=' + Alltrim(Str(oViewer:currentSize()[1]-20)) + '>'
    MemoWrit('Viewer.Htm',cHtml)
    cDoc := DC_CurPath()+'\' + 'viewer.htm'
    Sleep(10)
    oViewer:Navigate(cDoc)
  ENDIF
ELSEIF cDocType $ {'.TXT','.PDF','.HTML','.XML','.HTM','.ZIP','.ICO','.BMP','.RTF'}
  // Send it to viewer
  // To suppress Acrobat DC Toolbar, copy viewer.aapp to the following folder:
  // Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroApp\ENU
  oViewer:Navigate(cDoc)
ELSE
  // Spawn it and show a message in the viewer
  IF cDocType $ {'.XLS','.XLSX','.CSV'}
    cDocType := 'Microsoft Excel'
  ELSEIF cDocType $ {'.DOC','.DOCX'}
    cDocType := 'Microsoft Word'
  ELSEIF cDocType $ {'.MOV','.AVI','.MP4'}
    cDocType := 'Video'
  ENDIF
  IF lIsValidType
    cHtml := '<H2>Your ' + cDocType + ' document will be displayed in a new window.<br><br>'
    cHtml += 'Press the ENTER key or Double click the document name to view the document'
  ELSE
    cHtml := '<H2>Your document has no registered program that is associated with '
    cHtml += 'this file type: ' + cDocType
  ENDIF
  IF !lItemSelected
    MemoWrit('Viewer.Htm',cHtml)
    cDoc := DC_CurPath()+'\' + 'viewer.htm'
    Sleep(10)
    oViewer:Navigate(cDoc)
  ENDIF
ENDIF

IF lItemSelected
  DC_SpawnUrl(cDoc)
ENDIF

SetAppFocus(oBrowse)

RETURN nil


The sample program suppresses showing any kind of document that should not be spawned, such as .EXE, .DLL, etc.


Attachments:
fileviewer.zip [2.71 KiB]
Downloaded 140 times

_________________
The eXpress train is coming - and it has more cars.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group