# Using SharinPix deeplink to launch a PDF from Salesforce mobile

This article demonstrates how to:

* [Configure a SharinPix deeplink to launch a PDF from the Salesforce mobile](#configure-the-sharinpix-deeplink-to-launch-the-pdf)
* [Enable and display the PDF values on the SharinPix Image record relating to the submitted PDF](#enable-and-display-the-pdf-values)

{% hint style="warning" %}
**Requirements**

For such implementation, please ensure that you have a **PDF** document which:

* Does not consist of features that require being online
* Utilizes either embedded fonts or the following standard fonts: Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic, Symbol, ZapfDingbats.
  {% endhint %}

## Configure the SharinPix deeplink to launch the PDF

{% hint style="warning" %}
**Pre-requirement:**

Prior to configuring the deeplink, you should ensure that a **SharinPix token** is available for the record on which you intend to upload the PDF.

You can refer to the following article to set up an automation that will generate a SharinPix token upon creation of records if required:

[SharinPix automatic token generation (Admin Friendly)](https://docs.sharinpix.com/documentation/mobile-app/sharinpix-automatic-mobile-upload-token-generation-admin-friendly)
{% endhint %}

To launch a PDF from the Salesforce mobile app using SharinPix, the **pdf** parameter should be configured in the SharinPix deeplink.

The general form of such deeplink is as follows:

<mark style="color:$danger;">`sharinpix://upload?token=<Your Token>&pdf=<Your Encoded PDF URL>`</mark>

As indicated above, the pdf parameter takes as value **an encoded version of the PDF URL**. For example, if your PDF URL is **<https://pdf.test.com/smart\\_solar.pdf>** , here is the encoded version to be used as the value for the **pdf** parameter: <mark style="color:$danger;">`https%3A%2F%2Fpdf.test.com%2Fsmart_solar.pdf`</mark>

Here is an example of the full deeplink:

<mark style="color:$danger;">`sharinpix://upload?token=<Your Token>&pdf=https%3A%2F%2Fpdf.test.com%2Fsmart_solar.pdf`</mark>

### The Prefill Option

The prefill option is used to prefill the PDF text boxes. To enable this option, the parameter **pv** should be added, followed by **the text box name**. This parameter should store the encoded prefill value as shown below:

<mark style="color:$danger;">`pvTextboxName=<Your Encoded Prefill Value>`</mark>

The example below demonstrates a deeplink using the **pdf** parameter **along with the prefill option** :

<mark style="color:$danger;">`sharinpix://upload?token=<Your Token>&pdf=<Your Encoded PDF URL>&pvSurname=John%20Doe`</mark>

## Enable and display the PDF values

The PDF values can be displayed on the **SharinPix Image** record corresponding to the submitted PDF as demonstrated below:

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2FWtkO5CIp7rCOBqfBsVLt%2Fimage%20\(70\).png?alt=media\&token=39685ac2-1066-4363-850a-1e1fbbd3cc21)

{% hint style="warning" %}
**Note:**

* For the time being, values are only saved in fields containing text values (<mark style="color:$danger;">`'STRING', 'TEXTAREA', 'PICKLIST', 'MULTIPICKLIST', 'PHONE', 'URL'`</mark>)
* For the above configuration:
  * The **SharinPix Image Sync feature should be enabled for the object on which you are uploading the PDF**. For more information on how to enable the Image Sync on an object, refer to this article: [Setup SharinPix Image Sync](https://docs.sharinpix.com/documentation/image-sync/setup-sharinpix-image-sync)
  * A Webhook of type **Upload Done** or **New Image** should be configured for your organization. For more information on how to configure SharinPix Webhooks, refer to this [link](https://docs.sharinpix.com/documentation/image-sync/image-sync-for-pictures-uploaded-via-sharinpix-mobile-app#how-to-configure-the-webhook).
    {% endhint %}

To enable and display the PDF values, follow the steps below:

* From **Setup**, search for **Custom Metadata Types**
* Click on **Manage Records** next to **SharinPix Bypass**

<figure><img src="https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2FO33HDUzKaW2e3mOAuoCE%2Fimage%20(69).png?alt=media&#x26;token=26a4886b-6903-43e6-9aaa-9c576db8aba6" alt=""><figcaption></figcaption></figure>

* Then, click on the Edit button corresponding to the **PdfValuesEnabled** entry
* On the **SharinPix Bypass Edit** page, check the **Active** checkbox

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2F9WhRp390e0hv5nm0VopD%2Fimage%20\(71\).png?alt=media\&token=e6f36bfa-87be-4bf4-acd8-8317642f8cf8)

* Next, go to the **Object Manager** tab and search for the **SharinPix Image** object
* Go to the **Page Layouts** section and click on **SharinPix Image Layout**
* Add the **PDF Values** field to the page layout:

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2FOdT5M4Rj6DexnKDQzosk%2Fimage%20\(72\).png?alt=media\&token=90251f52-c4d4-4b34-82bb-d5a2afc1d43e)

Now that the **PdfValuesEnabled** option has been enabled, and the **PDF values** field added to the SharinPix Image object's page layout, after submitting PDF from the SharinPix mobile app, all the PDF values will be synced on the related SharinPix Image record. These values will be stored in a JSON format in the **PdfValues\_\_c** field:

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2F6b4RA1vNMPfcgR8FlwEn%2Fimage%20\(73\).png?alt=media\&token=82997c33-acc0-4b28-b86b-1f1d0713ac67)

If the PDF contains field names corresponding to the SharinPix Image object's field API names within Salesforce, the fields are automatically filled with the value entered on the PDF as demonstrated below:

*On PDF*:

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2Flp4adzUIiWgHjkhLuLMh%2Fimage%20\(74\).png?alt=media\&token=57478eb7-0698-424e-95e3-3c5d08a69fe1)

*Corresponding field on Salesforce, (FieldName\_\_c in our case) is automatically populated with the value entered on the PDF*:

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2F1vakYgEV2j2nZvnJDBVy%2Fimage%20\(75\).png?alt=media\&token=0702874b-0f52-4d7c-a3ef-ff5d05995a89)

{% hint style="success" %}
**Tips:**

* You can make use of this handy tool to encode the PDF URL: <https://www.urlencoder.org/>
* The SharinPix to PDF deeplink can also be used in [Field Service App Extensions](https://docs.sharinpix.com/documentation/integrations/salesforce-field-service/integration-of-sharinpix-app-with-sfs-fsl-app-using-app-extension) and [Field Service Mobile Flows](https://docs.sharinpix.com/documentation/integrations/salesforce-field-service/integration-of-sharinpix-app-with-sfs-fsl-app-using-flows).
  {% endhint %}
