Home Applications iris-pdf-generator

iris-pdf-generator

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
5
1 reviews
0
Awards
613
Views
0
IPM installs
0
0
Details
Releases  (1)
Reviews  (1)
Issues
Articles  (3)
Generate PDF files from InterSystems IRIS using the Java Gateway

What's new in this version

Initial Release

Plain text to PDF converter

This repository contains an example text file to PDF converter and instructions for how to use it from InterSystems IRIS.

Installation

Installing TextToPDF requires that you have access to your IRIS server with sufficient access to work with gateways and classes.
Alternative installation as docker added.

1. Clone this repository

Clone this repository into a directoruy on your IRIS server:

git clone https://github.com/intersystems-community/iris-pdf-generator.git

2. Create a Java Gateway

In the management console, go to System Administration > Configuration > Connectivity > Object Gateways and choose “Create New Gateway”

Object Gateway For:  Java
Gateway Name: iris-pdf-generator
Port: 54545
Class Path: (directory where you cloned the repo)/target/iris-pdf-generator-0.1.0-jar-with-dependencies.jar

Leave all the others as default and click Save.

3. Load the class file

In the management console, make sure you are in the user namespace, go to System Explorer > Classes, and choose “Import”. Browse to the directory where you cloned this repo and choose “all files” from the file type dropdown. Select the PdfGenerator.cls file. Click “Next”, then “Import”.

Usage

Now that everything is installed, you can use it from IRIS. Open a console and do the following, replacing “” with the name of the directory you cloned this repository into:

set status = ##class(User.PdfGenerator).TextToPdf("<clone dir>\example.txt", "<clone dir>\example.pdf")

That will create example.pdf as a PDF version of example.txt.

Build Instructions

This is a small maven project. If you have maven installed then you should be able to build the sources via:

maven install

Docker Installation

Make sure you have git and Docker desktop installed

Clone/git pull the repo into any local directory as described in 1.)
Open the terminal in this directory build and run the container:

  $ docker-compose up --build -d 

How to Test it

The Java Gateway is already set up. No action required.
Either use Webterminal in namespace USER or from terminal prompt

  $ docker-compose exec iris iris session iris

now run

  USER>do ##class(PdfGenerator).DockerDemo()

You see the result in your <clone dir>/pdfout/

Made with
Version
1.0.004 Nov, 2020
ObjectScript quality test
Category
Integration
Works with
InterSystems IRISInterSystems IRIS for Health
First published
04 Nov, 2020
Last checked by moderator
27 Jun, 2023Works