From 389f5a203f4fa2c5aa1de9d4b0b12767f2a1787f Mon Sep 17 00:00:00 2001 From: Enrico Speranza Date: Sun, 3 Sep 2023 17:19:45 +0000 Subject: [PATCH] add docx parser --- opencrucible.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/opencrucible.go b/opencrucible.go index d830f7c..bce0f02 100644 --- a/opencrucible.go +++ b/opencrucible.go @@ -10,7 +10,7 @@ import ( ) // Version exposes the current package version. -const Version = "0.0.1" +const Version = "0.0.2" //Detects @@ -51,3 +51,12 @@ func RTFParseToString(StreamToParse []byte) (string, error) { rtf, err := cat.FromBytes(StreamToParse) return rtf, err } + +func DOCXParseToString(StreamToParse []byte) (string, error) { + // If no StreamToDetect was given, return an error with a message. + if len(StreamToParse) == 0 { + return "", errors.New("stream to parse is empty") + } + docx, err := cat.FromBytes(StreamToParse) + return docx, err +} \ No newline at end of file