---
schema_version: "1"
id: 760f3c557f17808631f25669976b9bc6d27e2af2845766593a57866c57a65f0d
title: Convert Client-Side Documents into PDF Files
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/doc_gen_foundation_docgenerationsample_fndmultipdfconvertlwc_omniscript__394874.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.doc_gen_foundation_docgenerationsample_fndmultipdfconvertlwc_omniscript__394874.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: fb91e2fef84c01b76ce49ed935003065da9ac077dff4c1c79b2e8af5ba515534
description: The fndmultiPDFConvertLwc Omniscript converts a generated Microsoft Word (.docx) or Microsoft PowerPoint (.pptx) document into a .pdf file. This Omniscript can convert one or more documents simultaneously into .pdf format.
products:
  - Omnistudio Document Generation
release: "264"
---
# Convert Client-Side Documents into PDF Files

The fndmultiPDFConvertLwc Omniscript converts a generated Microsoft Word (.docx) or Microsoft PowerPoint (.pptx) document into a .pdf file. This Omniscript can convert one or more documents simultaneously into .pdf format.

To make the Omniscript easily available to your sales reps, create a custom button. For more information, see [Create a Custom Generate Document Button](https://help.salesforce.com/s/articleView?id=ind.doc_gen_create_a_custom_generate_document_button_394436.htm&release=264.0.0&type=5 "Generate documents from any object such as a contract, order, quote, work order, or opportunity by integrating Omniscript into a custom button. This example uses the fndSingleDocxLwc Omniscript to generate single client-side documents from Microsoft Word .docx or Microsoft PowerPoint .pptx templates.")

## Using the fndmultiPDFConvertLwc Omniscript

Here's an example workflow for how a sales rep might use this Omniscript.

1. Enter Object Id
    
    Enter the object ID, such as a contract ID.
    
    **ObjectId**: ID of the Salesforce Object from which the system retrieves data for the document.
    
    ![In this window enter the ID of the Salesforce Object from which you want to retrieve data for the document.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-document_generation-264-0-0-production-enus/f76d5573-56ce-4576-b4b2-7a4f1f2e622b/document_generation/images/clm234_multipdfconvertlwcomniscript_step1.png)
2. Generation Options
    
    Either use the default values or select different values to download, attach, generate the document, and generate the .pdf file. If you want the fields to be blank, select the **\--clear--** option.
    
    **Document Title**: Create different document titles for the .docx or .pptx documents that you want to generate by using commas to separate the document titles. Document Title is a mandatory field in Document Generation 2.0.
    
    **Docx Content Version Ids**: ID of a previously generated .docx or .pptx document that you want to convert into a .pdf format. Use commas to separate the Content Version IDs. You can obtain the content version Ids from the Developer Console. For more information, see [Search for Docx Content Version IDs from Developer Console](https://help.salesforce.com/s/articleview?id=ind.v_contracts_t_search_for_docx_content_version_ids_from_developer_console__389350.htm&type=5).
    
    ![In the Generation Options window, you ​can select values to download, attach, generate the document.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-document_generation-264-0-0-production-enus/f76d5573-56ce-4576-b4b2-7a4f1f2e622b/document_generation/images/clm236_fndmultipdfconvertlwcomniscript_generationoptions.png)
3. Generate Document
    
    The Omniscript generates the document, and you can download the document according to your generation options.
    
    ![The Generate Document display the generated document, and you can download the document from this window.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-document_generation-264-0-0-production-enus/f76d5573-56ce-4576-b4b2-7a4f1f2e622b/document_generation/images/clm234_multipdfconvertlwcomniscript_step3.png)

## Step Properties for the fndmultiPDFConvertLwc Omniscript

The fndmultiPDFConvertLwc Omniscript contains steps that run sequentially when you invoke the Omniscript. Each step has properties that determine the action that the step performs. If you want to change the steps, Salesforce recommends that you either create a version or clone and rename a copy of the fndmultiPDFConvertLwc Omniscript.

Use this information to modify the Omniscript to meet your specific needs. To see an example of a modified document generation Omniscript, refer to [Customize the fndSingleDocxLwc Omniscript](https://help.salesforce.com/s/articleView?id=ind.doc_gen_customize_fndsingledocxlwc_omniscript_394579.htm&release=264.0.0&type=5 "You can customize the fndSingleDocxLwc Omniscript according to your requirements. In this example, customize the Omniscript to set a default template and hide the pick a template window during the document generation process.")

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d11439e127">
              <p style="margin-bottom:0;">Omniscript Step</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d11439e132">
              <p style="margin-bottom:0;">Properties</p>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Omniscript Step" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e127 ">
              <p style="margin-bottom:0;">Script Configuration</p>
            </td>
            <td data-label="Properties" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e132 ">
              <p>These fields are preset.</p>
              <ul>
                <li>
                  <p>
                    <strong class="uicontrol">Type</strong>: docGenerationSample
                  </p>
                </li>
                <li>
                  <p>
                    <strong class="uicontrol">SubType</strong>: fndMultiPDFConvertLwc
                  </p>
                </li>
              </ul>
            </td>
          </tr>
          <tr class="">
            <td data-label="Omniscript Step" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e127 ">
              <p style="margin-bottom:0;">EnterDetails</p>
            </td>
            <td data-label="Properties" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e132 ">
              <p style="margin-bottom:0;">
                <strong class="uicontrol">objectId</strong> : Salesforce Object ID that the system
                assigns to contextID later in the Set Values step.
              </p>
            </td>
          </tr>
          <tr class="">
            <td data-label="Omniscript Step" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e127 ">
              <p style="margin-bottom:0;">GenerationOptions</p>
            </td>
            <td data-label="Properties" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e132 ">
              <p>Selects the values for generation options as shown here:</p>
              <ul>
                <li>
                  <p>
                    <strong class="uicontrol">DownloadFileFormat</strong> : Document type for download:
                    <code>PDF</code> (default) or <code>None</code>.
                  </p>
                </li>
                <li>
                  <p>
                    <strong class="uicontrol">AttachFileFormat</strong> : Document type for attachment:
                    <code>PDF</code> (default) or <code>None</code>.
                  </p>
                </li>
                <li>
                  <p>
                    <strong class="uicontrol">DocumentViewer</strong> : Preview format:
                    <code>ClientSideViewer</code> (default) or <code>None</code>. A value of
                    <code>None</code> indicates that you can't preview the document.
                  </p>
                </li>
                <li>
                  <p>
                    <strong class="uicontrol">DocumentTitle</strong>&nbsp;: Titles for the
                    generated documents. Document Title overwrites the file name and
                    system shows the title in the document preview. This field is
                    mandatory.
                  </p>
                  <p>By using commas to separate the document titles, you can create
                    different document titles for the .docx or .pptx documents that you want to
                    generate.</p>
                </li>
                <li>
                  <p>
                    <strong class="uicontrol">docxContentVersionIds</strong> : Document IDs for the
                    .docx or .pptx documents that you want to convert into .pdf. Use
                    commas to separate the Content Version IDs. You can obtain the
                    content version IDs from the Developer Console. For more
                    information, see <a href="https://help.salesforce.com/s/articleview?id=ind.v_contracts_t_search_for_docx_content_version_ids_from_developer_console__389350.htm&amp;type=5" target="_blank">Search for Docx Content Version IDs from
                      Developer Console</a>.
                  </p>
                </li>
              </ul>
            </td>
          </tr>
          <tr class="">
            <td data-label="Omniscript Step" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e127 ">
              <p style="margin-bottom:0;">Set Generation Options</p>
            </td>
            <td data-label="Properties" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e132 ">
              <p>The system maps the values that you defined in the Generation Options step
                to the corresponding variables.</p>
              <p style="margin-bottom:0;">This step selects the
                <code>attachFileFormat</code>, <code>contextId</code>,
                <code>documentTitle</code>, <code>documentViewer</code>,
                <code>docxContentVersionIds</code>, <code>downloadFileFormat</code>, and
                <code>pdfGenerationSource</code> values that you want to pass to the Generate
                Document step.
              </p>
            </td>
          </tr>
          <tr class="">
            <td data-label="Omniscript Step" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e127 ">
              <p style="margin-bottom:0;">Generate Document</p>
            </td>
            <td data-label="Properties" class="slds-cell-wrap" style="vertical-align:top;" headers="d11439e132 ">
              <p>The generation step uses the
                <strong class="uicontrol">clmOsMultiPdfDocumentConverter</strong> LWC component to generate
                and show the document.
              </p>
              <p style="margin-bottom:0;">This step generates the .pdf document with
                the option of downloading the generated document.</p>
            </td>
          </tr>
        </tbody>
      </table>