SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsferyx.administration.docxgenerator.DOCXGenerator
public class DOCXGenerator
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 boolean | debug
|
Constructor Summary | |
---|---|
DOCXGenerator()
Creates a new instance of DOCXGenerator |
Method Summary | |
---|---|
void | addPageBreakToContentBuffer()
Adds a page break to the content buffer and all the content appended after that will be on the next page when printed |
void | appendDocxToContentBuffer(java.io.File file)
Appends the whole content of the Docx file from the File to the content buffer. |
void | appendDocxToContentBuffer(java.net.URL file)
Appends the whole content of the Docx file from the given URL to the content buffer. |
void | appendHTMLContentToContentBuffer(java.lang.String content)
Appends new HTML string to existing content buffer. |
void | appendPlainTextContentToContentBuffer(java.lang.String content)
Appends the Plain Text string content to the content buffer. |
void | appendRTFBase64EncodedStringToContentBuffer(java.lang.String base64EncodedRTFString)
Appends RTF content encoded as Base64 string to the content buffer. |
void | appendRTFFileToContentBuffer(java.io.InputStream is)
Appends RTF file from the InputStream to the content buffer. |
void | appendRTFFileToContentBuffer(java.net.URL file)
Appends RTF file from the URL to the content buffer. |
void | clearContentBuffer()
Closes the content buffer and clears the content. |
java.lang.String | closeBufferAndGenerateDOCX()
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. |
void | closeBufferAndGenerateDOCX(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. |
void | closeBufferAndGenerateDOCX(java.lang.String destinationFile)
Generates the DOCX content automatically for given content buffer created previously by using openContentBuffer() and appendContentXXX() methods. |
java.lang.String | generateDOCXFromContent(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. |
void | generateDOCXFromContent(java.lang.String content,
java.io.File destinationFile)
Generates DOCX automatically for given html content. |
void | generateDOCXFromContent(java.lang.String content,
java.io.OutputStream destinationStream)
Generates DOCX automatically for given image or html content. |
void | generateDOCXFromContent(java.lang.String content,
java.lang.String destinationFile)
Generates the DOCX automatically for given html content. |
java.lang.String | generateDOCXFromHTMLURL(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. |
void | generateDOCXFromHTMLURL(java.lang.String sourceURL,
java.io.File destinationFile)
Generates DOCX automatically for given URL source containing a HTML file. |
void | generateDOCXFromHTMLURL(java.lang.String sourceURL,
java.lang.String destinationFile)
Generates DOCX automatically for given URL source containing a HTML file. |
java.lang.String | generateDOCXFromHTMLURL(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. |
void | generateDOCXFromHTMLURL(java.net.URL sourceURL,
java.io.File destinationFile)
Generates DOCX automatically for given URL source containing a HTML file. |
void | generateDOCXFromHTMLURL(java.net.URL sourceURL,
java.io.OutputStream fos)
Generates DOCX automatically for given URL source containing a HTML file. |
java.lang.String | generateDOCXFromPlainTextContent(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. |
void | generateDOCXFromPlainTextContent(java.lang.String content,
java.io.File destinationFile)
Generates DOCX automatically for given Plain text content. |
void | generateDOCXFromPlainTextContent(java.lang.String content,
java.io.OutputStream destinationStream)
Generates DOCX automatically for given Plain text content. |
void | generateDOCXFromPlainTextContent(java.lang.String content,
java.lang.String destinationFile)
Generates DOCX automatically for given Plain text content. |
void | generateDOCXFromRTFContentBase64String(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.String | generateDOCXFromRTFInputStream(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. |
void | generateDOCXFromRTFInputStream(java.io.InputStream rtfStream,
java.io.OutputStream outputStream)
Generates DOCX automatically for given InputStream containing a Rich Text Format RTF file. |
java.lang.String | generateDOCXFromRTFURL(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. |
void | generateDOCXFromRTFURL(java.lang.String sourceURL,
java.io.File destinationFile)
Generates DOCX automatically for given URL source containing a Rich Text Format RTF file. |
void | generateDOCXFromRTFURL(java.lang.String sourceURL,
java.lang.String destinationFile)
Generates DOCX automatically for given URL source containing a Rich Text Format RTF file. |
java.lang.String | generateDOCXFromRTFURL(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. |
void | generateDOCXFromRTFURL(java.net.URL sourceURL,
java.io.File destinationFile)
Generates DOCX automatically for given URL source containing a Rich Text Format RTF file. |
void | generateDOCXFromRTFURL(java.net.URL sourceURL,
java.io.OutputStream fos)
Generates HTML automatically for given URL source containing a Rich Text Format RTF file. |
void | generateDOCXFromURL(java.lang.String sourceURL)
Generates DOCX automatically for given URL source. |
void | generateDOCXFromURL(java.lang.String sourceURL,
java.io.File destinationFile)
Generates DOCX automatically for given URL source and saves the result to destinationFile. |
void | generateDOCXFromURL(java.lang.String sourceURL,
java.io.OutputStream destinationStream)
Generates DOCX automatically for given URL source and saves the result to the given OutputStream. |
void | generateDOCXFromURL(java.lang.String sourceURL,
java.lang.String destinationFile)
Generates DOCX automatically for given URL source and saves the result to destinationFile. |
java.lang.String | generateDOCXFromURL(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. |
void | generateDOCXFromURL(java.net.URL sourceURL,
java.io.OutputStream destinationStream)
Generates DOCX automatically for given URL source and saves the result to destinationStream. |
boolean | getXMLMode()
Returns the XML mode for the renderer. |
boolean | isResizePageToFitContent()
Returns is the page resizing to fit the content is set. The default is false |
static void | main(java.lang.String[] args)
|
void | openContentBuffer()
Opens the new content buffer for inserting content to be used for dynamic HTML generation. |
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 |
void | setPageFormat(java.awt.print.PageFormat pageFormat)
Sets the page format to be used for generating the docx document as PageFormat. |
void | setResizePageToFitContent(boolean resize)
If set to true the page will resize automatically to fit the width of the content. The default is false |
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". |
void | setXMLMode(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 |
---|
public static boolean debug
Constructor Detail |
---|
public DOCXGenerator()
Method Detail |
---|
public void generateDOCXFromURL(java.lang.String sourceURL) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromURL(java.lang.String sourceURL, java.lang.String destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromURL(java.lang.String sourceURL, java.io.OutputStream destinationStream) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromURL(java.lang.String sourceURL, java.io.File destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromURL(java.net.URL sourceURL, java.io.OutputStream destinationStream) throws java.lang.Exception
java.lang.Exception
public java.lang.String generateDOCXFromURL(java.net.URL sourceURL) throws java.lang.Exception
java.lang.Exception
public void generateDOCXFromHTMLURL(java.lang.String sourceURL, java.lang.String destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromHTMLURL(java.lang.String sourceURL, java.io.File destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromHTMLURL(java.net.URL sourceURL, java.io.File destinationFile) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromHTMLURL(java.net.URL sourceURL, java.io.OutputStream fos) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public java.lang.String generateDOCXFromHTMLURL(java.net.URL sourceURL) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public java.lang.String generateDOCXFromHTMLURL(java.lang.String sourceURL) throws java.io.UnsupportedEncodingException, java.io.IOException, java.net.MalformedURLException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.net.MalformedURLException
java.lang.Exception
public void generateDOCXFromRTFURL(java.lang.String sourceURL, java.lang.String destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromRTFURL(java.lang.String sourceURL, java.io.File destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
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
java.io.FileNotFoundException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromRTFURL(java.net.URL sourceURL, java.io.OutputStream fos) throws java.io.IOException, java.io.UnsupportedEncodingException, java.lang.Exception
java.io.IOException
java.io.UnsupportedEncodingException
java.lang.Exception
public java.lang.String generateDOCXFromRTFURL(java.net.URL sourceURL) throws java.io.IOException, java.io.UnsupportedEncodingException, java.lang.Exception
java.io.IOException
java.io.UnsupportedEncodingException
java.lang.Exception
public java.lang.String generateDOCXFromRTFURL(java.lang.String sourceURL) throws java.io.IOException, java.io.UnsupportedEncodingException, java.net.MalformedURLException, java.lang.Exception
java.io.IOException
java.io.UnsupportedEncodingException
java.net.MalformedURLException
java.lang.Exception
public void generateDOCXFromRTFContentBase64String(java.lang.String rtfString, java.io.OutputStream outputStream) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromRTFInputStream(java.io.InputStream rtfStream, java.io.OutputStream outputStream) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public java.lang.String generateDOCXFromRTFInputStream(java.io.InputStream rtfStream) throws java.lang.Exception
java.lang.Exception
public void setXMLMode(boolean mode)
public void setMarginsForStandardPageFormat(int top, int bottom, int left, int right)
public void setStandardPageFormat(java.lang.String standardPageFormat, java.lang.String orientation)
public void setPageFormat(java.awt.print.PageFormat pageFormat)
public boolean getXMLMode()
public void setResizePageToFitContent(boolean resize)
public boolean isResizePageToFitContent()
public void openContentBuffer()
public void appendHTMLContentToContentBuffer(java.lang.String content)
public void appendPlainTextContentToContentBuffer(java.lang.String content)
public void appendDocxToContentBuffer(java.net.URL file)
public void appendDocxToContentBuffer(java.io.File file)
public void appendRTFFileToContentBuffer(java.net.URL file)
public void appendRTFFileToContentBuffer(java.io.InputStream is)
public void appendRTFBase64EncodedStringToContentBuffer(java.lang.String base64EncodedRTFString)
public void addPageBreakToContentBuffer()
public void closeBufferAndGenerateDOCX(java.io.OutputStream destinationStream) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void closeBufferAndGenerateDOCX(java.lang.String destinationFile) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public java.lang.String closeBufferAndGenerateDOCX() throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void clearContentBuffer()
public void generateDOCXFromContent(java.lang.String content, java.io.OutputStream destinationStream) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public java.lang.String generateDOCXFromContent(java.lang.String content) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateDOCXFromContent(java.lang.String content, java.lang.String destinationFile) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromContent(java.lang.String content, java.io.File destinationFile) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public java.lang.String generateDOCXFromPlainTextContent(java.lang.String content) throws java.lang.Exception
java.lang.Exception
public void generateDOCXFromPlainTextContent(java.lang.String content, java.io.OutputStream destinationStream) throws java.lang.Exception
java.lang.Exception
public void generateDOCXFromPlainTextContent(java.lang.String content, java.lang.String destinationFile) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public void generateDOCXFromPlainTextContent(java.lang.String content, java.io.File destinationFile) throws java.io.UnsupportedEncodingException, java.io.IOException, java.lang.Exception
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.Exception
public static void main(java.lang.String[] args)
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |