1. Products
  2.   Spreadsheet
  3.   GO
  4.   Gotenberg Go Client
 
  

Free Go Library for Converting Microsoft® Spreadsheet Files

Load and Convert Microsoft Excel XLSX and XLS Spreadsheet Documents to PDF via Leading Open Source Go API

What is Gotenberg Go Client?

By using the open-source Gotenberg Go client library Go developers can easily convert Excel documents to PDF in their own applications. Using the API, you can convert XLS, XLSX, and ODS file format to PDF easily. The API allows converting one or more files at the same time, and all the files are merged into a single PDF file. Furthermore, the API merges the documents alphabetically.

By default, the resultant PDF document will be rendered with portrait orientation but the API allows customizing the orientation. By default, a handful of fonts are installed. Asian characters are also supported out of the box. Furthermore, you can set page numbers and timeout for the conversion process.

Previous Next

Getting Started with Gotenberg Go Client

The recommended way to install the Gotenberg Go client into your project is by using GitHub. Please use the following command for a smooth installation.

Install Gotenberg Go client via GitHub

$ go get -u github.com/thecodingmachine/gotenberg-go-client/v7 

Convert XLSX to PDF via Free Go API

The open-source library Gotenberg Go client allows computer programmers to convert XLSX to PDF inside their own Go applications. In order to convert your XLSX to PDF, you just need to load your document and convert it using gotenberg.NewOfficeRequest() method. By using the following lines of code, you can easily convert XLSX to PDF.

Convert Excel to PDF in GO

  1. Load two XLSX files using NewDocumentFromPath() method and pass filename and file path as parameters
  2. Convert both files to PDF using gotenberg.NewOfficeRequest() method and pass doc objects
  3. Save PDF document

How to Convert XLSX to PDF via Free GO API?

c := &gotenberg.Client{Hostname: "http://localhost:3000"}
doc, _ := gotenberg.NewDocumentFromPath("document.xlsx", "/path/to/file")
doc2, _ := gotenberg.NewDocumentFromPath("document2.xlsx", "/path/to/file")
req := gotenberg.NewOfficeRequest(doc, doc2)
dest := "result.pdf"
c.Store(req, dest)
 English