Skip to content

inkit/inkit-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The official Inkit Java client library.

Installation

Requirements

  • Java 1.8 or later

Gradle users

Add this dependency to your project's build file:

implementation "com.inkit:inkit-java:0"

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.inkit</groupId>
  <artifactId>inkit-java</artifactId>
  <version>0</version>
</dependency>

Usage

InkitExample.java

import com.inkit.sdk;
import com.inkit.sdk.models.Render;
import java.util.Map;
import java.util.HashMap;

public class Main {

    public static void main(String[] args) {

        Inkit.apiKey = "xxx";

        
        Map<String, Object> params = new HashMap<>();
        params.put("name", "java sdk test");
        params.put("html", "<html>hello there {{fname}}</html>");
        params.put("height", 11);
        params.put("width", 8.5);
        params.put("unit", "in");

        Map<String, Object> mergeParams = new HashMap<>();
        mergeParams.put("fname", "Bob");
        params.put("merge_parameters", mergeParams);

        try {
            Render render = Render.create(params);
            Render.retrievePdfAndSaveToFile(render.id, "your_pdf.pdf");
        } catch (Exception e) {
            e.printStackTrace();
        }
        
    }
    
}

About

Java library for the Inkit API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages