icon

Table of Contents

The Components of CraftMyPDF Template Editor

Please visit our latest Introduction to components section in our support page

1. Introduction

CraftMyPDF template editor is an easy-to-use web template editor for designers, developers, or even non-developers to quickly design a PDF template in the form of drag-and-drop.

The PDF template editor consists of a rich set of components for you to build beautiful PDFs with powerful expressions, page breaks, and data bindings.

To learn about the basics of designer, sections, data-binding, page breaks, head over to our Getting Started guide.

In this article, we will cover all the components of the PDF designer.

2. Components

2.1 Label

The label component is used for a multitude of purposes. They are a powerful way of displaying labels, descriptions, summaries, and other text data on your PDF templates. It can be used with expression fields to create dynamic PDF documents.

To create a Label component, drag a Text component and drop it to where you want it to appear.

2.1.1 Properties of a Label component

Text: The text of the Label supports expressions. Hover your mouse cursor on the property, it will display the expressions and JSON fields that you may use for your text.

Font size: The size of the font of the Label element.

Background: Background color of the Label element.

Font: Font family the Label element, use “Select Font” to select a font.

Select Font: Click on the Blue button to choose a font from our font library. We support different languages, remember to select a font that is compatible with the language of your text, or else your generated PDFs will display with square boxes.

Select Font property

Align: the horizontal alignment of the text inside the Label element. Supported alignments: left, right, center, and justified.

Weight: The weight (or boldness) of the font. The weights available depend on the Font that is currently set.

Style: Determine a font that should be styled. The options are normal, italic, or oblique.

Text Orientation:  The orientation of the text characters in a line. It only affects the text in vertical mode (when Writing mode is not horizontal-tb). It is useful for controlling the display of languages that use the vertical script, and also for making vertical table headers.

Writing Mode: Determine lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. 

Padding: Padding of the Label element.

2.1.2 Support of languages for Labels

We support different languages, remember to click on Select Font to select a font from our Font library that is compatible with the language of your text or else your generated PDFs will display with square boxes.

Font library

2.2 Image

The image component is used for displaying images. To create an Image component, drag an Image component and drop it to where you want it to appear.

Properties

Object Fit: It determines how the image should be resized to fit its container.

  • Contain –  The image is scaled to maintain its aspect ratio while fitting within the Image.
  • Cover – The image is sized to maintain its aspect ratio while filling the element’s entire Image.
  • Fill – The image is sized to fill the Image component.
  • Scale-down – The image is sized as if none or contain were specified, whichever would result in a smaller concrete object size.

Src: The property contains the path to the image you want to embed. It can be used along with expressions to create a dynamic image.

2.3 QRCode

QRCode is a two-dimensional barcode that consists of black squares and is capable of storing data. The QR codes are readable by most modern devices.

To create a QRCode component, drag a QRCode component and drop it to where you want it to appear.

Properties

Content: The information to be encoded into QRCode. It can be used along with expressions to create a dynamic QRCode.

2.4 Barcode

Barcode is a one-dimensional of parallel lines of varying widths and capable of storing data. The bar codes are readable by optical readers.

To create a Barcode component, drag a Barcode component and drop it to where you want it to appear.

Properties

Content: The information to be encoded into QRCode. It can be used along with expressions to create a dynamic QRCode.

Format: Supported standards for the Barcode component.

2.4.1 Supported standards/formats

NameSupported barcodes
CODE128CODE128 (auto and force mode)
CODE39CODE39
EAN / UPCEAN-13, EAN-8, EAN-5, EAN-2, UPC (A)
ITFITF, ITF-14
MSIMSI, MSI10, MSI11, MSI1010, MSI1110
PharmacodePharmacode
CodabarCodabar

2.5 HTML component for richtext and tables

The HTML component lets you compose HTML content. It has a built-in rich text editor that allows you to create tables and HTML elements.

To create an HTML component, drag an HTML component and drop it to where you want it to appear.

2.5.1 Editor for HTML content

To open the editor, click on Open HTML Editor. In the top menu of the dialog, you can insert images, tables horizontal lines, and some other HTML elements. The HTML component supports expressions, you can click on the Fields to insert expressions. Combined with an HTML table, you can use it to design a dynamic form.

Click on Confirm and Return once you have done editing.

2.6 Checkbox

Checkbox component is rendered by default as boxes that are checked (ticked) when activated. To create a Checkbox component, drag a Checkbox component and drop it to where you want it to appear.

2.7 Rectangle

The rectangle component lets you draw rectangle shapes. It supports rounded corners and you can select a fill color and border color for the rectangle shape.

2.8 Line

The line component is used to draw vertical or horizontal lines. To create a horizontal line, drag an HTML component and drop it to where you want it to appear.To make a vertical line, select vertical for the Line Orientation. You may also change the Thickness or Color of the Line component.

2.9 Chart

Chart component supports line, area, bar, pie, and donut chart types. To create a Chart component, drag a Chart component and drop it to where you want it to appear.

Extract data from JSON as an array

The property Categories and Data only support a one-dimension array. In order to extract the data from your JSON, you have to use the expression function asArray. The following is an example to extract month and order from an orders array using the asArray expression.

The use of asArray expression

The JSON data

2.10 Section & Subsection

A template is divided into multiple sections, and a section is where you can drag-and-drop components, such as Label, Image, Chart component, etc. There are three types of sections: Header, Normal, and Footer.

Learn more about:

i. Section Header, Normal & Footer: Getting started – Header, Footer & Normal

ii. Data-binding: Getting started – Data-binding

iii. Filtering & sorting for section: Getting started – Data manipulation

iv Subsection component: Getting started – Complex data with subsections

2.11 Simple Table

The Simple Table component is designed to display an array in a tabular form. It is a convenient way to display repeating rows without using a repeating Normal Section.

The followings are the steps to use a Simple Table component:

Step 1 – Data Binding

Configure Data Binding to bind the Simple Table to an array

Step 2 – Adding columns

Then, add new columns to the Simple Table component. Click the button Add Columns in the Columns section in the property panel.

A column consists of 3 elements: Column Header, Column Content/Cell and Column Footer.

i. Colum Header

The header of the column, it’s turned on by default. The following is where you configure the header

You may also update the Header Settings in the property panel

ii. Column Content or Cell

The content of the repeating rows. The cell value can be either an expression of a JSON field.

  • Value type is set to Expression.
  • You can use an expression in the Value
  • To access the repeating, use the variable row
  • For example, if the Data Source is set to {{data.items}} and in the items array there is a field named description then you may enter an expression {{row[“description’}} in the Value
  • Value type is set to JSON Field
  • You can enter the JSON field in the Value.
  • For example, if the Data Source is set to {{data.items}} and in the items array there is a field named description then you may enter the text description in the Value

You may also change the Content or Cell Settings such as alternate colors, font size etc in the property panel

iii. Column Footer

The footer of the column. It’s disabled by default and it’s similar to Header.

You may also change the Footer Settings such as alternate colors, font size etc in the property panel

Simple Table spans across multiple pages

If a simple table spans across multiple pages, please set the Layout Mode to Vertical flow for the parent section.

Recent Posts
blog

A Guide to Generate Barcodes and QRcodes

In this article, we’ll explore barcodes and QR codes, discussing their applications and how they’re used in various scenarios. I’ll guide you through the steps to create these codes using Python and Node.js. Additionally, we’ll look at how to generate barcodes and QR codes with CraftMyPDF, which supports REST API and integrates seamlessly with no-code platforms like Zapier, Make.com, and Bubble.

Read More »
blog

How to generate PDF documents with PHP

There are various libraries available to generate PDF documents with PHP such as FPDF, TCPDF, or DOMPDF. These libraries provide a wide range of features for creating PDF documents, such as setting page size, margins, fonts, and images.

In this article, I would briefly discuss some of these libraries along with some code snippets and show you how to generate a PDF document using PHP and CraftMyPDF.

Read More »
blog

5 Ways to generate PDFs with C#

In this article, we will cover different options available, including using libraries such as iTextSharp and PdfSharp, cloud-based APIs such as CraftMyPDF, built-in classes in the .NET Framework like the PrintDocument class, and the Microsoft Office Interop library.

Read More »
blog

How to Generate PDF Invoices with Zapier

With PDF invoices, it’s easier to send invoices directly to clients without needing paper copies.

In this article, I would be showing you how to generate PDF invoices with Zapier and also help you understand the benefits of doing this. Let’s get to it!

Read More »
blog

Best-performing Banner Ads Sizes in 2023

Choosing the most appropriate banner for your company isn’t always easy. There are lots of things to consider such as the color, size, type of banner, and so on. This could be a little problematic if you have no knowledge of the different types of banner ads but don’t worry, that’s why I’m here.

Read More »
Copyright ©2024 CraftMyPDF.com

Email us at [email protected] for support