# Configuring Veeva Web2PDF User Actions

<a class="external-link " href="https://www.veevaweb2pdf.com/" target="_blank" rel="noopener">Veeva Web2PDF<i class="fa fa-external-link" aria-hidden="true"></i></a> allows you to easily create PDFs of websites for review. With a document lifecycle state user action, Web2PDF can send an email with a PDF of your website to users. To do this, you need to:

  1. Verify that the _Staging URL_, _Website Protection Username_, _Website Protection Password_, _Members Area Username_, and _Members Area Password_ document fields exist on the document type you want to use with Web2PDF.
  2. Create a web action for Web2PDF.
  3. Create a user action so users can trigger the web action.

## Verifying Document Fields

Before using Veeva Web2PDF in your Vault, the document type you want to use with Web2PDF (such as _Promotional Piece > Web_) must have the following fields. If not, you'll need to [create new document fields](/en/lr/592/).

  * _Staging URL_ or equivalent field; this defines the web address for the site Web2PDF will convert. The web action's URL includes a token for this field to pull in the web address.
  * Optional: _Website Protection Username_ and _Website Protection Password_ fields; these fields are necessary if any of the websites you wish to convert require login credentials before the site loads. IF you need to create these fields, use the following settings:
      * _Website Protection Username_: Type = Text, Maximum Length = 255
      * _Website Protection Password_: Type = Text, Maximum Length = 100
  * Optional: _Members Area Username_ and _Members Area Password_ fields; these fields are necessary if any of the websites you wish to convert have a login page protecting certain areas. If you need to create these fields, use the following settings:
      * _Members Area Username_: Type = Text, Maximum Length = 255
      * _Members Area Password_: Type = Text, Maximum Length = 100
  * Optional: _Device_ and _Orientation_ fields; you can use these fields to specify which device and orientation you wish to generate a PDF for. If you need to create these fields, use the following settings:
      * _Device_: Type = Picklist
      * _Orientation_: Type = Picklist

    You may need to [create these picklists](/en/lr/1269/). Use the following values when creating the picklists:

      * _Device_: Desktop, Smartphone, Tablet
      * _Orientation_: Portrait, Landscape

### Notes

  * The web action URL includes `${User.email__v}`. This token points to the email address for the user who triggers the Web2PDF action. It is not a document field.
  * We recommend configuring the _Device_ picklist document field to be multi-select so that your users can generate combined device PDFs.

## Web Action

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: PromoMats Vaults created after V14 have a Web2PDF web action by default.</p>
    </div>
  </div>
</div>



Before configuring a user action, you need to create a Web2PDF [web action](/en/lr/21270/). The following shows the necessary information for your web action.

Document
: Field: Type
: This web action only works with documents.

`https://www.veevaweb2pdf.com/crawl/crawlStartGet?url=${Document.staging_url__vs}&emailTo=${User.email__v}`
: Field: URL
: Use this URL if none of your websites require login credentials. `Document.staging_url__vs` defines the URL for the website Web2PDF will convert, and emailTo points to the email address for the user who triggered this action.

`https://www.veevaweb2pdf.com/crawl/crawlStartGet?url=${Document.staging_url__vs}&emailTo=${User.email__v}&username=${Document.staging_username__c}&password=${Document.staging_password__c}`
: Field: URL
: Use this URL if any of your websites require login credentials, captured in the `Document.staging_username__c` and `Document.staging_password__c tokens`.

`https://www.veevaweb2pdf.com/crawl/crawlStartGet?url=${Document.staging_url__vs}&emailTo=${User.email__v}&device=${Document.device__c}&orientation=${Document.orientation__c}`
: Field: URL
: Use this URL if your website does not require login credentials, but you want to specify a device (`Document.device__c`) and an orientation (`Document.orientation__c`) for Web2PDF to use when converting the website.

`https://www.veevaweb2pdf.com/crawl/crawlStartGet?url=${Document.staging_url__vs}&emailTo=${User.email__v}&memberUsername=${Document.members_area_username__c}&memberPassword=${Document.members_area_password__c}`
: Field: URL
: Use this URL if any of your websites require Members Only area credentials, captured in the `Document.members_area_username__c` and `Document.members_area_password__c tokens`.

`https://www.veevaweb2pdf.com/crawl/crawlStartGeturl=${Document.staging_url__vs}&emailTo=${User.email__v}&username=${Document.staging_username__c}&password=${Document.staging_password__c}&device=${Document.device__c}&orientation=${Document.orientation__c}`
: Field: URL
: Use this URL if your website require login credentials, and you want to specify a device (`Document.device__c`) and an orientation (`Document.orientation__c`) for Web2PDF to use when converting the website.

`https://www.veevaweb2pdf.com/crawl/crawlStartGet?url=${Document.staging_url__vs}&emailTo=${User.email__v}&username=${Document.staging_username__c}&password=${Document.staging_password__c}}&memberUsername=${Document.members_area_username__c}&memberPassword=${Document.members_area_password__c}&device=${Document.device__c}&orientation=${Document.orientation__c}`
: Field: URL
: Use this URL if your website requires password protection and a Members Only area, and you want to specify a device (`Document.device__c`) and an orientation (`Document.orientation__c`) for Web2PDF to use when converting the website.

`https://www.veevaweb2pdf.com/crawl/crawlStartGet?url=${Document.staging_url_c}&emailTo=${User.emailv}&device=${Document.staging_devicec}&pageVisitedLimit=1&orientation=${Document.staging_orientation_c}`
: Field: URL
: Use this URL if you want Web2PDF to convert only the landing page (`pageVisitedLimit=1`) of the website staging URL.

### Notes

Veeva Web2PDF uses the TruWeb 3 engine by default. This is the recommended engine. If you experience issues with this engine, you can use the v2 engine by appending `&engine=2` to the end of the staging URL.

## User Action

You can add one or more user actions with the Web2PDF web action to any document lifecycle states you want to generate PDFs from. We recommend that you make the user action conditional, so that it only appears for documents that are websites with the URL included.

  * _Staging URL_ is not blank.
  * _Document type_ equals [the document type you plan to use with Web2PDF]. For example, _Document type_ equals _Promotional Piece > Web_.
