Interface SendDocumentInterface

  • All Known Implementing Classes:
    FileContentHandler

    public interface SendDocumentInterface
    Defines a method to export a document through the content handler. This method allows the content handler to implement custom document actions other than the ones VirtualViewer already supports (such as downloading, printing or emailing a document).
    • Method Detail

      • sendDocumentContent

        ContentHandlerResult sendDocumentContent​(ContentHandlerInput input)
                                          throws VirtualViewerAPIException
        This method gets called to send a document via a mechanism defined by the content handler. For example, before VirtualViewer supported it by default this method was often used to send documents by email.
        Parameters:
        input - ContentHandlerInput containing the following values:
        Every row is an expected value in the ContentHandlerInput. The first column is the string key for the value. The second column is the type of the value. The third column is the detailed description of the value.
        KeyTypeDescription
        KEY_DOCUMENT_CONTENT byte[] The document file content. Can be retrieved with byte[] documentContent= input.getDocumentContent(); .
        KEY_DOCUMENT_FORMAT int An integer code representing the document format. Can be retrieved along with a format information object with the following code:
        
        int formatCode = input.getDocumentFormat();
        Format format = VirtualViewerFormatHash.getInstance().getFormat(outputFormat);
        
        KEY_MERGE_ANNOTATIONS boolean Whether annotations have been merged into the document to be sent. Can be retrieved with boolean annotationsMerged = input.getMergeAnnotations(); .
        KEY_DOCUMENT_ID java.lang.String The key representing the document. Can be retrieved with String documentId = input.getDocumentId(); .
        KEY_CLIENT_INSTANCE_ID java.lang.String Custom configurable value used to pass data from client to content handler. If not set then will be the session ID. Can be retrieved with String clientInstanceId = input.getClientInstanceId();
        KEY_HTTP_SERVLET_REQUEST javax.servlet.http.HttpServletRequest Request that called this method. Can be retrieved with HttpServletRequest request = input.getHttpServletRequest();
        Returns:
        ContentHandlerResult with no values currently expected.
        Throws:
        VirtualViewerAPIException - if content handler throws exception