Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Generating PDFs and attaching them to work objects or viewing them in a web browser

Updated on September 20, 2019

Summary

Process Commander contains seven standard activities that enable you to generate Portable Document Format (PDF) versions of reports or HTML source and either display them in a Web browser or attach them to existing work objects.

  • Rule-Obj-ListView.ViewAsPDF
  • Rule-Obj-ListView.AttachAsPDF
  • Rule-Obj-SummaryView.ViewAsPDF
  • Rule-Obj-SummaryView.AttachAsPDF
  • @baseclass.HTMLToPDF
  • Code-Pega-PDF.View
  • Code-Pega-PDF.AttachToWork

The first four activities (Rule-Obj-ListView.ViewAsPDF, Rule-Obj-ListView.AttachAsPDF, Rule-Obj-SummaryView.ViewAsPDF, Rule-Obj-SummaryView.AttachAsPDF) enable you to generate a PDF from a list view or summary view and either display it in your web browser or attach it to a work object.

The last three activities (@baseclass.HTMLToPDF, Code-Pega-PDF.View, Code-Pega-PDF.AttachToWork) enable you to generate a PDF from any HTML source and either display it in your web browser or attach it to a work object.

Creating PDFs to display in a web browser or attaching them to work objects can be used in a number of ways. For example, using an agent rule, you could create a nightly work object that:

  • identifies all open assignments
  • generates a summary view report grouping all open assignments by operator
  • runs the Rule-Obj-SummaryView.AttachAsPDF to generate and attach a PDF to the work object
  • emails the work object to a manager for review

Suggested Approach

List View Activities

Rule-Obj-ListView.ViewAsPDF

The Rule-Obj-ListView.ViewAsPDF activity uses data from the list view found on the clipboard to generate a PDF that displays directly in your web browser.

  1. On the Rule-Obj-ListView.ViewAsPDF activity rule form, click Run to display the Run Rule window.
  1. In the Run Rule window, enter the appropriate values for the parameters of the activity:
    ParametersValue
    DefinitionPageNameRequired. Enter the name of the list view that will be generated as a PDF.
    DataPageNameEnter the content page of the list view. The content page is located on the Contents tab of the list view rule form.
    AlternateStreamOptional. You can enter a custom style sheet (CSS) to change the way the PDF displays in the web browser.
  1. Click Execute. Using the data found on the clipboard, a PDF of the list view will display in your web browser.

 

Rule-Obj-ListView.AttachAsPDF

The Rule-Obj-ListView.AttachAsPDF activity generates a PDF of the list view report and then attaches it to a work object based on the pzInsKey given.

  1. On the Rule-Obj-ListView.AttachAsPDF activity rule form, click Run to display the Run Rule window.
  1. In the Run Rule window, enter the appropriate values for the parameters of the activity:
    ParametersValue
    DefinitionPageNameRequired. Enter the name of the list view that will be generated as a PDF.
    DataPageNameEnter the content page of the list view. The content page is located on the Contents tab of the list view rule form.
    AlternateStreamOptional. Enter a custom style sheet (CSS) to change the way the PDF displays in the web browser.
    PDFNameEnter the name of the PDF to generate.
    InsHandleEnter the pzInsKey of the work object the PDF attaches to.
  1. Click Execute. Using the parameters entered, a PDF of the list view generates and is attached to the work object specified.

 

Summary View Activities

Rule-Obj-SummaryView.ViewAsPDF

The Rule-Obj-SummaryView.ViewAsPDF activity uses data from the summary view found on the clipboard to generate a PDF that displays directly in your web browser.

  1. On the Rule-Obj-SummaryView.ViewAsPDF activity rule form, click Run to display the Run Rule window.
  1. In the Run Rule window, enter the appropriate values for the parameters of the activity:
    ParametersValue
    DefinitionPageNameRequired. Enter the name of the summary view that will be generated as a PDF.
    DataPageNameEnter the content page of the summary view. The content page is located on the Contents tab of the list view rule form.
    AlternateStreamOptional. You can enter a custom style sheet (CSS) to change the way the PDF displays in the web browser.
  1. Click Execute. Using the data found on the clipboard, a PDF of the summary view will display in your web browser.

 

Rule-Obj-SummaryView.AttachAsPDF

The Rule-Obj-SummaryView.AttachAsPDF activity generates a PDF of the summary view and then attaches it to a work object based on the pzInsKey given.

  1. On the Rule-Obj-SummaryView.AttachAsPDF activity rule form, click Run to display the Run Rule window.

  1. In the Run Rule window, enter the appropriate values for the parameters of the activity:
    ParametersValue
    DefinitionPageNameRequired. Enter the name of the summary view that will be generated as a PDF.
    DataPageNameEnter the content page of the summary view. The content page is located on the Contents tab of the summary view rule form.
    AlternateStreamOptional. Enter a custom style sheet (CSS) to change the way the PDF displays in the web browser.
    PDFNameEnter the name of the PDF to generate.
    InsHandleEnter the pzInsKey of the work object the PDF attaches to.
  1. Click Execute. Using the parameters entered, a PDF of the summary view generates and is attached to the work object specified.

 

HTML activities

@baseclass.HTMLToPDF

The @baseclass.HTMLToPDF activity converts a HTML source to a PDF document in the form of a byte array.

  1. On the @baseclass.HTMLToPDF activity rule form, click Run to display the Run Rule window.

  1. In the Run Rule window, enter the appropriate values for the parameters of the activity:
    ParametersValue
    MarkupHTML markup to convert to PDF.
    StreamNameHTML rule stream name (second key part).
    PDFDocumentEnter the name of the PDF that will be generated.
  1. Click Execute.

 

Code-Pega-PDF.View

The Code-Pega-PDF.View activity converts a PDF byte array into a HTML source and displays it directly in your web browser.

  1. On the Code-Pega-PDF.View activity rule form, click Run to display the Run Rule window.

  1. In the Run Rule window, enter the appropriate values for the parameters of the activity:
    ParametersValue
    PDFNameEnter the name of the PDF to generate.
    PDFDocumentPDF Document as a byte array.
  1. Click Execute.

 

Code-Pega-PDF.AttachToWork

The Code-Pega-PDF.AttachToWork activity converts a HTML source into a PDF document and then attaches it to a work object based on the pzInsKey given.

  1. On the Code-Pega-PDF.View activity rule form, click Run to display the Run Rule window.

  1. In the Run Rule window, enter the appropriate values for the parameters of the activity:
ParametersValue
PDFNameEnter the name of the PDF to generate.
PDFDocumentPDF Document as a byte array.
InsHandleEnter the pzInsKey of the work object the PDF attaches to.
  1. Click Execute.

 

Example

In the following example a Quote Request application allows users to request home insurance premium quotes. A quote object is created for each quote request. A list view report (WorkListView) provides quote request information including the quote ID, quote type, and the date/time the quote object was created.

To generate a PDF of this list view report and display it in your web browser, you need to create an activity that runs the list view report and then converts it to a PDF that displays in your web browser.

  1. Create an activity that calls the activities needed to run the list view (placing the contents of it on the clipboard), generate a PDF of the list view report, and display it in your web browser.
  2. On the Steps tab, enter the activity steps that will set the parameters of the list view, run the list view report, and generate a PDF from the list view and display it in your web browser.
    1. The first activity step sets the parameters for the list view.

    1. The second activity step calls the Rule-Obj-ListView.ShowView activity which runs the list view and places its contents on the clipboard.

    1. The third activity step calls the Rule-Obj-ListView.ViewAsPDF activity which converts the list view report into a PDF document and displays it in your web browser.

  1. Click the Run button. The Run Rule window displays. Click Execute to run the activity.
  2. A file download window displays.
  3. Click Open. The PDF of the list view displays in your web browser.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us