Let the platform do the work

PDF Manager

Overview

The PDF Manager is used to create and manage templates for generated PDF files for any deployed module, custom or standard. Sugar comes with two PDF templates out of the box (Quote and Invoice).

Note: Legacy Quote PDF Templates (custom Quote templates created through code customizations) are not displayed in the PDF Manager but are still available in the Quotes module provided the templates were built off the TCPDF engine.

PDF Manager Fields

The PDF Manager module contains a number of stock fields that come out-of-the-box with Sugar. The below definitions are suggested meanings for the fields, but the fields can be leveraged differently to best meet your organization's needs.

Field Description
Author The author name to be placed in the PDF properties.
Description A description or other information about the template.
Footer Text The text to be placed in the template's footer.
Header Logo File Click "Choose File" to upload a header image to the template.
Note: The image will display as 454 pixels wide by 45 pixels high; the uploaded image should be sized relative to these dimensions.
Header Text The text to be placed in the template's header.
Header Title The title of the template header.
Keyword(s) The keywords to be placed in the PDF properties.
Module The module this template will work in.
Note: Once a template is created, the module cannot be changed.
Name The name or designation of the template.
Published Determines if a template is available to users or not.
Subject The subject to be placed in the PDF properties.
Teams The Sugar team(s) assigned to the template record.
Template The content of the template.
Title The title to be placed in the PDF properties.

PDF Manager Module Tab

The PDF Manager module tab can be accessed by navigating to the Administration page and clicking "PDF Manager" in the System section. Once in the PDF Manager list view, you can click the three-dots menu in the PDF Manager module tab in the navigation bar to display the Actions and Recently Viewed menus. The Actions menu allows you to perform important actions within the module. The Recently Viewed menu displays the list of templates you last viewed in the module. Please note that clicking the module tab allows you to access the PDF Manager list view. 

The Actions menu allows you to perform the following operations:

Menu Item Description
Create PDF Template Opens the edit view layout to create a new template.
View PDF Templates Opens the list view layout to search and display templates.
Edit Report PDF Template Opens the edit view layout to modify the report template.

Creating PDF Templates

There are various methods for creating PDF templates in Sugar including via the PDF Manager module and duplication. The full edit view layout opens when creating the template directly from the PDF Manager menu and includes all of the relevant fields for your organization's templates.

Note: It is generally recommended to create a new template via duplication and then modify the copy to suit your needs.

Creating Via PDF Manager Module

You can create a new template via the Create PDF Templates option in the PDF Manager module tab. This opens up the edit view layout which allows you to enter all the relevant information for the template.

Use the following steps to create a template via the PDF Manager module:

  1. Navigate to Admin > PDF Manager.
  2. Click the three-dots menu in the PDF Manager module tab and select "Create PDF Template".
  3. Enter appropriate values for the fields in the edit view layout. All required fields are marked with a red asterisk and must be completed prior to saving.
  4. Once the necessary information is entered, click "Save".

Creating Via Duplication

You can also create a new template by duplicating an existing template record. The Copy option is useful if the template you are creating has a similar layout to an existing template.

Use the following steps to create a template by duplicating an existing record:

  1. Navigate to a template record's detail view.
  2. Click "Copy" from the Actions menu.
    PDFManager DetailView ActionsMenu Copy
  3. The displayed edit view is pre-populated with the original template's values. Update the necessary fields, then click "Save".

Note: If you change the module field during duplication, you will have to remove all variable references to the old module in the layout before saving.

Creating Content

The PDF template can contain images and HTML formatting as well as variable fields from the assigned module. TincyMCE is the rich text editor for formatting your template using HTML. For more information on using TinyMCE, please refer to the TinyMCE section in the User Interface in the Application guide.

To add variable fields from the assigned module, simply select the desired field from the Field dropdown and then click "Insert".
PDFManager CreatingTemplate InsertField

The variable will be placed wherever your computer's cursor is located in the template and can be moved around as necessary.

Note: The Link section provides all one-to-one and one-to-many relationships to provide linked data in the template.

For modules that have a subset of data in the template (e.g., Product line items in Quotes), there are special containers in the template that indicate where the repeating areas start and stop. These containers are designated by the following commands:

  • Start: {foreach from=$product_bundles item="bundle"}
  • End: {/foreach}

Note: These lines are important and if removed can cause errors when generating a PDF. If you encounter an error when generating a PDF, we recommend checking the template for these start and end placeholders.

To add images to a PDF template, simply select the image icon in the toolbar. Fill out the image details (Image URL, Alignment, Dimensions, Border, etc.) in the Insert/Edit Image dialog then click "Insert". 

Note: Images cannot be copied and pasted or dragged and dropped into a PDF template. The image icon must be used to insert an image.

Viewing PDF Templates

There are various options available for viewing template records in Sugar including via PDF Manager list view, PDF Manager detail view, and PDF Manager Recently Viewed menu.

Viewing Via List View

The PDF Manager list view displays all template records meeting the current search criteria. To access the list view, simply click the PDF Manager module tab. While list view shows key template fields, you can click the template's name to open the record in detail view. For more information on viewing templates via list view, please refer to the PDF Manager List View section.

Viewing Via Detail View

The PDF Manager detail view displays thorough template information including all template fields. The detail view can be reached by clicking a template record's link from anywhere in the application including from the PDF Manager list view. For more information on viewing templates via detail view, please refer to the PDF Manager Detail View section.

Viewing Via Recently Viewed

As you work, Sugar will keep track of which templates you have recently viewed. Click the three-dots menu in the PDF Manager module tab to see a list of the 3 templates you most recently viewed. Click the template's name from the list to open it in detail view.

Searching PDF Templates

The PDF Manager list view includes a Basic Search to help you locate records easily and effectively in a module-specific manner. Once the search is performed, the relevant results will be displayed in the PDF Manager list view below. Please note that Sugar automatically appends the wildcard character (%) to the end of your search phrase. This allows the system to retrieve all records that start with the keyword entered in the search. If you would like to broaden the search, you can use the wildcard at the beginning of your text as well (e.g., %services). This will pull up any record that has the word "services" in the name, regardless of how it starts or ends.

For more information on using the various search methods as well as how wildcards are used in the different methods, please refer to the Search documentation.

Basic search offers a few, commonly used fields for a simplified search experience.
The buttons and checkboxes available in Basic Search panel have the following functions:

  • Search: Click the Search button or press your Return/Enter key to perform the search.
  • Clear: Click the Clear button to clear all criteria from the searchable fields.


When you run a search, Sugar will return records matching all (as opposed to any) of the fields and checkboxes for which you have given a value. For example, if you select a module and enter a template name, Sugar will only return template records with a matching name that are assigned to that module. Once the search is complete, the relevant results will populate in the list view below the search panel. To see all template records, simply click "Clear" and then "Search" to perform a blank search with no filters.

PDF Manager List View

The PDF Manager list view displays all template records meeting the current search criteria. You can view the basic details of each template within the field columns.

Pagination

List view displays the current search results broken into pages that you can scroll through rather than displaying potentially thousands of rows at once. To the right just below the search panel you can see which records of the total results set are currently being displayed. The two single-arrow Next and Previous buttons can be used to scroll through the records page-by-page. The two double-arrow First Page and Last Page buttons allow you to skip to the beginning or the end of your current results.

By default, Sugar displays 20 records per list view page, but administrators can change the number of records displayed via Admin > System Settings. For more information on changing the number of displayed records, please refer to the System documentation in the Administration Guide.

Checkbox Selection

You can perform several actions on template records directly from the list view by first selecting the desired records. To select individual template records on the PDF Manager list view, mark the checkbox on the left of each row. To select or deselect multiple template records on the list view, use the options in the checkbox dropdown menu:

  • Select This Page: Selects all records shown on the current page of PDF template results.
  • Select All: Selects all records in the current search results across all pages of PDF template results.
  • Deselect All: Deselects all records that are currently selected.

Actions Menu

The Actions menu to the right of the checkbox dropdown typically allows you to perform various actions on the currently selected records.

The only action available from the PDF Manager list view is the following operation:

Menu Item Description
Delete Delete one or more templates at a time.

Column Sorting

List view provides the ability to sort all of the current search results by a field column in either ascending or descending order. To sort by a field or switch the sort direction, click the column header noting that the fields which allow sorting will have a pair of arrows. The list view may be sorted by only one column at a time.

PDF Manager Detail View

The PDF Manager detail view displays thorough template information including all template fields which are grouped by default into the Overview and PDF Document Properties panels. The detail view can be reached by clicking a template record's link from anywhere in the application including from the PDF Manager list view.

Actions Menu

The Actions menu on the top left of each template's detail view allows you to perform various actions on the current record. Administrator users can change the action items to be displayed as separate buttons instead of a dropdown menu via Admin > System Settings. For more information on configuring the actions menu, please refer to the System documentation in the Administration Guide.
PDFManager DetailView ActionsMenu

The options in the Actions menu allow you to perform the following operations:

Menu Item Description
Edit Edit this template.
Copy Duplicate this template.
Delete Delete this template.
Preview Preview this template.

Next or Previous Record

On the upper right of the PDF Manager detail view, there are two buttons that allow you to page through each template in the PDF Manager list view's current search results. Clicking the Previous button displays the previous template of the current search results while clicking the Next button displays the next template of the current search results. The text in between shows which template result you are currently viewing within the total number of current results.

Editing PDF Templates

Templates may be edited at any time to update or add information to the record. You can make changes to existing template records via the PDF Manager edit view. Edit view is available within the PDF Manager module and includes all of the template fields you should need.

Editing Via Detail View

You can edit templates via the detail view by clicking the Edit button on the upper left of the page. Once the edit view layout is open, update the necessary fields, then click "Save" to preserve your changes.

Editing Report PDF Template

The Report PDF Template is used when generating a report as a PDF. The report template may be edited at any time to include your company's logo. This logo displays in the header for all Report PDF files. The image will display as 454 pixels wide by 45 pixels high; the uploaded image should be sized relative to these dimensions.

You can edit the report template via the detail view by selecting the Edit Report PDF Template option from the PDF Manager module tab.

Once the edit view layout opens, update the necessary fields, then click "Save" to preserve your changes.

Deleting PDF Templates

If a template record is invalid or should no longer appear in your organization's Sugar instance, it may be deleted from either the PDF Manager detail view or list view. Deleting via the detail view allows you to delete a single record while the list view allows for mass deleting multiple records at once.

Deleting Via Detail View

Use the following steps to delete a template record via the detail view:

  1. Navigate to a template record's detail view.
  2. Select "Delete" from the Actions menu.
    PDFManager DetailView ActionsMenu Delete
  3. A pop-up message will display asking for confirmation. Click "Ok" to proceed.

Mass Deleting Via List View

Use the following steps to delete one or more template records via the list view:

  1. Navigate to the PDF Manager list view by clicking the PDF Manager module tab.
  2. Use the Basic Search to find the template records you wish to delete.
  3. Select the desired template records individually or using the checkbox dropdown's options.
  4. Choose "Delete" from the Actions menu.
  5. A pop-up message will display asking for confirmation. Click "Ok" to proceed.

Due to PHP memory limitations on the server, there may be occasions when the application times out while deleting a large number of template records. If you encounter an error when performing this action, we recommend selecting the records in smaller batches.

Adding a Header Image to PDF Template

Image files can easily be uploaded from your local machine to be used as a header image on a PDF template. After uploading and saving the image to the template's Header Logo File field, it will be shown on the PDF generated by users in Sugar.

Header images will display as 454 pixels wide by 45 pixels high, so the uploaded image should be sized relative to these dimensions (e.g., 908x90 or 1816x80).

After saving an appropriately sized image file to your computer, use the following steps to add the header image to the PDF template:

  1. Create a new PDF template or open up an existing template via Admin > PDF Manager. 
  2. Click the "Choose File" button in the Header Logo File field to open a file selection window from your browser.
  3. Select the image file from your local machine then click "Open" to add the image.

Please note that you must save then preview the PDF template in order to view the inserted header image. 

Previewing PDF Templates

Previewing PDF templates allows you to see what the template will look like before publishing it in Sugar. The preview option displays the PDF template with the database field names and not actual data values and is accessible from the detail view.

Use the following steps to preview a template via the detail view:

  1. Navigate to a template record's detail view.
  2. Select "Preview" from the Actions menu.
    PDFManager DetailView ActionsMenu Preview
  3. The PDF will download to your computer for viewing.