sferyx.administration.docxgenerator
Class DOCXGenerator

java.lang.Object
  extended by sferyx.administration.docxgenerator.DOCXGenerator

public class DOCXGenerator
extends java.lang.Object

General purpose DOCX Generator - this class provides fully featured generation of DOCX files from various sources containing RTF, HTML, Plain text or image content.


Field Summary
static booleandebug
           
 
Constructor Summary
DOCXGenerator()
          Creates a new instance of DOCXGenerator
 
Method Summary
 voidaddPageBreakToContentBuffer()
          Adds a page break to the content buffer and all the content appended after that will be on the next page when printed
 voidappendDocxToContentBuffer(java.io.File file)
          Appends the whole content of the Docx file from the File to the content buffer.
 voidappendDocxToContentBuffer(java.net.URL file)
          Appends the whole content of the Docx file from the given URL to the content buffer.
 voidappendHTMLContentToContentBuffer(java.lang.String content)
          Appends new HTML string to existing content buffer.
 voidappendPlainTextContentToContentBuffer(java.lang.String content)
          Appends the Plain Text string content to the content buffer.
 voidappendRTFBase64EncodedStringToContentBuffer(java.lang.String base64EncodedRTFString)
          Appends RTF content encoded as Base64 string to the content buffer.
 voidappendRTFFileToContentBuffer(java.io.InputStream is)
          Appends RTF file from the InputStream to the content buffer.
 voidappendRTFFileToContentBuffer(java.net.URL file)
          Appends RTF file from the URL to the content buffer.
 voidclearContentBuffer()
          Closes the content buffer and clears the content.
 java.lang.StringcloseBufferAndGenerateDOCX()
          Generates the DOCX content automatically for given content buffer created previously by using openContentBuffer() and appendContentXXX() methods. The result will be returned as a String. The returned String will contain the Base64 byte array with the DOCX document.
 voidcloseBufferAndGenerateDOCX(java.io.OutputStream destinationStream)
          Closes the existing content buffer and generates the resulting content from the DOCX Generator - it will be saved in the given OutputStream.
 voidcloseBufferAndGenerateDOCX(java.lang.String destinationFile)
          Generates the DOCX content automatically for given content buffer created previously by using openContentBuffer() and appendContentXXX() methods.
 java.lang.StringgenerateDOCXFromContent(java.lang.String content)
          Generates DOCX automatically for given image or HTML content. The result will be returned as a String. The returned String will contain the Base64 byte array with the DOCX document.
 voidgenerateDOCXFromContent(java.lang.String content, java.io.File destinationFile)
          Generates DOCX automatically for given html content.
 voidgenerateDOCXFromContent(java.lang.String content, java.io.OutputStream destinationStream)
          Generates DOCX automatically for given image or html content.
 voidgenerateDOCXFromContent(java.lang.String content, java.lang.String destinationFile)
          Generates the DOCX automatically for given html content.
 java.lang.StringgenerateDOCXFromHTMLURL(java.lang.String sourceURL)
          Generates DOCX automatically for given URL source containing a HTML file. The result will be returned as a String. The returned String will contain the Base64 byte array with the DOCX document.
 voidgenerateDOCXFromHTMLURL(java.lang.String sourceURL, java.io.File destinationFile)
          Generates DOCX automatically for given URL source containing a HTML file.
 voidgenerateDOCXFromHTMLURL(java.lang.String sourceURL, java.lang.String destinationFile)
          Generates DOCX automatically for given URL source containing a HTML file.
 java.lang.StringgenerateDOCXFromHTMLURL(java.net.URL sourceURL)
          Generates DOCX automatically for given URL source containing a HTML file. The result will be returned as a String. The returned String will contain the Base64 byte array with the DOCX document.
 voidgenerateDOCXFromHTMLURL(java.net.URL sourceURL, java.io.File destinationFile)
          Generates DOCX automatically for given URL source containing a HTML file.
 voidgenerateDOCXFromHTMLURL(java.net.URL sourceURL, java.io.OutputStream fos)
          Generates DOCX automatically for given URL source containing a HTML file.
 java.lang.StringgenerateDOCXFromPlainTextContent(java.lang.String content)
          Generates DOCX automatically for given Plain text content. The result will be returned as a String. The returned String will contain the Base64 byte array with the DOCX document.
 voidgenerateDOCXFromPlainTextContent(java.lang.String content, java.io.File destinationFile)
          Generates DOCX automatically for given Plain text content.
 voidgenerateDOCXFromPlainTextContent(java.lang.String content, java.io.OutputStream destinationStream)
          Generates DOCX automatically for given Plain text content.
 voidgenerateDOCXFromPlainTextContent(java.lang.String content, java.lang.String destinationFile)
          Generates DOCX automatically for given Plain text content.
 voidgenerateDOCXFromRTFContentBase64String(java.lang.String rtfString, java.io.OutputStream outputStream)
          Generates DOCX automatically for given URL source containing a base64 encoded Rich Text Format RTF string.
 java.lang.StringgenerateDOCXFromRTFInputStream(java.io.InputStream rtfStream)
          Generates DOCX automatically for given InputStream containing a Rich Text Format RTF file. The result will be returned as a String. The returned String will contain the Base64 byte array with the DOCX document.
 voidgenerateDOCXFromRTFInputStream(java.io.InputStream rtfStream, java.io.OutputStream outputStream)
          Generates DOCX automatically for given InputStream containing a Rich Text Format RTF file.
 java.lang.StringgenerateDOCXFromRTFURL(java.lang.String sourceURL)
          Generates DOCX automatically for given URL source containing a Rich Text Format RTF file. The result will be returned as a String. The returned String will contain the Base64 byte array with the DOCX document.
 voidgenerateDOCXFromRTFURL(java.lang.String sourceURL, java.io.File destinationFile)
          Generates DOCX automatically for given URL source containing a Rich Text Format RTF file.
 voidgenerateDOCXFromRTFURL(java.lang.String sourceURL, java.lang.String destinationFile)
          Generates DOCX automatically for given URL source containing a Rich Text Format RTF file.
 java.lang.StringgenerateDOCXFromRTFURL(java.net.URL sourceURL)
          Generates DOCX automatically for given URL source containing a Rich Text Format RTF file.  The result will be returned as a String. The returned String will contain the Base64 byte array with the DOCX document.
 voidgenerateDOCXFromRTFURL(java.net.URL sourceURL, java.io.File destinationFile)
          Generates DOCX automatically for given URL source containing a Rich Text Format RTF file.
 voidgenerateDOCXFromRTFURL(java.net.URL sourceURL, java.io.OutputStream fos)
          Generates HTML automatically for given URL source containing a Rich Text Format RTF file.
 voidgenerateDOCXFromURL(java.lang.String sourceURL)
          Generates DOCX automatically for given URL source.
 voidgenerateDOCXFromURL(java.lang.String sourceURL, java.io.File destinationFile)
          Generates DOCX automatically for given URL source and saves the result to destinationFile.
 voidgenerateDOCXFromURL(java.lang.String sourceURL, java.io.OutputStream destinationStream)
          Generates DOCX automatically for given URL source and saves the result to the given OutputStream.
 voidgenerateDOCXFromURL(java.lang.String sourceURL, java.lang.String destinationFile)
          Generates DOCX automatically for given URL source and saves the result to destinationFile.
 java.lang.StringgenerateDOCXFromURL(java.net.URL sourceURL)
          Generates DOCX automatically for given URL source and saves the result will be returned as Base64 Encoded String.  The returned String will contain the Base64 byte array with the DOCX document.
 voidgenerateDOCXFromURL(java.net.URL sourceURL, java.io.OutputStream destinationStream)
          Generates DOCX automatically for given URL source and saves the result to destinationStream.
 booleangetXMLMode()
          Returns the XML mode for the renderer.
 booleanisResizePageToFitContent()
           Returns is the page resizing to fit the content is set. The default is false
static voidmain(java.lang.String[] args)
           
 voidopenContentBuffer()
          Opens the new content buffer for inserting content to be used for dynamic HTML generation.
 voidsetMarginsForStandardPageFormat(int top, int bottom, int left, int right)
          Sets the margins to be used when the page format is set using the standard string like "A4" or "Letter" - this values will not be considered it PageFormat object is used to set the page format
 voidsetPageFormat(java.awt.print.PageFormat pageFormat)
          Sets the page format to be used for generating the docx document as PageFormat.
 voidsetResizePageToFitContent(boolean resize)
           If set to true the page will resize automatically to fit the width of the content. The default is false
 voidsetStandardPageFormat(java.lang.String standardPageFormat, java.lang.String orientation)
          Sets the standard page format to be used for generating the docx document as string such as "A4", "Letter" etc. and page orientation such as "Portrait" or "Landscape".
 voidsetXMLMode(boolean mode)
          Sets the XML mode for the renderer - this will define how custom XML tags will be rendered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Constructor Detail

DOCXGenerator

public DOCXGenerator()
Creates a new instance of HTMLGenerator

Method Detail

generateDOCXFromURL

public void generateDOCXFromURL(java.lang.String sourceURL)
                         throws java.io.UnsupportedEncodingException,
                                java.io.IOException,
                                java.lang.Exception
Generates DOCX automatically for given URL source. It will display a file dialog for to specify where the generated content should be saved. The content of the URL will be recognized automatically from Docx, HTML, RTF, TXT, Images etc.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromURL

public void generateDOCXFromURL(java.lang.String sourceURL,
                                java.lang.String destinationFile)
                         throws java.net.MalformedURLException,
                                java.io.UnsupportedEncodingException,
                                java.io.IOException,
                                java.lang.Exception
Generates DOCX automatically for given URL source and saves the result to destinationFile as a string. The content of the URL will be recognized automatically from Docx, HTML, RTF, TXT, Images etc.

Throws:
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromURL

public void generateDOCXFromURL(java.lang.String sourceURL,
                                java.io.OutputStream destinationStream)
                         throws java.net.MalformedURLException,
                                java.io.UnsupportedEncodingException,
                                java.io.IOException,
                                java.lang.Exception
Generates DOCX automatically for given URL source and saves the result to the given OutputStream as a string. The content of the URL will be recognized automatically from Docx, HTML, RTF, TXT, Images etc.

Throws:
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromURL

public void generateDOCXFromURL(java.lang.String sourceURL,
                                java.io.File destinationFile)
                         throws java.net.MalformedURLException,
                                java.io.UnsupportedEncodingException,
                                java.io.IOException,
                                java.lang.Exception
Generates DOCX automatically for given URL source and saves the result to destinationFile as string. The content of the URL will be recognized automatically from Docx, HTML, RTF, TXT, Images etc.

Throws:
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromURL

public void generateDOCXFromURL(java.net.URL sourceURL,
                                java.io.OutputStream destinationStream)
                         throws java.lang.Exception
Generates DOCX automatically for given URL source and saves the result to destinationStream as string. The content of the URL will be recognized automatically from Docx, HTML, RTF, TXT, Images etc.

Throws:
java.lang.Exception

generateDOCXFromURL

public java.lang.String generateDOCXFromURL(java.net.URL sourceURL)
                                     throws java.lang.Exception
Generates DOCX automatically for given URL source and saves the result will be returned as Base64 Encoded String. The content of the URL will be recognized automatically from RTF, HTML, TXT, Images etc.

Throws:
java.lang.Exception

generateDOCXFromHTMLURL

public void generateDOCXFromHTMLURL(java.lang.String sourceURL,
                                    java.lang.String destinationFile)
                             throws java.net.MalformedURLException,
                                    java.io.UnsupportedEncodingException,
                                    java.io.IOException,
                                    java.lang.Exception
Generates DOCX automatically for given URL source containing a HTML file. The result will be saved to the given destinationFile.

Throws:
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromHTMLURL

public void generateDOCXFromHTMLURL(java.lang.String sourceURL,
                                    java.io.File destinationFile)
                             throws java.net.MalformedURLException,
                                    java.io.UnsupportedEncodingException,
                                    java.io.IOException,
                                    java.lang.Exception
Generates DOCX automatically for given URL source containing a HTML file. The result will be saved to the given destinationFile.

Throws:
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromHTMLURL

public void generateDOCXFromHTMLURL(java.net.URL sourceURL,
                                    java.io.File destinationFile)
                             throws java.io.UnsupportedEncodingException,
                                    java.io.IOException,
                                    java.lang.Exception
Generates DOCX automatically for given URL source containing a HTML file. The result will be saved to the given destinationFile.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromHTMLURL

public void generateDOCXFromHTMLURL(java.net.URL sourceURL,
                                    java.io.OutputStream fos)
                             throws java.io.UnsupportedEncodingException,
                                    java.io.IOException,
                                    java.lang.Exception
Generates DOCX automatically for given URL source containing a HTML file. The result will be saved to the given OutputStream.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromHTMLURL

public java.lang.String generateDOCXFromHTMLURL(java.net.URL sourceURL)
                                         throws java.io.UnsupportedEncodingException,
                                                java.io.IOException,
                                                java.lang.Exception
Generates DOCX automatically for given URL source containing a HTML file. The result will be returned as a String.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromHTMLURL

public java.lang.String generateDOCXFromHTMLURL(java.lang.String sourceURL)
                                         throws java.io.UnsupportedEncodingException,
                                                java.io.IOException,
                                                java.net.MalformedURLException,
                                                java.lang.Exception
Generates DOCX automatically for given URL source containing a HTML file. The result will be returned as a String.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.net.MalformedURLException
java.lang.Exception

generateDOCXFromRTFURL

public void generateDOCXFromRTFURL(java.lang.String sourceURL,
                                   java.lang.String destinationFile)
                            throws java.net.MalformedURLException,
                                   java.io.UnsupportedEncodingException,
                                   java.io.IOException,
                                   java.lang.Exception
Generates DOCX automatically for given URL source containing a Rich Text Format RTF file. The result will be saved to the given destinationFile.

Throws:
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromRTFURL

public void generateDOCXFromRTFURL(java.lang.String sourceURL,
                                   java.io.File destinationFile)
                            throws java.net.MalformedURLException,
                                   java.io.UnsupportedEncodingException,
                                   java.io.IOException,
                                   java.lang.Exception
Generates DOCX automatically for given URL source containing a Rich Text Format RTF file. The result will be saved to the given destinationFile.

Throws:
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromRTFURL

public void generateDOCXFromRTFURL(java.net.URL sourceURL,
                                   java.io.File destinationFile)
                            throws java.io.FileNotFoundException,
                                   java.net.MalformedURLException,
                                   java.io.UnsupportedEncodingException,
                                   java.io.IOException,
                                   java.lang.Exception
Generates DOCX automatically for given URL source containing a Rich Text Format RTF file. The result will be saved to the given destinationFile. All images will be embedded in the HTML code as base64 encoded strings

Throws:
java.io.FileNotFoundException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromRTFURL

public void generateDOCXFromRTFURL(java.net.URL sourceURL,
                                   java.io.OutputStream fos)
                            throws java.io.IOException,
                                   java.io.UnsupportedEncodingException,
                                   java.lang.Exception
Generates HTML automatically for given URL source containing a Rich Text Format RTF file. The result will be saved to the given OutputStream.

Throws:
java.io.IOException
java.io.UnsupportedEncodingException
java.lang.Exception

generateDOCXFromRTFURL

public java.lang.String generateDOCXFromRTFURL(java.net.URL sourceURL)
                                        throws java.io.IOException,
                                               java.io.UnsupportedEncodingException,
                                               java.lang.Exception
Generates DOCX automatically for given URL source containing a Rich Text Format RTF file. The result will be returned as a String.

Throws:
java.io.IOException
java.io.UnsupportedEncodingException
java.lang.Exception

generateDOCXFromRTFURL

public java.lang.String generateDOCXFromRTFURL(java.lang.String sourceURL)
                                        throws java.io.IOException,
                                               java.io.UnsupportedEncodingException,
                                               java.net.MalformedURLException,
                                               java.lang.Exception
Generates DOCX automatically for given URL source containing a Rich Text Format RTF file. The result will be returned as a String.

Throws:
java.io.IOException
java.io.UnsupportedEncodingException
java.net.MalformedURLException
java.lang.Exception

generateDOCXFromRTFContentBase64String

public void generateDOCXFromRTFContentBase64String(java.lang.String rtfString,
                                                   java.io.OutputStream outputStream)
                                            throws java.io.UnsupportedEncodingException,
                                                   java.io.IOException,
                                                   java.lang.Exception
Generates DOCX automatically for given URL source containing a base64 encoded Rich Text Format RTF string. The result will be saved to the given OutputStream.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromRTFInputStream

public void generateDOCXFromRTFInputStream(java.io.InputStream rtfStream,
                                           java.io.OutputStream outputStream)
                                    throws java.io.UnsupportedEncodingException,
                                           java.io.IOException,
                                           java.lang.Exception
Generates DOCX automatically for given InputStream containing a Rich Text Format RTF file. The result will be saved to the given OutputStream.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromRTFInputStream

public java.lang.String generateDOCXFromRTFInputStream(java.io.InputStream rtfStream)
                                                throws java.lang.Exception
Generates DOCX automatically for given InputStream containing a Rich Text Format RTF file. The result will be returned as a String.

Throws:
java.lang.Exception

setXMLMode

public void setXMLMode(boolean mode)
Sets the XML mode for the renderer - this will define how custom XML tags will be rendered.


setMarginsForStandardPageFormat

public void setMarginsForStandardPageFormat(int top,
                                            int bottom,
                                            int left,
                                            int right)
Sets the margins to be used when the page format is set using the standard string like "A4" or "Letter" - this values will not be considered it PageFormat object is used to set the page format


setStandardPageFormat

public void setStandardPageFormat(java.lang.String standardPageFormat,
                                  java.lang.String orientation)
Sets the standard page format to be used for generating the docx document as string such as "A4", "Letter" etc. and page orientation such as "Portrait" or "Landscape". You can also set the page margins using the method setMarginsForStandardPageFormat


setPageFormat

public void setPageFormat(java.awt.print.PageFormat pageFormat)
Sets the page format to be used for generating the docx document as PageFormat. The page margins will be retrieved directly from the pageFormat object


getXMLMode

public boolean getXMLMode()
Returns the XML mode for the renderer. The default is false


setResizePageToFitContent

public void setResizePageToFitContent(boolean resize)
If set to true the page will resize automatically to fit the width of the content. The default is false

isResizePageToFitContent

public boolean isResizePageToFitContent()
Returns is the page resizing to fit the content is set. The default is false

openContentBuffer

public void openContentBuffer()
Opens the new content buffer for inserting content to be used for dynamic HTML generation. This should be used in conjuction with closeBufferAndGeneratePDF() and appendXXXContentToContentBuffer(String content) methods.


appendHTMLContentToContentBuffer

public void appendHTMLContentToContentBuffer(java.lang.String content)
Appends new HTML string to existing content buffer. This should be used in conjuction with openContentBuffer() and closeBufferAndGeneratePDF(). The HTML content will be appended to existing content previously appended for example from Docx or RTF files. See closeBufferAndGenerateHTML for how to create the resulting
 HTML content.


appendPlainTextContentToContentBuffer

public void appendPlainTextContentToContentBuffer(java.lang.String content)
Appends the Plain Text string content to the content buffer. The Plain Text content will be appended to existing content previously appended for example from HTML, Docx or RTF files. See closeBufferAndGenerateHTML for how to create the resulting
 HTML content.


appendDocxToContentBuffer

public void appendDocxToContentBuffer(java.net.URL file)
Appends the whole content of the Docx file from the given URL to the content buffer. See closeBufferAndGenerateHTML for how to create the resulting
 HTML content.


appendDocxToContentBuffer

public void appendDocxToContentBuffer(java.io.File file)
Appends the whole content of the Docx file from the File to the content buffer. See closeBufferAndGenerateHTML for how to create the resulting
 HTML content.


appendRTFFileToContentBuffer

public void appendRTFFileToContentBuffer(java.net.URL file)
Appends RTF file from the URL to the content buffer. The newly converted HTML content will be appended to existing content previously appended for example from HTML, Text, Docx or RTF files. See closeBufferAndGenerateHTML for how to create the resulting
 HTML content.


appendRTFFileToContentBuffer

public void appendRTFFileToContentBuffer(java.io.InputStream is)
Appends RTF file from the InputStream to the content buffer. The newly converted HTML content will be appended to existing content previously appended for example from HTML, Text, Docx or RTF files. See closeBufferAndGenerateHTML for how to create the resulting
 HTML content.


appendRTFBase64EncodedStringToContentBuffer

public void appendRTFBase64EncodedStringToContentBuffer(java.lang.String base64EncodedRTFString)
Appends RTF content encoded as Base64 string to the content buffer. The newly convrted HTML content will be appended to existing content previously appended for example from HTML, Text, Docx or RTF files. See closeBufferAndGenerateHTML for how to create the resulting
 HTML content.


addPageBreakToContentBuffer

public void addPageBreakToContentBuffer()
Adds a HTML page break to the content buffer and all the content appended after that will be on the next page when printed


closeBufferAndGenerateDOCX

public void closeBufferAndGenerateDOCX(java.io.OutputStream destinationStream)
                                throws java.io.UnsupportedEncodingException,
                                       java.io.IOException,
                                       java.lang.Exception
Closes the existing content buffer and generates the resulting content from the DOCX Generator - it will be saved in the given OutputStream. This should be used in conjuction with openContentBuffer() and appendContentToContentBuffer(String content). These methods are very useful in environments where long content srings cannot be inserted at once due to some limitations as happens for example in Oracle Forms. See supplied examples in the users manual.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

closeBufferAndGenerateDOCX

public void closeBufferAndGenerateDOCX(java.lang.String destinationFile)
                                throws java.io.UnsupportedEncodingException,
                                       java.io.IOException,
                                       java.lang.Exception
Generates the HTML content automatically for given content buffer created previously by using openContentBuffer() and appendContentXXX() methods. It will generate the file to the given destinationFile.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

closeBufferAndGenerateDOCX

public java.lang.String closeBufferAndGenerateDOCX()
                                            throws java.io.UnsupportedEncodingException,
                                                   java.io.IOException
Generates the HTML content automatically for given content buffer created previously by using openContentBuffer() and appendContentXXX() methods. The resulting content is returned as a String.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException

clearContentBuffer

public void clearContentBuffer()
Closes the content buffer and clears the content.


generateDOCXFromContent

public void generateDOCXFromContent(java.lang.String content,
                                    java.io.OutputStream destinationStream)
                             throws java.io.UnsupportedEncodingException,
                                    java.io.IOException,
                                    java.lang.Exception
Generates DOCX automatically for given image or html content. It will generate the DOCX file and save it to the given OutputStream.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromContent

public java.lang.String generateDOCXFromContent(java.lang.String content)
                                         throws java.io.UnsupportedEncodingException,
                                                java.io.IOException
Generates DOCX automatically for given image or HTML content. It will generate the DOCX file and return the resulting DOCX String.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException

generateDOCXFromContent

public void generateDOCXFromContent(java.lang.String content,
                                    java.lang.String destinationFile)
                             throws java.io.FileNotFoundException,
                                    java.io.UnsupportedEncodingException,
                                    java.io.IOException,
                                    java.lang.Exception
Generates the DOCX automatically for given html content. The resulting DOCX file will be saved to the given destinationFile

Throws:
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromContent

public void generateDOCXFromContent(java.lang.String content,
                                    java.io.File destinationFile)
                             throws java.io.FileNotFoundException,
                                    java.io.UnsupportedEncodingException,
                                    java.io.IOException,
                                    java.lang.Exception
Generates DOCX automatically for given html content. The resulting DOCX content will be saved to the given destinationFile

Throws:
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromPlainTextContent

public java.lang.String generateDOCXFromPlainTextContent(java.lang.String content)
                                                  throws java.lang.Exception
Generates DOCX automatically for given Plain text content. It will generate the DOCX as a String

Throws:
java.lang.Exception

generateDOCXFromPlainTextContent

public void generateDOCXFromPlainTextContent(java.lang.String content,
                                             java.io.OutputStream destinationStream)
                                      throws java.lang.Exception
Generates DOCX automatically for given Plain text content. It will generate the DOCX to the given OutputStream

Throws:
java.lang.Exception

generateDOCXFromPlainTextContent

public void generateDOCXFromPlainTextContent(java.lang.String content,
                                             java.lang.String destinationFile)
                                      throws java.io.UnsupportedEncodingException,
                                             java.io.IOException,
                                             java.lang.Exception
Generates DOCX automatically for given Plain text content. It will generate the DOCX to the given destinationFile

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

generateDOCXFromPlainTextContent

public void generateDOCXFromPlainTextContent(java.lang.String content,
                                             java.io.File destinationFile)
                                      throws java.io.UnsupportedEncodingException,
                                             java.io.IOException,
                                             java.lang.Exception
Generates DOCX automatically for given Plain text content. It will generate the DOCX to the given destinationFile

Throws:
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception

main

public static void main(java.lang.String[] args)