Open Source Go API for Converting Microsoft® Word Processing Files
A Powerful Open Source Free GO Library to Convert Microsoft Word Processing Documents and PDFs to Plain Text
What is Docconv?
Oftentimes, while working with Microsoft Word Processing documents, the developers need the document text in plain format. Sometimes, they process the text or just display it in a different format. The open-source and free API Docconv allows GO developers to extract text from DOC and DOCX in plain format.
Docconv is open source Go-based library and is freely available for converting PDF, DOC, DOCX, XML, HTML, RTF and various other documents to plain text inside Go apps. The library is designed to convert documents into plain text or HTML with just a couple of lines of code. While the core library is written in Go, it can be wrapped and consumed by APIs, making it accessible for developers working in other languages—including PHP.
The library is developed completely in GO but has some dependencies to work properly. The API requires tidy, wv, popplerutils, and unrtf JustText
Getting Started with Docconv
The recommended way Docconv into your project is by using GitHub. Please use the following command for a smooth installation.
Install Docconv via GitHub
$ go get code.sajari.com/docconv/...
Convert DOCX to Plain Text via Free Go API
The open source library Docconv allows computer programmers to convert DOCX to Plain Text inside their own Go applications. In order to convert your DOCX to Plain Text, you just need to load your document and convert it using occonv.ConvertPath() method. By using the following lines of code, you can easily convert DOCX to Plain Text.
Convert Word Processing to Text in GO
- Create a new client
- Convert DOCX to Text using client.ConvertPath() and pass file path as parameter
- Check for errors
- Print plain text
How to Convert DOCX to Text via Free GO API?
// create a new client
c := client.New()
// convert DOCX to Text
res, err := client.ConvertPath(c, "fileformat.docx")
if err != nil {
log.Fatal(err)
}
// print output
fmt.Println(res)
View Online Document via Go API
The open source Go library Docconv makes it easy for software developers to load and view word documents inside Go applications. With a simple HTTP interface, it opens up robust document processing without the need for commercial licenses or heavyweight PHP libraries. The library convert Word files into HTML and render them inside a browser without requiring MS Word.