# Create Your First Template

Welcome! If you are a new Salesforce Administrator looking to quickly generate beautiful, data-driven documents, you are in the right place. Creating templates from scratch using HTML and CSS can feel a bit daunting at first, but S-Docs has a fantastic feature designed specifically for you: the PDF-Upload template format.

Let's walk through exactly what this feature is, how to enable it, and the step-by-step process of building your very first drag-and-drop template.

***

### Introduction to PDF-Upload Templates

What are PDF-Upload templates? Simply put, PDF-Upload templates allow you to take a pre-existing, standard-formatted PDF (like a fillable form or a beautifully designed marketing brochure) and upload it directly into S-Docs. From there, you can use a simple drag-and-drop interface to merge your Salesforce data directly onto the document. You get to skip the process of rebuilding the document from scratch using HTML or CSS!

When should you use them? PDF-Upload templates are your best friend when you have:

* Design-heavy documents that were created by a marketing or design team (where rebuilding the exact layout in HTML would be time-consuming).
* Basic documents that only require simple, straightforward field merges (like placing a Contact Name and Account Address on a static form).

***

### Step 1: Creating Your First Template Record

Now that the feature is enabled, let's create the shell for your new template.

1. Open the App Launcher (the 9-dot grid on the top left) and search for S-Docs.
2. Click on the S-Docs Templates tab, then click the New button.
3. Fill out the required fields to set up your template:
   * Template Name: Give it a clear, descriptive name (e.g., "Customer Welcome Packet").
   * Related to Type: Select your base object. This is the primary record you will generate the document from (e.g., Opportunity or Contact).
   * Template Format: Select PDF-UPLOAD from the drop-down.
4. Click Save.
5. Once saved, look at the top right of the record page. Click the dropdown arrow and select the Template Editor button to launch the designer.

***

### Step 2: Uploading Your PDF

Welcome to the Template Editor! Let's get your PDF onto the canvas.

1. Locate the PDF File Quality drop-down menu. You can choose from Full, High, Medium, or Low.
   * *Note: Higher quality will look crisper but will result in a larger generated file size. High or Medium is usually the sweet spot for standard business documents.*
2. Click the Upload PDF File button and select the local PDF file from your computer.

Once uploaded, your PDF will appear on the right side of the screen, and your building tools will appear on the left.

***

### Step 3: Adding & Formatting Merge Fields

This is where the magic happens! On the left side of the editor, you will see two main menus:

* PDF-Upload Settings: This is used to apply global CSS styling that affects *all* fields on your document.
* S-Docs Fields: This is where you configure and grab the individual Salesforce merge fields to drop onto your PDF.

Let's add your first field:

1. Under the S-Docs Fields menu, click Create Another Field.
2. Select Merge Field as your field type.
3. Click the Select Merge Field button. This opens a window showing all the fields available on your base object.
   * *Pro-Tip: You can pull data from related objects (up to 3 levels deep) by clicking on fields that have a `>` symbol next to them!*
4. Select your desired field and click Insert Field.

> ⚠️ Warning: The Crucial CSS Tip! By default, text merged onto a PDF-Upload template will *not* wrap; if the text is too long, it will run right off the side of the page! To prevent this, locate the Additional Style box for your specific field and type in the following: `white-space: normal !important; max-width: 200px;` *(You can adjust the "200px" number based on how wide you want the text block to be).*

Adding Conditional Logic (Optional): Only want a field to show up under certain conditions? Use the Render If box! For example, if you only want an address to appear when an Opportunity is closed, you would enter: `{{!Opportunity.stagename}} == 'Closed'`.

Place the Field: Once your field is configured, you'll see a generated drag-and-drop block (e.g., SDOCS INPUT ID=1). Simply click, hold, and drag this block exactly where you want it to appear on the PDF canvas on the right.

***

### Limitations & Best Practices

To set you up for success, it's important to know the boundaries of the PDF-Upload format. While incredibly fast and user-friendly, it trades a bit of complexity for ease of use. Keep these limitations in mind:

* File Type: PDF is the *only* supported file type for upload.
* Advanced Features: Complex data structures like Related Lists (tables of child records) and nested conditional renders are NOT supported in this format. (If you need these, use the standard HTML/PDF template format!).
* Editor Tabs: The standard Template Headers, Footers, and Page Settings tabs are not available in this mode, as those elements should already be baked into the PDF you are uploading.

***

Congratulations! You've just learned how to build a PDF-Upload template. You are well on your way to becoming an S-Docs power user.


---

# 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/quick-start/getting-started/create-your-first-template.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.
