Repository: nvaccess/nvda

Issue:
Add support for Foxit Reader PDF Viewer
<!--
Please thoroughly read NVDA's wiki article on how to fill in this template, including how to provide the required files.
Issues may be closed if the required information is not present.
https://github.com/nvaccess/nvda/wiki/Github-issue-template-explanation-and-examples
-->
Foxit Reader is a widely used PDF viewer all over the world.  Foxit also engages in providing accessibile PDF reading. 
Foxit Reader can work with JAWS since version 9.3, it will be great if NVDA can support it. 

### Steps to reproduce:

1. Download and install Foxit Reader 9.3, it can be downloaded from here:
https://www.foxitsoftware.com/pdf-reader/
1. Open a PDF document.
1. Press DownArrow multiple times to read the contents in the opened document.

### Actual behavior:
Could not enter browse mode, only the first line of the opened document is read.

### Expected behavior:
Enter browse mode automatically and read the contents in the document.

### System configuration:

#### NVDA Installed/portable/running from source:
Installed

#### NVDA version:
Version: 2018.3.2

#### Windows version:
N/A

#### Name and version of other software in use when reproducing the issue:
Foxit Reader 9.3.0.10826

#### Other information about your system:
N/A

### Other questions:

#### Does the issue still occur after restarting your PC?
Yes

#### Have you tried any other versions of NVDA?
Yes

### Additional info:
Foxit Reader implemented MSAA and PDDom model just as Adobe Reader does, only a few lines of modification is needed to support it. I will try to create a pull request in a few days.


Discussion:
Yes I know it won't work with nvda, but last time I asked somebody told me 
it did not publish its access routines or support all the normal windows 
ones. It may of course have changed or maybe Jaws has a specific script for 
it?


bglists@blueyonder.co.uk
Sent via blueyonder.
Please address personal E-mail to:-
briang1@blueyonder.co.uk, putting 'Brian Gaff'
in the display name field. 


Foxit Reader exposes a UIA document implementation. It is pretty easy to add browse mode to this and I was even able to have quick navigation working for headings, but the performance is ridiculously slow.

See https://github.com/BabbageCom/nvda/blob/i8944/source/appModules/foxitreader.py
> It may of course have changed or maybe Jaws has a specific script for it? 

Yes, Foxit Reader has implemented MSAA and PDF Dom interface in version 9.3.
JAWS has changed it's config file and used the same interface as with Adobe Reader to access it.
@leonardder The UIA implementation is not complete yet. Out of process queries are quite slow due to some unknown reasons. But their developers have implemented both MSAA and PDDom for the document, the UIA implementation may be removed in future releases.
[**@gauldoth**](https://github.com/gauldoth) commented on [14 Nov 2018, 14:39 CET](https://github.com/nvaccess/nvda/issues/8944#issuecomment-438664750 "2018-11-14T13:39:41Z - Replied by Github Reply Comments"):
> @leonardder The UIA implementation is not complete yet. Out of process queries are quite slow due to some unknown reasons. But their developers have implemented both MSAA and PDDom for the document, the UIA implementation may be removed in future releases.

Thanks for pointing out. I will try another approach shortly.
@leonardder Thanks for helping.
I also tried a commit, but I don't know how to put that in into app module, see https://github.com/gauldoth/nvda/commit/8a56c93a042860753f7ed06c8c509b313c68534a

BTW, there is another product called Foxit PhantomPDF which implemented the same interface.
If we are going to use app module, we may also need a foxitphantompdf.py under the appModules folder.
> I also tried a commit, but I don't know how to put that in into app module, see [gauldoth@8a56c93](https://github.com/gauldoth/nvda/commit/8a56c93a042860753f7ed06c8c509b313c68534a)

Wow, this is exactly the next approach I intended to follow.
Would you be able to create a separate branch for this and file a pull request?

Resolving patch:
diff --git a/source/NVDAObjects/IAccessible/__init__.py b/source/NVDAObjects/IAccessible/__init__.py
--- a/source/NVDAObjects/IAccessible/__init__.py
+++ b/source/NVDAObjects/IAccessible/__init__.py
@@ -497,7 +497,7 @@ def findOverlayClasses(self,clsList):
 		if windowClassName.startswith("Internet Explorer_"):
 			from . import MSHTML
 			MSHTML.findExtraIAccessibleOverlayClasses(self, clsList)
-		elif windowClassName == "AVL_AVView":
+		elif windowClassName in ("AVL_AVView", "FoxitDocWnd"):
 			from . import adobeAcrobat
 			adobeAcrobat.findExtraOverlayClasses(self, clsList)
 		elif windowClassName == "WebViewWindowClass":
diff --git a/source/_UIAHandler.py b/source/_UIAHandler.py
--- a/source/_UIAHandler.py
+++ b/source/_UIAHandler.py
@@ -61,6 +61,8 @@
 	# #7497: Windows 10 Fall Creators Update has an incomplete UIA implementation for console windows, therefore for now we should ignore it.
 	# It does not implement caret/selection, and probably has no new text events.
 	"ConsoleWindowClass",
+	# #8944: The Foxit UIA implementation is incomplete and should not be used for now.
+	"FoxitDocWnd",
 ]
 
 # #8405: used to detect UIA dialogs prior to Windows 10 RS5.


Test patch: