- First of all, you need to reference the Ranorex.PDF.dll within our Ranorex project.
This can be done by opening the “Add Reference”-dialog (References -> Add Reference) and adding the DLL.
You should now be able to see the referenced DLL in the reference list in the project view pad. - As a next step, you need to set the target framework of the Ranorex project to .NET Framework 4.0 or above. Therefore open the “Compiling”-tab within the project properties (Project -> Properties).
- After setting the desired .NET Framework you are ready to add the predefined CodeModule “ReportToPDF.cs” to your project. Open the “Add -> Existing Item”-dialog and add the aforementioned UserCodeModule.
- As the last step, simply drag & drop the UserCodeModule to your Ranorex test, for example to the teardown section.
The “ReportToPDF” code module will trigger the conversion of the report at its current state. A message, containing a link to the PDF file, will be logged to the report after the conversion finishes.
Note: The default filename of the generated PDF is the same as the Ranorex report filename but with a different extension (*.pdf).
Reference: http://www.ranorex.com/blog/ranorex-report-to-pdf-conversion/#download