Content Prerequisites .................................................................................................................. 3 How to Use the SDK ....................................................................................................... 3 Running Your Application ............................................................................................... 4 How to Build Your Application .......................................................................................
Prerequisites Step 1: Install the AD RMS Services Client To run this SDK, you must have the latest version of the AD RMS client installed. If you have an existing older version of the AD RMS client installed, you will need to uninstall the old version first and then download and install the latest version of the AD RMS client from below: For X86: http://us-request.foxitservice.com/products/redirect.php?title=ad_rms_sdk_x86&language=en_ us For X64: http://us-request.foxitservice.com/products/redirect.
Running Your Application In order to run your RMS application you need to generate a signed application manifest. This guide shows how to generate a manifest On your development machine: 1. Copy the following files to a single directory: “Foxit RMS PDF Protection Tool(SDK)\tools\Genmanifest.exe” “Foxit RMS PDF Protection Tool(SDK)\tools\ isvtier5appsigningprivkey.dat” “Foxit RMS PDF Protection Tool(SDK)\tools\ isvtier5appsigningpubkey.dat” “Foxit RMS PDF Protection Tool(SDK)\tools\ isvtier5appsigns
cd %~dp0 genmanifest.exe -chain isvtier5appsignsdk_client.xml YourAppName.mcf YourAppName.exe.man NOTE: Ensure that the file YourAppName.mcf and the file “YourAppName” under YourAppName.exe.man are consistent with the actual ones. 4. You will get a file “YourAppName.exe.man” by double-clicking the file YourAppName.bat. Note: If the program YourAppName.exe has been modified, you should regenerate the file < YourAppName >.exe.man. 5. Copy the following files to your RMS server: < YourAppName >.
hr = FRMS_Initialize(FRMS_API_MODE_CLIENT); if (FRMS_HRESULT_OK != hr) { DisplayFRMSError(hr); goto Exit; } //Release all resources allocated by the SDK library if(Null != hProtector) { FRMSProtector_Release(hProtector); } . NOTE: If failing to call the function, 1. ensure you have called the function FRMS_UnlockLibrary successfully. 2. check whether the AD RMS environment has been set up correctly if the function FRMS_UnlockLibrary is returned successfully. 3. Sets the source to be protected.
goto Exit; } for(int i=0; iGetSafeHwnd(), lpwsIssuer, &nLen); if(hr != FRMS_HRESULT_OK) { DisplayFRMSError(hr); goto Exit; } lpwsIssuer = new wchar_t[nLen]; memset(lpwsIssuer, 0, sizeof(wchar_t)*nLen); //Gets the issuer name by index hr = FRMSProtector_GetIssuer(hProtector, i, this->GetSafeHwnd(), lpwsIssuer, &nLen); if(hr != FRMS_HRESULT_OK) { DisplayFRMSError(hr);
LPWSTR lpwsName = NULL; int nLen = 0; // Gets the length of the template name hr = FRMSProtector_GetTemplateName(hProtector, j, lpwsIssuer, this->GetSafeHwnd(), lpwsName, &nLen); if(hr != FRMS_HRESULT_OK) { DisplayFRMSError(hr); delete [] lpwsIssuer; goto Exit; } lpwsName = new wchar_t[nLen]; memset(lpwsName, 0, sizeof(wchar_t)*nLen); // Gets the name of RMS rights policy template by specified index.
{ DisplayFRMSError(hr); goto Exit; } 9. Throughout this example application the DisplayFRMSError function is being used to handle errors. Example: void DisplayFRMSError(HRESULT hr) { LPWSTR lpwsText = NULL; int nLen = 0; FRMS_HRESULT hrGet = FRMS_GetErrorMessage(hr, 1033, lpwsText, &nLen); if(hrGet == FRMS_HRESULT_OK) { lpwsText = new wchar_t[nLen]; memset(lpwsText, 0, sizeof(wchar_t)*nLen); hrGet = FRMS_GetErrorMessage(hr, 1033, lpwsText, &nLen); wprintf(L"%s\r\n", lpwsText); delete [] lpwsText; } } 10.
FRMS_DISTANCE_TYPE_PERCENT, FRMS_CONTENT_V_POSITION_CENTER);//Sets the content’s verticalposition. hr = FRMSWatermarkNode_SetContentHorizontalPosition(hWatermarkNode, 0, FRMS_DISTANCE_TYPE_PERCENT, FRMS_CONTENT_H_POSITION_CENTER);//Sets content‘s horizontal position. hr = FRMSWatermarkNode_SetImpactPageI(hWatermarkNode, TRUE, 0, 0, FRMS_IMPACT_TYPE_ALL_PAGE);//Sets page(s) that the watermark will be applied to. Once the properties of the watermark is set,it now can be used.
FRMS_HWATERMARKNODE hWatermarkNode = NULL; Hr = FRMSWatermark_GetNodeI(hWatermark, i, &hWatermarkNode); … FRMSWatermarkNode_Release(hWatermarkNode);// After using the watermark node, call this function to release. } If the node’s name is known users can use FRMSWatermark_GetNodeII to get the node.
} hr = FRMSCusTemplate_SetIdentification(hCusTemplate, 0, 1033, L”template name”, L”template description”); hr = FRMSCusTemplate_SetUserAndRights(hCusTemplate, FRMS_USER_TYPE_EVERYYONE, FRMS_RIGHT_VIEW);//Sets read permission for all user. hr = FRMSCusTemplate_SetRequestAdditionalPermission(hCusTemplate, FRMS_DESTINATION_TYPE_URL, NULL);// Pass NULL means user will request additional permission from document owner who encrypts the document, and the destination is an owner’s email.
hr = FRMSCusTemplate_Save(hCusTemplate, NULL);//Update the template’s information. FRMSCusTemplate_Release(hCusTemplate); } Add Security Dynamic Watermark to the File Encrypted by RMS Dynamic security watermarks automatically display viewer identity information on protected PDF files to protect against compromise from screen shots and cameras. If you want to add dynamic security watermarks to a custom template with SDK interface, please refer to How to Build Your Application.
the current document information dynamically and you can use multiple text at the same time. Content ID: shows the content ID of the current document. Document Title: shows the current document title. Author: shows the author of the current document. Current User: shows the current user who is reading the document. Date: shows the current system date when opening the document. Day: shows the current system day when opening the document. Month: shows the current system month when opening the document.
iv.Click OK to finish the operation. Deleting a Watermark Open the Security Watermark Management and select a watermark you want to delete. Click Delete to remove the selected watermark. Exporting a Watermark xi.Open the Security Watermark Management and select a watermark you want to export. xii.Click Export and choose a file type and location to save. xiii.The watermark will be exported as an encoded file (.txt format). 4. Open the file “Add Security Watermark.vbs” in “tool” folder with Notepad.exe. 5.
4. Set the debugging breakpoint behind AfxMessageBox. When you close the dialog box AfxMessageBox, the breakpoint will be activated. For VC6.0: 1. Open regedit.exe and navigate to HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/WindowsNT/CurrentVersion/AeDebug 2. Change the following key values: Key :Auto Value: 0 Key: Debugger Value: C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\msdev.exe" -p %ld -e %ld NOTE: Ensure that “YourAppName.exe” is consistent with the actual msdev.exe.
6. Open Windows Task Manager. 7. Right-click on your application and choose Debug. VC6.0 will be started automatically. i. Open the debug file and set the debugging breakpoint behind AfxMessageBox. When you close the dialog box AfxMessageBox, the breakpoint will be activated. How to Understand Common Error Conditions and Solutions 1.
Action required to fix the error: Please choose the option Start without debugging under the menu Debug of the Visual Studio to debug and run your program. Quick Start for Using Windows Azure AD Right Management Enable Windows Azure AD Rights Management for your organization: Download the Windows Azure AD Rights Management administration module (WindowsAzureADRightsManagementAdministration.exe) for Windows PowerShell from here.
Contact Us Feel free to contact Foxit should you need any information or have any problems with our products. We are always here, ready to serve you better. Office Address: Foxit Corporation 42840 Christy Street. Suite 201 Fremont CA 94538 USA Mailing Address: Foxit Corporation 42840 Christy Street. Suite 201 Fremont CA 94538 USA Sales: 1-866-680-3668 (24/7) Support: 1-866-MYFOXIT or 1-866-693-6948 (24/7) Fax: 530-535-9288 Website: www.foxitsoftware.