8000 GitHub - inkit/inkit-go at v0.1.16 · GitHub
[go: up one dir, main page]

Skip to content
inkitPublic

About

Go library for the Inkit API.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started

Import the Inkit Sdk into your project

import "github.com/inkitio/gosdk/client"

Initialize your Inkit client

client := client.NewClient("your_api_key")

Create a render

Define your render using CreateRenderOptions

options := render.CreateRenderOptions{
			Html:   "<html>hello</html>",
			Width:  9,
			Height: 11,
			Unit:   "in",
}

// you can also convert a file on your local file system
options := render.CreateRenderOptions{
			FileName:   "test.html",
			Width:  9,
			Height: 11,
			Unit:   "in",
}

Submit your render to Inkit

render, err := client.Render.Create(&options)

Retrieve you render content

Retrieve data about the render (including status). Make sure your render status is Completed before retrieving file data from it. You will recieve a 404 if the render is still In Progress

render , err := client.Render.Get(render.id)

Retrieve Pdf

pdfData, err := client.Render.GetPdf(render.id)
// or if you want to save it locally to a file
err := client.Render.GetPdfAndSaveToFile(render.id, "test.pdf")

Retrieve Html

htmlData, err := client.Render.GetHtml(render.id)
// or if you want to save it locally to a file
err := client.Render.GetHtmlAndSaveToFile(render.id, "test.html")

About

Go library for the Inkit API.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0