The Print Service is a reference implementation in MOSIP that handles the printing of credentials such as euin, reprint, and qrcode credential types in PDF format. This service is designed to be customized and utilized by card printing agencies onboarding as Credential Partners.This reference implementation can be referred by any credential sharing request.
It operates in an event-driven flow:
- Receive Event: Listens for print request events from WebSub.
- Fetch Template: Retrieves the appropriate template from Masterdata.
- Generate PDF: Decrypts resident data and converts it into a PDF card using the template.
- Upload: Uploads the generated PDF to DataShare.
- Notify: Publishes a status event with the DataShare link back to WebSub.
The flow is visualized below:
- Template-Based Printing: Utilizes Velocity and iText to generate PDFs based on customizable templates.
- Secure Data Handling: Decrypts sensitive resident data using partner private keys (
.p12). - DataShare Integration: Securely uploads generated credential documents.
- Credential Support: Native support for EUIN, Reprint, and QR Code credential types.
The Print project consists of the following service:
- Print Service (
print) - The core Spring Boot application responsible for processing print requests and generating the credential PDFs.
NA (The service relies on Object Store/DataShare and Masterdata; it does not maintain its own primary database).
Refer Build and Run.
To deploy print service in production follow the given steps:
- Onboard your organisation as Credential Partner.
- Place your
.p12file in../src/main/resourcesfolder. - Set configuration as in given here.
- Build and run as given here.
Automated functional tests available in Functional Tests repo.
The project can be set up in two ways:
Before you begin, ensure you have the following installed:
- JDK: 21
- Maven: 3.9.6 (or compatible 3.x version)
- Docker: Latest stable version (optional for local run)
Ensure the following artifacts are available in the classpath or loader path:
kernel-auth-adapter.jar- For IAM authentication.
Print uses properties from mosip-config.
You can check the configuration here: print-default.properties
-
Ensure the Config Server is running and accessible.To run config server check here.
-
Clone the repository:
git clone https://github.com/mosip/print.git
cd print
- Build the project:
mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true
- Start the application:
- Run via IDE or command line:
java -Dloader.path=<path-to-kernel-auth-adapter-jar> \ -jar target/print-*.jar
- Run via IDE or command line:
Recommended for quick demos and testing.
docker pull mosipid/print-service:1.3.0
Run the service:
docker run -d -p 8099:8099 --name print-service mosipid/print-service:1.3.0
Recommended for developers.
-
Build the project (as shown in Local Setup).
-
Build the Docker image:
docker build -t print-service:local .
- Run the service:
docker run -d -p 8099:8099 --name print-service print-service:local
Check that the container is running:
docker ps
The service runs on port 8099 by default.
For additional details, refer to the documents listed below:
- Build and Run Guide: Detailed instructions for building and running the service.
- Configuration Guide: Details on configuration properties and template setup.
• To learn how you can contribute code to this application, click here.
• If you have questions or encounter issues, visit the MOSIP Community for support.
• For any GitHub issues: Report here
This project is licensed under the Mozilla Public License 2.0.
