Introduction

The Merge PDF Datalist Action plugin is used to merge all uploaded PDF in file upload form element when user clicks on merge button in datalist.

Plugin Information

Plugins Available in the Bundle:

  1. Merge PDF Datalist Action

This plugin bundle is compatible with Joget DX 8.

Expected Outcome

The merge pdf datalist action is able to merge PDFs using button in datalist.

Figure 1: Merge PDF Button in Datalist

Getting Started

Steps

1. You can obtain the jar file by the latest release at https://github.com/jogetoss/merge-pdf-datalist-action/releases.

2. Upload the plugin jar file in Joget by going to Settings → Manage Plugins.

3. You can choose to import the demo app or create the app from scratch.

Steps for importing demo app

1. Download the demo app from https://github.com/jogetoss/merge-pdf-datalist-action (.jwa file).

2. Go to Joget Home or All Apps and click on Import App to import the downloaded demo app.

Steps for creating app from scratch

1. Create a form with a file upload field to upload PDF file.

Figure 2: Add File Upload fields in form


2. On right up corner, click on Generate App > Generate CRUD.

Figure 3: Generate CRUD for form


3. Go to the List Builder. Drag the Merge PDF Datalist Action plugin into the datalist. By dragging to column, it will download each record row individually, by dragging to the bottom it will download based on selected records. Refer to Merge PDF Datalist Action Properties for plugin configurations.

Figure 4: Drag Merge PDF Datalist Action Buttons into datalist


4. Publish and run the UI. Go to the CRUD and click New. Add a new record and upload multiple PDF files.

Figure 5: Upload some PDF files


5. Add another record to showcase downloading the zip file of all PDFs when all records are selected.

Figure 6: Add another record to upload another PDF file in another record


6. Click on Merge PDF for record1.

Figure 7: Click Merge PDF Button in Datalist


7. The two pdf on the left is the original pdf, and the pdf on the right is the merged pdf that we just downloaded.

Figure 8: Download Merged PDF


8. Now, click on the Download all merged PDF in Zip, this will download all the merged PDFs in each record as a zip file

Figure 9: Click Download all merged PDF in Zip Button in Datalist


9. The ZIP file is downloaded. Extract the file and you can get the merged PDFs from each record.

Figure 10: Download all merged PDF in zip file

Merge PDF Datalist Action Properties

Configure Merge PDF Datalist Action

Figure 11: Merge PDF Datalist Action Plugin Configurations

Name

Description

Label 

Datalist button label.

Form *

Form that contains the file upload field.

Field *

File Upload field that the PDF is uploaded to.

Record Id Column 

If not set, default value will be the primary key of the configured binder.

Confirmation Message

Confirmation message before performing action, for example "Are you sure?".

File Name

If not set, default file name will be based on record id field value.

Zip File Name

The file name of the zip file. If not set, default file name will be the button label.

Configure Merge PDF Tool Plugin

Steps for configuring Merge PDF Tool

1. Create a form with two file upload fields to upload PDF files.

Figure 12: Add File Upload fields in form


You may upload multiple PDF files into a single File Upload field. In that case, make sure to enable the "Enable Multiple file uploads" option under the UI section in Advanced Options.

Figure 13: Enable Multiple Files Upload


2. Add one more file upload field. This field will be used to store the merged PDF generated.

Figure 14: File Upload field where the merged PDF file is stored


3. Configure Post Form Submission Processing

  • In Settings →  Advanced → Post Form Submission Processing, select Merge PDF Tool as the post-processing tool.

Figure 15: Post Form Submission Processing


Figure 16: Configure PDF Merge Tool


NameDescription
Source File

Header Field.

Choose Form (Source File) Select the form containing the PDF files you want to merge.
Choose Fields (Source File)

Select one or more File Upload fields that store the PDF files to be merged.
Use the ➕ button in the grid to add multiple fields.

Output File

Header Field.

Choose Form (Output File)

Select the form where the merged PDF file will be stored.

Choose Field (Output File)

Select the target File Upload field where the merged PDF will be stored.

Rename File

Set the name for the merged PDF file. Use plain text for a fixed name, {fieldid} to insert values from form fields, or Hash Variable

For multiple files, uses the first file's name or set a custom name in the configuration.


4. Save the Configuration and Generate CRUD for the form

Figure 17: Generate CRUD for the Form

Steps to run the Tool plugin

1. At runtime, go to "Manage Merge PDF Tool Form" and click New. Upload PDF files into the File Upload fields and save the form.

Figure 18: Manage Merge PDF Tool Form


2. After submission, click Edit on the record to open the form and download the merged PDF file stored in the Merged PDF field.

Figure 19: Merged PDF file stored in the "Merged PDF" field after form submission

Source Code and Plugin Download

You can obtain the jar file by the latest release at https://github.com/jogetoss/merge-pdf-datalist-action/releases.

Demo App Download

APP_kb_dx8_MergePDFDatalistActionSampleApp.jwa


  • No labels