Yes, the InputDataHandler can be used to handle files from URL. Actually, when you choose to use custom InputDataHandler then your implementation will handle everything provided by the ViewerHandler.
In particular, what is provided to the
public String getViewerScript(String viewerId, String filePath, String locale)
as filePath is later passed to the getFileDescription and getFile methods of the InputDataHandler as the guid.
So, if you make a custom implementation of the InputDataHandler you can just encode the URL before passing it to the getViewerScript and then decode it in the InputDataHandler, stream from the URL and get all needed data.
Or you can use the default InputDataHandler and encode URLs with com.groupdocs.viewer.domain.path.EncodedPath as it is in our code samples which are provided with the library.
GroupDocsPath path = new EncodedPath(file, viewerHandler.getConfiguration());
The default InputDataHandler is clever enough to differentiate simple file name and URL address and handle it appropriately.