Case 1: integrate PROOFSCOPE in a page

This case describes how you can integrate PROOFSCOPE in a page.

The PROOFSCOPE SDK contains two HTML files which contain the base to start a PROOFSCOPE component on a custom HTML page:

  • createToken.html contains the code to create a view token. This token should be saved and passed when the viewer needs to be opened.

    You can find it here: http://<cloudflow server>/manual/ProofscopeSDKExample/ProofscopeComponent/createToken.html

  • proofscope.html contains the code to integrate the PROOFSCOPE component. It shows a prompt dialog where you can input the viewer token.

    You can find it here: http://<cloudflow server>/manual/ProofscopeSDKExample/ProofscopeComponent/proofscope.html

You can copy this code of proofscope.html:
1 api_async.proofscope.get_view_info(pToken, function(pResult) {
2     api.m_session = pResult.use_session;
3     api_sync.m_session = pResult.use_session;
4     api_async.m_session = pResult.use_session;
5
6     var viewerParameters = pResult.view.parameters;
7     $('#proofscope').Proofscope(viewerParameters);
8 });
  • Line 1 will make the call to get the PROOFSCOPE parameters that were passed when creating the token.
  • Line 2 to 4 will set the session which is returned, so the internal functions of PROOFSCOPE will work with the user for which the token is generated.
  • Line 6 will retrieve the PROOFSCOPE parameters.
  • Line 7 will construct the PROOFSCOPE viewer in a div with id proofscope. It will take the parameters that were used to create the token.