# How To: Upload PDF To S-Docs

> *PDF-Upload is a template format where users can take an existing PDF Document (S-Docs generated or not) and upload it through the template editor to generate future S-Docs.*

## How does PDF-Upload Work?

S-Docs captures a static background image of the uploaded PDF Document which is then used when the file is generated. This means that the PDF Document cannot be changed or scaled. Data cannot be integrated into the original PDF, as it is a background image, instead we utilize merge fields that drag and drop with overlaying text.

{% hint style="info" %}
Considerations:

* Once a template exists as a different file format, it cannot be changed to PDF-Upload Format Likewise, PDF-Upload templates cannot be changed to a different file format
* Only Portrait Orientation is supported
* Component Templates cannot be brought into a PDF-Upload Template to populate with data
* Related Lists are not supported, only Named Queries
* Conditional Logic must be manually implemented, there is no supported WYSIWYG capability
* Traditional Page Header, Footer, and Page Settings are not available
  {% endhint %}

## PDF-Upload and the Template Editor

In the template editor the user is prompted immediately with 2 options: Upload PDF and PDF File Quality. Once the upload is successful, the user can navigate through standard tabs such as Document Options, Email Settings, Runtime Prompts, and Advanced Options.

The PDF-Upload unique options within the template editor are separated into two sections, **PDF-Upload Fields**, where you will be able to customize the drag-and-drop merge fields, and **PDF-Upload Settings**, where you can add any standardizations for your merge fields along with named queries.

PDF-Upload Fields

* Merge Field: Where to Select Merge Field to be layered onto Static Image. S-Sign Field compatible
* Additional Style: Overridable CSS Styling Area, only supports up to CSS 2.1
* Render If: Conditional Render Area to show merge fields if a specified condition is met

PDF-Upload Settings

* Default Merge Field Style: Default CSS Styling for all merge fields, supports up to CSS 2.1
* Named Queries: Allows Named Queries (LineItemsSOQL queries that utilize tags) to be used

## Conditional Logic in PDF - Upload

As earlier stated, PDF-Upload Fields can be rendered onto a PDF-Upload Document if specific criteria are met. Instead of adding a render block, you simply need to specify the relationship to be evaluated.

**Examples:**

```
{{!Opportunity.StageName}} == 'Closed'
```

```
{{!Contact.Phone}} == 'NULL'
```

```
{{!Opportunity.Id}} == 006Da00000NOcmwIAD
```

## Using PDF-Upload Templates as Components for PDF Templates

PDF-Upload Templates can not utilize components when trying to generate a S-Doc. It is possible to use PDF-Upload Templates as the component for your standard PDF Template.

To use a PDF-Upload Template as a component:

{% stepper %}
{% step %}

### Add componentType attribute

Add componentType="pdf-upload" must be added to the component syntax.
{% endstep %}

{% step %}

### Close HTML tags before the component

HTML tags cannot open before the component merge field and close after it; you must close all tags before the PDF-Upload component is inserted. Upon document generation, the content before the component, the component itself, and the content after the component are wrapped in separate tags.
{% endstep %}

{% step %}

### Match orientation and dimensions

The PDF Template and PDF-Upload Template must have the same orientation and dimensions.
{% endstep %}
{% endstepper %}

**Example:**

Name of the PDF-Upload Template being “PDF Upload Component”

```
{{{{!PDF Upload Component componentType="pdf-upload"}}}}
```

```
<template componentType="pdf-upload">PDF Upload Component</template>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/sdocs/template-architecture/document-formats/pdf-upload-format/pdf-upload-format-how-to-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
