Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Tip

If you want to take a look at the source code of a webapp displaying an individual and bulk signature integration with Blobfish Signer immediately, download blobfish-signer-webapp-1.0-SNAPSHOT-src.zip from Downloads.

See Bulk signature integration too.

To complete the most basic functional individual signature integration with Blobfish Signer in your web application (for bulk signature go to Bulk signature integration), you need to review the following steps. It is worth noting that you are not constrained to any programming language or server technology, but code examples are shown in Java JSP.

1. Prepare download and upload URLs

Info

Blobfish Signer takes a very simplistic approach related the URLs it will use for downloading the PDF to be signed, as well as the one it will use for uploading the signed PDF after the signature procedure gets completed. Blobfish Signer is not aware of any session cookies managed by the browser, because of that, you will maybe require to pass access tokens as request parameters in the URL.

Blobfish Signer expects to receive absolute URLs for downloading and uploading the PDF document, these are examples of these URLs. 

  • Download URL: http://example.org/sample-app/Download.do?id=123
  • Upload URL: http://example.org/sample-app/Upload.do?id=123

In Java JSP these URLs could be composed with the following code:

Code Block
<%
    String requestURL = request.getRequestURL().toString();
    String baseURL = requestURL.substring(0, requestURL.lastIndexOf("/"));
    String downloadURL = baseURL + "/Download.do?id=123";    
    String uploadURL = baseURL + "/Upload.do?id=123";    
%>

As indicated in Standards based, Blobfish Signer works on the basis of an URI Scheme, namely, the bsign URI Scheme. What you need to configure a bsign action is a regular HTML hyperlink like the following where the downloadURL and uploadURL both need to be URL encoded:

Code Block
<a href="bsign:?from=<downloadURL>&to=<uploadURL>">Sign</a>

For the URLs shown in the previous step, the resulting HTML would be:

Code Block
<a href="bsign:?from=http%3a%2f%2flocalhost%3a8080%2fblobfish-signer-webapp%2fDownload.do%3fid%3d123&to=http%3a%2f%2flocalhost%3a8080%2fblobfish-signer-webapp%2fUpload.do%3fid%3d123">Sign</a>

In Java JSP, this hyperlink could be composed like this:

Code Block
<a href="<c:url value="bsign:">
               <c:param name="from" value="<%=downloadURL%>"/>
               <c:param name="to" value="<%=uploadURL%>"/>
               </c:url>">Sign</a>
Panel

On this page:

Table of Contents

Full JSP example

Note that this example requires JSTL, which you may need to add to your project dependencies.

Code Block
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<body>
<%
    String requestURL = request.getRequestURL().toString();
    String baseUrl = requestURL.substring(0, requestURL.lastIndexOf("/"));
    String downloadURL = baseUrl + "/Download.do?id=123";
    String uploadURL = baseUrl + "/Upload.do?id=123";
%>
<a href="<c:url value="bsign:">
                   <c:param name="from" value="<%=downloadURL%>"/>
                   <c:param name="to" value="<%=uploadURL%>"/>
                   </c:url>">Sign</a>
</body>
</html>

TODO add instructions for bulk signature integration.