PrintUrlToPdf
The PrintUrlToPdf activity prints a URL to a PDF file. The URL attribute in this activity is referred to as the "viewCreator" link. The link contains the forms, the Workflow Definition ID, and the RendererBaseUrl.
As of Forms Builder 3.5, the "viewCreator" feature is available for authenticated and anonymous sequences.
The PrintUrlToPdf activity can be placed in the Action area of a form (state) that requires e-signatures. A Persist activity should always precede the PrintUrlToPdf activity.
In Forms Builder 3.5 and later, the PrintUrlToPdf activity allows an empty URL input argument. The activity constructs the URL using:
- formInstance.RendererBaseUrl
- formInstance.WorkflowDefinitionId
- formInstance.FormsTraversed
This addresses the common scenario whereby all forms need to be included in the PDF by eliminating the need to type every form name with perfect casing for the URL. Backward compatibility is maintained by allowing users to create the URL and list of forms for the PDF output.
In Forms Builder 3.7 and later, the Culture argument can be used to create a PDF in a language that is different from the language (culture) selected when the form sequence was rendered. If the Culture argument is not specified, the PDF will be created in the culture selected when the sequence was rendered. For more information, see Culture.
Workflow Example
The following images show segments of a workflow in a DocuSign scenario. In this example the Assign activity preceding the PrintUrlToPdf activity assigns the following URL:
formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal+Info"
(where CMC_Student_Personal+Info is the name of the form that contains the DocuSign components).
Note: Spaces in form names must be replaced with a “+” when setting viewCreator URL.
At start of the sequence, the workflow finds the student that was authenticated.
Next, the workflow finds the document tracking record associated with the student. The LookupReferenceItem activity returns the document type that will be used as input for the LookupStudent Documents activity.
The LookupStudentDocuments activity returns an array of documents in variable docArray(0). The selected student should only have one document.
Assign activities set the document properties required for the SaveDocument activity.
Usage Notes
Sequences with File Upload Component
If the sequence you want to capture using the PrintUrlToPdf activity contains a File Upload component and you want to capture the image of the file selection in the File Upload component, be sure to place the PrintUrlToPdf activity before the GetAttachments activity, otherwise the file selection in the File Upload component will not be captured in the PDF file.
Multi Page Forms
On any longer forms that spread across multiple pages when converted to PDF, drop an HTML component just prior to the DocuSign control that appears close to the page break and specify the following in the Class Property: forms_builder_page_break
. For more information, see Error Code "TAB_OUT_OF_BOUNDS" - DocuSign.
PrintUrlToPdf Times Out
In Forms Builder 3.3 and later, the viewCreator wait is no longer timer-based, it is now event-based. Forms may need to be re-saved, which will automatically update components to include a call to the event-based method "cmc-on-initialized". If PrintUrlToPdf times out, especially when many documents are merged into a single PDF file, simply re-save all forms in the sequence.
Incompatible Components
Do not use the CAPTCHA and Hyperlink components in forms that will be converted to PDF with the PrintUrlToPdf activity.
Auxiliary Service
The PrintUrlToPdf activity relies on an auxiliary service that performs the conversion to PDF for Azure deployments. This service is referenced in the <appSettings>
section of the Renderer web.config file as highlighted below.
Note: In Forms Builder 3.7, the names of the auxiliary service keys are changed:
From | AuxiliaryServiceBaseUrl |
to | PdfConversionServiceBaseUrl |
From | UseRemotePDFConverterService |
to | UseRemotePdfConversionService |
For on-premise deployments, the service is not required, and the UseRemotePdfConversionService
value will be set to false (default).
<appSettings>
<add key="ConfigureCampusNexusWcfProxy" value="true" />
<add key="ConfigureCVueNexusWcfProxy" value="true" />
<!-- Following will be populated when Crm is enabled for Forms Builder -->
<add key="CmcNexusCrmWebUrl" value="http://<server>.campusmgmt.com:8090/" />
<add key="PaymentProvider" value="PayPal" />
<add key="PdfConversionServiceBaseUrl" value="" />
<!-- Following should be set to true only in Azure environments where the Auxiliary service is installed and required. -->
<add key="UseRemotePdfConversionService" value="false" />
</appSettings>
For Azure deployments, the UseRemotePdfConversionService
value will be set to true, and value of the PdfConversionServiceBaseUrl
will be:
https://110001pdfrenderer.campusnexus.cloud/
This URL will be the same for all customers.
Properties
Property | Value | Required | Notes |
---|---|---|---|
Culture | InArgument<String>
|
No | If you want a PDF to be generated in a language other than the language selected by the student in the rendered form sequence, specify the Culture code, e.g., "fr" for French or "es" for Spanish. You can create a workflow with two PrintUrlToPdf activities where the first activity creates a PDF in the language selected by the student (with the student's signature if applicable) and the second PrintUrlToPdf activity creates the PDF in a different language for the staff member (without the student's signature). Notes:
|
DisplayName | String
|
No | Specify a name for the activity or accept the default. |
Forms | InArgument<String>
|
No | Optionally, specify a comma separated list of form names to include in the PDF. You do not need to replace spaces with plus signs in this list. The Forms property value is ignored if the Url is not empty, in other words, if the Url property is specified, it takes precedence. If both the Url and Forms properties are left empty, the activity creates the Url automatically. |
PdfDocument | OutArgument<Byte[]>
|
Yes | Specify the PDF byte output array using a VB expression or variable. To identify the variable type, in the Variable type field of the Variables pane, select Browse for Types.... In the "Browse and Select a .NET Type" window, select Array of [T], navigate to mscorlib [4.0.0.0] > System, select Byte, and click OK. |
Url | InArgument<String>
|
No | Forms Builder 3.5 and later allows an empty URL input argument. The activity constructs the Url using:
This addresses the common scenario whereby all forms need to be included in the PDF by eliminating the need to type every form name with perfect casing for the Url. Backward compatibility is maintained by allowing users to create the Url and list of forms for the PDF output. The activity constructs the Url only if both the Forms and Url properties are left blank. If the Url property is specified, it takes precedence. Specify the Url using a VB expression or variable. Examples The following URL indicates a PDF that is created for a form named "CMC_Student_Personal Info": formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal+Info" The following URL indicates a PDF that is created for multiple forms in a single document. Note the comma separated list after "forms=". formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal+Info,CMC_Student_Additional+Info” Note: If mistakes are made in the form name for the URL, the following message will be in found in the log, but no indication of failure will be seen in the rendered sequence (no toaster popup), and the validationMessages argument will not be set. Additionally, the PDF will be created but will contain only the error message.
|
ValidationMessages | InOutArgument |
No | Specify a variable that can be used to capture validation messages. |
Page Breaks in PDF Files
The following styles determine the default PDF pagination scheme. They can be modified if some other pagination scheme is needed. Save your changes to a custom style sheet. For more information, see Custom Content and Custom Styles.
@media print {
#viewCreatorForm > div:not(:first-child) {
page-break-before: always;
}
}/* The above @media print does not address page breaks within a long form. DocuSign may reject PDF files where DocuSign signatures cross page boundaries in the PDF files, usually with an error like "TAB_OUT_OF_BOUNDS". Adding appropriate pages breaks is best accommodated by adding an HTML component in the form anywhere before a page break is required. Leave the HTML control empty but add the unique class name on the Class Property Setting that is used below: forms_builder_page_break. Then the following will force a page break in the PDF file before the control.
@media print {
*/
.forms_builder_page_break {
page-break-before: always;
}
}
The following css code would insert page breaks after a footer or before an h1 heading.
@media print {
footer {page-break-after: always;}
}
— OR —
@media print {
h1 {page-break-before: always;}
}
The PrintUrlToPdf activity prints a URL to a PDF file. The URL attribute in this activity is referred to as the "viewCreator" link. The link contains the forms, the Workflow Definition ID, and the RendererBaseUrl.
As of Forms Builder 3.5, the "viewCreator" feature is available for authenticated and anonymous sequences.
The PrintUrlToPdf activity can be placed in the Action area of a form (State) that requires DocuSign signatures. A Persist activity should always precede the PrintUrlToPdf activity.
In Forms Builder 3.5 and later, the PrintUrlToPdf activity allows an empty URL input argument. The activity constructs the URL using:
- formInstance.RendererBaseUrl
- formInstance.WorkflowDefinitionId
- formInstance.FormsTraversed
This addresses the common scenario whereby all forms need to be included in the PDF by eliminating the need to type every form name with perfect casing for the URL. Backward compatibility is maintained by allowing users to create the URL and list of forms for the PDF output.
Workflow Example
The following images show segments of a workflow in a DocuSign scenario. In this example the Assign activity preceding the PrintUrlToPdf activity assigns the following URL:
formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal+Info"
(where CMC_Student_Personal+Info is the name of the form that contains the DocuSign components).
Note: Spaces in form names must be replaced with a “+” when setting viewCreator URL.
At start of the sequence, the workflow finds the student that was authenticated.
Next, the workflow finds the document tracking record associated with the student. The LookupReferenceItem activity returns the document type that will be used as input for the LookupStudent Documents activity.
The LookupStudentDocuments activity returns an array of documents in variable docArray(0). The selected student should only have one document.
Assign activities set the document properties required for the SaveDocument activity.
Usage Notes
Sequences with File Upload Component
If the sequence you want to capture using the PrintUrlToPdf activity contains a File Upload component and you want to capture the image of file selection in the File Upload component, be sure to place the PrintUrlToPdf activity before the GetAttachments activity, otherwise the file selection in the File Upload component will not be captured in the PDF file.
Multi Page Forms
On any longer forms that spread across multiple pages when converted to PDF, drop an HTML component just prior to the DocuSign control that appears close to page break and specify the following in the Class Property: forms_builder_page_break
. For more information, see Error Code "TAB_OUT_OF_BOUNDS" - DocuSign.
PrintUrlToPdf Times Out
In Forms Builder 3.3 and later, the viewCreator wait is no longer timer-based, it is now event-based. Forms may need to be re-saved, which will automatically update components to include a call to the event-based method "cmc-on-initialized". If PrintUrlToPdf times out, especially when many documents are merged into a single PDF file, simply re-save all forms in the sequence.
Incompatible Components
Do not use the CAPTCHA and Hyperlink components in forms that will be converted to PDF with the PrintUrlToPdf activity.
AuxiliaryService
The PrintUrlToPdf activity relies on an auxiliary service that performs the conversion to PDF for Azure deployments. This service is referenced in the <appSettings>
section of the Renderer web.config file as highlighted below.
For on-premise deployments, the service is not required, and the UseRemotePDFConverterService
value will be set to false (default).
For Azure deployments, the UseRemotePDFConverterService
value will be set to true, and value of the AuxiliaryServiceBaseUrl
will be:
https://110001pdfrenderer.campusnexus.cloud/
This URL will be the same for all customers.
<appSettings>
<add key="ConfigureCampusNexusWcfProxy" value="true" />
<add key="ConfigureCVueNexusWcfProxy" value="true" />
<!-- Following will be populated when Crm is enabled for Forms Builder -->
<add key="CmcNexusCrmWebUrl" value="http://<server>.campusmgmt.com:8090/" />
<add key="PaymentProvider" value="PayPal" />
<add key="AuxiliaryServiceBaseUrl" value="" />
<!-- Following should be set to true only in Azure environments where the Auxiliary service is installed and required. -->
<add key="UseRemotePDFConverterService" value="false" />
</appSettings>
Properties
Property | Value | Required | Notes |
---|---|---|---|
DisplayName | String
|
No | Specify a name for the activity or accept the default. |
Forms | InArgument<String>
|
No |
Optionally, specify a comma separated list of form names to include in the PDF. You do not need to replace spaces with plus signs in this list. The Forms property value is ignored if the Url is not empty, in other words, if the Url property is specified, it takes precedence. If both the Url and Forms properties are left empty, the activity creates the Url automatically. |
PdfDocument | OutArgument<Byte[]>
|
Yes | Specify the DocuSignDocuments array using a VB expression or variable. To identify the variable type, in the Variable type field of the Variables pane, select Browse for Types.... In the "Browse and Select a .NET Type" window, select Array of [T], navigate to mscorlib [4.0.0.0] > System, select Byte, and click OK. |
Url | InArgument<String>
|
No | Forms Builder 3.5 and later allows an empty URL input argument. The activity constructs the Url using:
This addresses the common scenario whereby all forms need to be included in the PDF by eliminating the need to type every form name with perfect casing for the Url. Backward compatibility is maintained by allowing users to create the Url and list of forms for the PDF output. The activity constructs the Url only if both the Forms and Url properties are left blank. If the Url property is specified, it takes precedence. Specify the Url using a VB expression or variable. Examples The following URL indicates a PDF that is created for a form named "CMC_Student_Personal Info": formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal+Info" The following URL indicates a PDF that is created for multiple forms in a single document. Note the comma separated list after "forms=". formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal+Info,CMC_Student_Additional+Info” Note: If mistakes are made in the form name for the URL, the following message will be in found in the log, but no indication of failure will be seen in the rendered sequence (no toaster popup), and the validationMessages argument will not be set. Additionally, the PDF file will be created but will contain only the error message.
|
ValidationMessages | InOutArgument |
No | Specify a variable that can be used to capture validation messages. |
The following styles determine the default PDF pagination scheme. They can be modified if some other pagination scheme is needed. Save your changes to a custom style sheet. For more information, see Custom Content and Custom Styles.
@media print {
#viewCreatorForm > div:not(:first-child) {
page-break-before: always;
}
}/* The above @media print does not address page breaks within a long form. DocuSign may reject PDF files where DocuSign signatures cross page boundaries in the PDF files, usually with an error like "TAB_OUT_OF_BOUNDS". Adding appropriate pages breaks is best accommodated by adding an HTML component in the form anywhere before a page break is required. Leave the HTML control empty but add the unique class name on the Class Property Setting that is used below: forms_builder_page_break. Then the following will force a page break in the PDF file before the control.
@media print {
*/
.forms_builder_page_break {
page-break-before: always;
}
}
The following css code would insert page breaks after a footer or before an h1 heading.
@media print {
footer {page-break-after: always;}
}
— OR —
@media print {
h1 {page-break-before: always;}
}
The PrintUrlToPdf activity prints a URL to a PDF file. The URL attribute in this activity is referred to as the "viewCreator" link. The link contains the forms, the Workflow Definition ID, and the RendererBaseUrl.
As of Forms Builder 3.5, the "viewCreator" feature is available for authenticated and anonymous sequences.
The PrintUrlToPdf activity can be placed in the Action area of a form (State) that requires DocuSign signatures. A Persist activity should always precede the PrintUrlToPdf activity.
In Forms Builder 3.5 and later, the PrintUrlToPdf activity allows an empty URL input argument. The activity constructs the URL using:
- formInstance.RendererBaseUrl
- formInstance.WorkflowDefinitionId
- formInstance.FormsTraversed
This addresses the common scenario whereby all forms need to be included in the PDF by eliminating the need to type every form name with perfect casing for the URL. Backward compatibility is maintained by allowing users to create the URL and list of forms for the PDF output.
The following images show segments of a workflow in a DocuSign scenario. In this example the Assign activity preceding the PrintUrlToPdf activity assigns the following URL:
formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal+Info"
(where CMC_Student_Personal+Info is the name of the form that contains the DocuSign components).
Note: Spaces in form names must be replaced with a “+” when setting viewCreator URL.
At start of the sequence, the workflow finds the student that was authenticated.
Next, the workflow finds the document tracking record associated with the student. The LookupReferenceItem activity returns the document type that will be used as input for the LookupStudent Documents activity.
The LookupStudentDocuments activity returns an array of documents in variable docArray(0). The selected student should only have one document.
Assign activities set the document properties required for the SaveDocument activity.
Notes
-
If the sequence you want to capture using the PrintUrlToPdf activity contains a File Upload component and you want to capture the image of file selection in the File Upload component, be sure to place the PrintUrlToPdf activity before the GetAttachments activity, otherwise the file selection in the File Upload component will not be captured in the PDF file.
-
On any longer forms that spread across multiple pages when converted to PDF, drop an HTML component just prior to the DocuSign control that appears close to page break and specify the following in the Class Property:
forms_builder_page_break
. For more information, see Error Code "TAB_OUT_OF_BOUNDS" - DocuSign. -
In Forms Builder 3.3 and later, the viewCreator wait is no longer timer-based, it is now event-based. Forms may need to be re-saved, which will automatically update components to include a call to the event-based method "cmc-on-initialized". If PrintUrlToPdf times out, especially when many documents are merged into a single PDF file, simply re-save all forms in the sequence.
-
Do not use the CAPTCHA and Hyperlink components in forms that will be converted to PDF with the PrintUrlToPdf activity.
-
The PrintUrlToPdf activity relies on an auxiliary service that performs the conversion to PDF for Azure deployments. This service is referenced in the
<appSettings>
section of the Renderer web.config file as highlighted below.For on-premise deployments the service is not required, and the
UseRemotePDFConverterService
value will be set to false (default).For Azure deployments the
UseRemotePDFConverterService
value will be set to true, and value of theAuxiliaryServiceBaseUrl
will be:https://110001pdfrenderer.campusnexus.cloud/
This URL will be the same for all customers.
<appSettings>
<add key="ConfigureCampusNexusWcfProxy" value="true" />
<add key="ConfigureCVueNexusWcfProxy" value="true" />
<!-- Following will be populated when Crm is enabled for Forms Builder -->
<add key="CmcNexusCrmWebUrl" value="http://<server>.campusmgmt.com:8090/" />
<add key="PaymentProvider" value="PayPal" />
<add key="AuxiliaryServiceBaseUrl" value="" />
<!-- Following should be set to true only in Azure environments where the Auxiliary service is installed and required. -->
<add key="UseRemotePDFConverterService" value="false" />
</appSettings>
Property | Value | Required | Notes |
---|---|---|---|
DisplayName | String
|
No | Specify a name for the activity or accept the default. |
Forms | InArgument<String>
|
No |
Optionally, specify a comma separated list of form names to include in the PDF. You do not need to replace spaces with plus signs in this list. The Forms property value is ignored if the Url is not empty, in other words, if the Url property is specified, it takes precedence. If both the Url and Forms properties are left empty, the activity creates the Url automatically. |
PdfDocument | OutArgument<Byte[]>
|
Yes | Specify the DocuSignDocuments array using a VB expression or variable. To identify the variable type, in the Variable type field of the Variables pane, select Browse for Types.... In the "Browse and Select a .NET Type" window, select Array of [T], navigate to mscorlib [4.0.0.0] > System, select Byte, and click OK. |
Url | InArgument<String>
|
No | Forms Builder 3.5 and later allows an empty URL input argument. The activity constructs the Url using:
This addresses the common scenario whereby all forms need to be included in the PDF by eliminating the need to type every form name with perfect casing for the Url. Backward compatibility is maintained by allowing users to create the Url and list of forms for the PDF output. The activity constructs the Url only if both the Forms and Url properties are left blank. If the Url property is specified, it takes precedence. Specify the Url using a VB expression or variable. Examples The following URL indicates a PDF that is created for a form named "CMC_Student_Personal Info": formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal+Info" The following URL indicates a PDF that is created for multiple forms in a single document. Note the comma separated list after "forms=". formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal+Info,CMC_Student_Additional+Info” Note: If mistakes are made in the form name for the URL, the following message will be in found in the log, but no indication of failure will be seen in the rendered sequence (no toaster popup), and the validationMessages argument will not be set. Additionally, the PDF file will be created but will contain only the error message.
|
ValidationMessages | InOutArgument |
No | Specify a variable that can be used to capture validation messages. |
Setting Page Breaks in PDF Files
The following styles are set in Content/styles.css in Renderer. The styles set the default PDF pagination scheme. They can be modified in the file if some other pagination scheme is needed.
@media print {
#viewCreatorForm > div:not(:first-child) {
page-break-before: always;
}
}/* The above @media print does not address page breaks within a long form. DocuSign may reject PDF files where DocuSign signatures cross page boundaries in the PDF files, usually with an error like "TAB_OUT_OF_BOUNDS". Adding appropriate pages breaks is best accommodated by adding an HTML component in the form anywhere before a page break is required. Leave the HTML control empty but add the unique class name on the Class Property Setting that is used below: forms_builder_page_break. Then the following will force a page break in the PDF file before the control.
@media print {
*/
.forms_builder_page_break {
page-break-before: always;
}
}
The following css code would insert page breaks after a footer or before an h1 heading.
@media print {
footer {page-break-after: always;}
}
— OR —
@media print {
h1 {page-break-before: always;}
}
If you modify the styles, don’t forget to back up the changes and reapply them after an update of Forms Builder because a new styles.css file will be deployed with an update of Forms Builder.