GithubHelp home page GithubHelp logo

java2word's People

java2word's Issues

version number in

1) I m trying this java2word to make a doc file but getting a error in my 
eclipse .
java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main" 

2) Java2word is not support to web based project ?

Original issue reported on code.google.com by [email protected] on 14 Jun 2011 at 8:33

Attachments:

(Question) Can java2word can be used to read the .DOC or .DOT files.

Sudheer said...

    Hey Leonardo,
    Can java2word can be used to read the .DOC or .DOT files.
    I have a requirement like this, is this achievable using JAVA.
    Can we convert a .DOT (a word template file) to a .DOC (ms word document file) programmatically by filling some values at given places.

    Ex: My MS Word template file would have "Attribute Display Name: Attribute Value", a key:pair value types, the program should fill these values with the array of values I pass.

    Let me know if such thing is achievable mostly in Java or C/C++.

    --
    Sudheer

Original issue reported on code.google.com by [email protected] on 13 Dec 2010 at 8:17

Super Fluent Interface


If you don't remember about Fluent Interfce, take a look at issue 13.

Every time I want to set something to "bold" currently I have to use the method 
"setBold" and pass "true". Eg.:

        IElement par = ParagraphPiece.with("piece01").withStyle()
                .setBold(true).create();

I was thinking why do I have to "set" and pass "true"? I implemented the code 
and know that setBold(false) doesn't make any difference.

The Java language is full of verbose itself. Fluent interface we are tying to 
make the code smaller, readable and clear. 

I will refactor all those methods. I will remove "set" and pass parameter only 
when necessary. Eg.: fontSize("14").

This is without Super Fluent (current implementation):

        IElement par = ParagraphPiece.with("piece01").withStyle()
                .setBold(false)
                .setItalic(false)
                .setUnderline(false)
                .setFontSize("50").create();


This is with Super Fluent (new upcoming implementation):


        IElement par = ParagraphPiece.with("piece01").withStyle()
                .bold()
                .italic()
                .underline()
                .fontSize("50").create();


Less verbose and more code!


Solution will be:
- deprecate the method "setBold(true)" 
- create a new method "bold()" doing whatever the the deprecated does
- remove deprecated methods in the version 3.0.

This will be done FOR ALL ELEMENTS.


cheers

Leonardo

Original issue reported on code.google.com by [email protected] on 23 Mar 2011 at 4:21

Issue with ProGuard on Android

Hi,

I am using this wonderful library on Android. Works beautifully without code 
obfuscation. When starting Proguard, it complains about:

Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.thoughtworks.xstream.io.binary.ReaderDepthState$1) that doesn't come with 
an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.


Did you download j2w-ejb-2.0.zip or built from the source code?
Downloaded


What steps will reproduce the problem?
1. Create an Android app with this library. It runs fine (both on emulator and 
on a real device)
2. Obfuscate the code with Proguard, this produces the aforementioned warning 
and consequently many class not found errors.


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 20 Jun 2011 at 6:48

Fluent Interface for Elements and Superstylin - Refactoring

I friend of my suggest me to read about Fluent Interface (FI). 

I read the following two article and realized that FI suits very well 
situations where you need to create complex specifications of behavior.

Articles:
http://www.martinfowler.com/bliki/FluentInterface.html
http://en.wikipedia.org/wiki/Fluent_interface

Here is an example of fluent interface:

// Example without fluent interface
myCar2 = Car();
myCar2.setSpeed(100);
myCar2.setColor('blue');
myCar2.setDoors(5);

// Fluent interface
myCar = Car();
myCar.setSpeed(100).setColor('blue').setDoors(5);


Other example is the Java JPA:

entityManager.createNamedQuery("Student.findByNameAgeGender")
             .setParameter("name", name)
             .setParameter("age", age)
             .setParameter("gender", gender)
             .setFirstResult(1)
             .setMaxResults(30)
             .setHint("hintName", "hintValue")
             .getResultList();



I noticed that without FI, we have to create many objects and associate them 
after. 

I quite like FI and will be a nice refactoring!

Leoanrdo

Original issue reported on code.google.com by [email protected] on 4 Nov 2010 at 10:20

java.lang.NoClassDefFoundError: word/api/interfaces/IElement

What steps will reproduce the problem?
1. I added the jar in and created a class file and deploy the project war in 
tomcat and while running the project its giving java.lang.NoClassDefFoundError: 
word/api/interfaces/IElement

2. All the jars are present in the lib folder - crosschecked.


What is the expected output? What do you see instead?

It should run fine, when i tried running though a main it is working fine

These are the classes included

import word.api.interfaces.IDocument;

import word.w2004.Document2004;
import word.w2004.elements.BreakLine;

import word.w2004.elements.ImageLocation;
import word.w2000.elements.Paragraph;
import word.w2004.elements.Image;

public void getReport() {

        File fileObj = new File("xyz.doc");

        PrintWriter writer = null;
        try {

            writer = new PrintWriter(fileObj);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        //Create the word document
        IDocument myDoc = new Document2004();
                 //There is content in here that i want to write in the .doc file

                String myWord = myDoc.getContent();



        writer.println(myWord);
        writer.close();
    }



What version of the product are you using? On what operating system?

2004 , Operating system is XP, Its working fine through main only when i create 
a war file i am calling internally the class containing the import its throwing 
exception  java.lang.NoClassDefFoundError: word/api/interfaces/IElement 

Please provide any additional information below.

The problem occur when i create a war and deploy that on the server the file 
gives an exception.
Can you please suggest something on this

Thanks.

Original issue reported on code.google.com by [email protected] on 17 Feb 2011 at 9:51

(Tech Debt) Better maven groupId and artifactId

I am not sure if the maven groupId (java2word) and artifactId (j2w) are 
appropriated. Maybe groupId could be "com.google.java2word" and the artifactId 
could stay the same. It is just an idea for future versions... 

Original issue reported on code.google.com by [email protected] on 8 Aug 2010 at 12:21

Page Margins

Can you add Page Margins?
1cm=567 in file

Sample of page with 1.2 cm margins(567*1.2):
  <w:body>
    <w:p wsp:rsidR="00B9302D" wsp:rsidRDefault="00B5361A"/>
    <w:sectPr wsp:rsidR="00B9302D" wsp:rsidSect="00B5361A">
      <w:pgSz w:w="11906" w:h="16838"/>
      <w:pgMar w:top="680" w:right="680" w:bottom="680" w:left="680" w:header="709" w:footer="709" w:gutter="0"/>
      <w:cols w:space="708"/>
      <w:docGrid w:line-pitch="360"/>
    </w:sectPr>
  </w:body>

Original issue reported on code.google.com by dublicator on 25 Mar 2011 at 12:00

Wordart

I am starting to implement WordArt in Sharp2Word. When I finish this, then tell 
you.See example.

Original issue reported on code.google.com by dublicator on 23 Mar 2011 at 9:19

Attachments:

Gradle spike for building


Gradle sounds like a powerful tool to build Java projects. I have been playing 
around with it and I am pretty happy. 

I like the possibility to use different languages. Gradle provides support for 
Java, Groovy, Python, Scala and others... I don't think it supports Ruby yet 
but I would be pretty happy with Scala. 

I will create a very simple script to build the Java2word Jar file.

Gradle is a little bit slow to startup. It takes around 4 or 5 secs. After that 
runs quickly. I don't thing this would be an issue and I am sure Gradle team 
will look at this later on.

More info:
http://gradle.org/


Leonardo


Original issue reported on code.google.com by [email protected] on 31 Mar 2011 at 12:49

Generate Table of Contents/Bookmarks

Hi,
Thanks a lot for creating such a good project, it helps us a lot.

I am using struts and tomcat.
can we add bookmark? 

I have gone through the hyper-link issue... so may be if we implement bookmark, 
that both together will solve my issue, I want to jump to the particular 
bookmark with hyper-link of "table of content" (Index) in the document.

please find the attachment for details

Original issue reported on code.google.com by [email protected] on 1 Jul 2011 at 10:01

Attachments:

Loss of text encoding when using "template mode"

What web framework and version are you using (Struts1, Struts2, Spring,
JBoss Seam)?
Struts 1.3


Did you download j2w-ejb-2.0.zip or built from the source code?
Downloaded the jar


Which web server did you deploy your .WAR (Tomcat, JBoss)?
Tomcat

Are you using Maven or Ant?
Eclipse

What is your Operational System?
Windows 7 64, production server is linux


What steps will reproduce the problem?
1. follow template example
2. use attached file to merge some placeholders (here starting with an f)
3. see resulting file received in browser, alla accents and most of the 
punctuation turned to ascii characters


Please provide any additional information below.

I used Word 2010 to save my file as a word 2003 xml file.

Code used to read and generate :

        ServletContext sc = request.getSession().getServletContext();
        String xmlTemplate = Utils.readFile(sc.getRealPath("/modeles_word/test5.xml"));

        response.setContentType("application/msword");
        response.setHeader("Content-disposition", "inline; filename="
                        + "Convention_stage_OGF.doc");

        PrintWriter writer = response.getWriter();

        writer.println(xmlTemplate);

        response.flushBuffer();

Original issue reported on code.google.com by [email protected] on 23 Mar 2011 at 12:51

Attachments:

Implement superscript and subscript font styles

I implemented some font styles in ParagraphPieceStyle:
        private boolean subscript;
        private boolean superscript;

        public ParagraphPieceStyle Subscript()
        {
                subscript = true;
                return this;
        }

        public ParagraphPieceStyle Superscript()
        {
                superscript = true;
                return this;
        }

       public override string GetNewContentWithStyle(string txt)
        {
...
            doStyleSubscript(style);
            doStyleSuperscript(style);
...
            return doStyleReplacement(style, txt);
        }

        private void doStyleSubscript(StringBuilder style)
        {
            if (this.subscript)
            {
                style.append("\n            <w:vertAlign w:val=\"subscript\"/>");
            }
        }

        private void doStyleSuperscript(StringBuilder style)
        {
            if (this.superscript)
            {
                style.append("\n            <w:vertAlign w:val=\"superscript\"/>");
            }
        }

Original issue reported on code.google.com by dublicator on 24 Mar 2011 at 2:34

Body margin implementation

Hi,

I implement a new method to set the body margin of word documents.

I attach to the Issue a Zip File which contains the java classes updated :
- Body.java
- IBody.java

Guillaume DARONA

Original issue reported on code.google.com by [email protected] on 21 Mar 2011 at 11:19

Attachments:

Add a embedded object into word file

Hi,

Is that possible to add a embedded object(like pdf file,image) in our word 
generated file by using Java2word ?

Actuaallly I want a pdf file as a embedded object ,want to show pdf file icon 
into Word file and after clicking on that pdf icon ,then it will open that pdf 
file .

I am sending a word file including a object .

Is that possible to create the same by using java2word?

please need a help .

Thanks & regards 
Milind patil 

Original issue reported on code.google.com by [email protected] on 28 Jun 2011 at 10:35

Attachments:

Unable to open document due to & character

What web framework and version are you using (Struts1, Struts2, Spring,
JBoss Seam)?

Spring


Did you download j2w-ejb-2.0.zip or built from the source code?
Yes


Which web server did you deploy your .WAR (Tomcat, JBoss)?
Tomcat

Are you using Maven or Ant?
No

What is your Operational System?
Windows XP


What steps will reproduce the problem?
1.
IDocument myDoc = new Document2004();
myDoc.addEle(Paragraph.withPieces(ParagraphPiece.with("Test & 
Test").create()).create());
String myWord = myDoc.getContent();
PrintWriter writer = response.getWriter();         
writer.println(myWord);

Run the program with this code.

This program causes problems to open document and is showing the message "Can 
not opened because there are problems with the content", with OK and Cancel 
options. 

This document will not show any content.
Note : '&' character is not accpting by Paragraph/ParagraphPiece object.
2.
3.


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 15 Apr 2011 at 8:51

(Tech Debt) Improve Exception Messages

Other day, I had an exception "Can't create ImageIO". So I implemented the code 
and was confused what exactly happened. 

So all runtime exeption should explain the problem and be implemented in a 
similar way. 

Part of the exception code I returns "error" - This needs refactoring! 

I do as I see but the issues is opened to remind me!

Leonardo

Original issue reported on code.google.com by [email protected] on 9 Aug 2010 at 9:14

Add method to ParagraphPieceStyle.java

Maybe it would be logical to write it:
        public ParagraphPieceStyle setFontSize(int size)
        {
            this._fontSize = (size*2).toString();
            return this;
        }

Original issue reported on code.google.com by dublicator on 22 Mar 2011 at 7:42

Error using the template

What web framework and version are you using (Struts1, Struts2, Spring,
JBoss Seam)?
Testing in a Simple Java Class


Did you download j2w-ejb-2.0.zip or built from the source code?
Downloaded


Which web server did you deploy your .WAR (Tomcat, JBoss)?
StandAlone Class


Are you using Maven or Ant?
Non


What is your Operational System?
Windows XP


What steps will reproduce the problem?
1. I created a simple Java Class with the code of the metohod public void 
testTemplate() { .... }
2. I Used your Template to test
3. The documetn gets generated but whe I try to open it with MS Word shows an 
error:

"Word has detected an error when trying to open the file" (Spanish Traduction 
Sorry);

Please provide any additional information below.

At first I thought was an issue about the table as you will see in the next 
section, but in other tests I´ve done i tried only to change the "phDateTime" 
but the error persists.

Attached I'm Sending the template(ReleaseNotesTemplate.doc), the generated file 
(Java2word_allInOne.doc) and the testing class (Testing.java)

The JAR I´m using is the latest I´ve found at the site.
(j2w-ejb-2.0_2011Apr14.jar)


I use the repair file function that comes with MS Word and I was able to open 
the file and inside it shows this:


Release Notes – Production

This is a dummy template to be used for Java2Word. It is a normal  W2003 XML 
but renamed to .doc.

Project Name: phProjectName

Version: 1.0 beta

Project Leader: Leonardo Correa


Those are the JIRA issues in this version:


    <w:tbl> 
            <w:tblPr> 
                <w:tblW w:w="0" w:type="auto"/> 
                <w:tblBorders> 
                    <w:top w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:left w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:bottom w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:right w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:insideH w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:insideV w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                </w:tblBorders> 
                <w:tblLook w:val="00BF"/> 
            </w:tblPr> 
            <w:tblGrid> 
                <w:gridCol w:w="4258"/> 
                <w:gridCol w:w="4258"/> 
            </w:tblGrid> 
        <w:tr wsp:rsidR="00505659" wsp:rsidRPr="004374EC" wsp:rsidTr="004374EC">


                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                        <w:shd w:val="clear" w:color="auto" w:fill="E0E0E0"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="004374EC" wsp:rsidRDefault="00505659"> 
                        <w:pPr> 
                            <w:rPr> 
                                <w:b/> 
                            </w:rPr> 
                        </w:pPr> 
                        <w:r wsp:rsidRPr="004374EC"> 
                            <w:rPr> 
                                <w:b/> 
                            </w:rPr> 
                            <w:t>Jira Number</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 


                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                        <w:shd w:val="clear" w:color="auto" w:fill="E0E0E0"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="004374EC" wsp:rsidRDefault="00505659"> 
                        <w:pPr> 
                            <w:rPr> 
                                <w:b/> 
                            </w:rPr> 
                        </w:pPr> 
                        <w:r wsp:rsidRPr="004374EC"> 
                            <w:rPr> 
                                <w:b/> 
                            </w:rPr> 
                            <w:t>Description</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
        </w:tr>
        <w:tr wsp:rsidR="00505659" wsp:rsidRPr="00505659">
                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="00505659" wsp:rsidRDefault="00505659"> 
                        <w:r wsp:rsidRPr="00505659"> 
                            <w:t>J2W-1234</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="00505659" wsp:rsidRDefault="00505659"> 
                        <w:r wsp:rsidRPr="00505659"> 
                            <w:t>Read Templates nicelly</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
        </w:tr>
        <w:tr wsp:rsidR="00505659" wsp:rsidRPr="00505659">
                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="00505659" wsp:rsidRDefault="00505659"> 
                        <w:r wsp:rsidRPr="00505659"> 
                            <w:t>J2W-9999</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="00505659" wsp:rsidRDefault="00505659"> 
                        <w:r wsp:rsidRPr="00505659"> 
                            <w:t>Make Java2word funky!!!</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
        </w:tr>

    </w:tbl>



Instructions:

    <w:p wsp:rsidR="008979E8" wsp:rsidRDefault="00000000">

  <w:pPr>  <w:jc w:val="left"/> 


     </w:pPr>


        <w:r>

            <w:t>1) Stop the server</w:t>
        </w:r>
    </w:p>  <w:p wsp:rsidR="008979E8" wsp:rsidRDefault="00000000">

  <w:pPr>  <w:jc w:val="left"/> 


     </w:pPr>


        <w:r>

            <w:t>2) Run the script to deploy the app xxx</w:t>
        </w:r>
    </w:p>  <w:p wsp:rsidR="008979E8" wsp:rsidRDefault="00000000">

  <w:pPr>  <w:jc w:val="left"/> 


     </w:pPr>


        <w:r>

            <w:t>3) Start the server</w:t>
        </w:r>
    </w:p>  <w:p wsp:rsidR="008979E8" wsp:rsidRDefault="00000000">

  <w:pPr>  <w:jc w:val="left"/> 


     </w:pPr>


        <w:r>

            <w:t>4) Hope for the best</w:t>
        </w:r>
    </w:p>






Company: EasyWorld - coding for fun pty



Date: Wed May 04 10:39:11 COT 2011








Normal
Normal
Fuente de párrafo predeter.
Fuente de párrafo predeter.
0،Tabla normal
Tabla normal
0؉Sin lista
Sin lista
Encabezado
Encabezado
Encabezado Car
Encabezado Car
Pie de página
Pie de página
Pie de página Car
Pie de página Car
[Content_Types].xml¬‘ËjÃ0
_rels/.rels„?ÏjÃ0
theme/theme/themeManager.xml
theme/theme/theme1.xmlìYMo
F{oc'v
Zmu)Æ4ñP‚c`;
/Ú^Í|¼¥?«Kx=#bj
3SçÅ—O~{öäÅWŸþþÝ£

ø¦À£2|Hc"ÑMr
'IX-\L
?4hf?6?Õ
theme/theme/_rels/themeManager.xml.rels„?M

Â0
g‘K(M&$R(.1˜r
[Content_Types].xmlPK
_rels/.relsPK
theme/theme/themeManager.xmlPK
theme/theme/theme1.xmlPK
theme/theme/_rels/themeManager.xml.relsPK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<a:clrMap xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" 
bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" 
accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" 
hlink="hlink" folHlink="folHlink"/>
8http://schemas.microsoft.com/office/mac/office/2008/main
8http://schemas.microsoft.com/office/mac/office/2008/main
!urn:schemas-microsoft-com:mac:vml
!urn:schemas-microsoft-com:mac:vml
Unknownÿ!
Times New Roman
Times New Roman
Symbol
Symbol
Century Gothic
Century Gothic
Cambria
Cambria
Cambria Math
Cambria Math
Normal.dotm
Microsoft Office Word
" WMFC
Cambria
Cambri
Cambri
Company: phCompanyName8
Company: phCompanyName8
Date: phDateTimeB
Date: phDateTimeB
Cambria
Cambri
Cambri
Cambria
Cambri
Cambri
Cambria
Cambria
Release Notes
Release Notes
This is a dummy template to be used for Java2Word. It is a normal  W2003 XML 
This is a dummy template to be used for Java2Word. It is a normal  W2003 XML 
but renamed to .doc
but renamed to .doc
Cambria
Cambri
Cambri
Project
Project
phProjectName
phProjectName
Version:?
Version:?
phVersion
phVersion
Project Leader=
Project Leader=
phProjectLeader
phProjectLeader
Century Gothic
Centur
Centur
 Gothic
 Gothic
Century Gothic
Centur
Centur
 Gothic
 Gothic
Those are the JIRA issues
Those are the JIRA issues
 this version
 this version
phTableIssues
phTableIssues
Cambria
Cambri
Cambri
Instructions:
Instructions:
phInstructions8
phInstructions8
"System
Cambria
Company: EasyWorld - coding for fun pty


Date: Wed May 04 10:39:11 COT 2011
Cambria
Cambria
Cambria
Cambria
Release Notes
Productiono
This is a dummy template to be used for Java2Word. It is a normal  W2003 XML 
but renamed to .doca


Cambria
Project:
phProjectName
Version:
1.0 beta
Project Leader
Leonardo Correa
"Century Gothic
 Century Gothic
Those are the JIRA issues
in this version
<w:tbl> 
            <w:tblPr> 
                <w:tblW w:w="0" w:type="auto"/> 
                <w:tblBorders> 
                    <w:top w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:left w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:bottom w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:right w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:insideH w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                    <w:insideV w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="000000"/> 
                </w:tblBorders> 
                <w:tblLook w:val="00BF"/> 
            </w:tblPr> 
            <w:tblGrid> 
                <w:gridCol w:w="4258"/> 
                <w:gridCol w:w="4258"/> 
            </w:tblGrid> 
        <w:tr wsp:rsidR="00505659" wsp:rsidRPr="004374EC" wsp:rsidTr="004374EC">


                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                        <w:shd w:val="clear" w:color="auto" w:fill="E0E0E0"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="004374EC" wsp:rsidRDefault="00505659"> 
                        <w:pPr> 
                            <w:rPr> 
                                <w:b/> 
                            </w:rPr> 
                        </w:pPr> 
                        <w:r wsp:rsidRPr="004374EC"> 
                            <w:rPr> 
                                <w:b/> 
                            </w:rPr> 
                            <w:t>Jira Number</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 


                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                        <w:shd w:val="clear" w:color="auto" w:fill="E0E0E0"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="004374EC" wsp:rsidRDefault="00505659"> 
                        <w:pPr> 
                            <w:rPr> 
                                <w:b/> 
                            </w:rPr> 
                        </w:pPr> 
                        <w:r wsp:rsidRPr="004374EC"> 
                            <w:rPr> 
                                <w:b/> 
                            </w:rPr> 
                            <w:t>Description</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
        </w:tr>
        <w:tr wsp:rsidR="00505659" wsp:rsidRPr="00505659">
                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="00505659" wsp:rsidRDefault="00505659"> 
                        <w:r wsp:rsidRPr="00505659"> 
                            <w:t>J2W-1234</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="00505659" wsp:rsidRDefault="00505659"> 
                        <w:r wsp:rsidRPr="00505659"> 
                            <w:t>Read Templates nicelly</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
        </w:tr>
        <w:tr wsp:rsidR="00505659" wsp:rsidRPr="00505659">
                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="00505659" wsp:rsidRDefault="00505659"> 
                        <w:r wsp:rsidRPr="00505659"> 
                            <w:t>J2W-9999</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
                <w:tc> 
                    <w:tcPr> 
                        <w:tcW w:w="4258" w:type="dxa"/> 
                    </w:tcPr> 
                    <w:p wsp:rsidR="00505659" wsp:rsidRPr="00505659" wsp:rsidRDefault="00505659"> 
                        <w:r wsp:rsidRPr="00505659"> 
                            <w:t>Make Java2word funky!!!</w:t> 
                        </w:r> 
                    </w:p> 
                </w:tc> 
        </w:tr>

    </w:tbl>
Cambria
Instructions:
<w:p wsp:rsidR="008979E8" wsp:rsidRDefault="00000000">

  <w:pPr>  <w:jc w:val="left"/> 


     </w:pPr>


        <w:r>

            <w:t>1) Stop the server</w:t>
        </w:r>
    </w:p>  <w:p wsp:rsidR="008979E8" wsp:rsidRDefault="00000000">

  <w:pPr>  <w:jc w:val="left"/> 


     </w:pPr>


        <w:r>

            <w:t>2) Run the script to deploy the app xxx</w:t>
        </w:r>
    </w:p>  <w:p wsp:rsidR="008979E8" wsp:rsidRDefault="00000000">

  <w:pPr>  <w:jc w:val="left"/> 


     </w:pPr>


        <w:r>

            <w:t>3) Start the server</w:t>
        </w:r>
    </w:p>  <w:p wsp:rsidR="008979E8" wsp:rsidRDefault="00000000">

  <w:pPr>  <w:jc w:val="left"/> 


     </w:pPr>


        <w:r>

            <w:t>4) Hope for the best</w:t>
        </w:r>
    </w:p>


Root Entry
1Table
1Table
WordDocument
WordDocument
SummaryInformation
SummaryInformation
DocumentSummaryInformation
DocumentSummaryInformation
CompObj
CompObj
Documento de Microsoft Office Word 97-2003
MSWordDoc
Word.Document.8



PS: Hope this help you to improve the code. I have tested some more features 
and for me works Great, I'm using the Struts example with Jboss, but I need to 
make it work with WebSphere I'll let you know if it works.

I think this API is simple and works fine. Greetings From Colombia.

Sincerely,

Adrian Cubillos
[email protected]

Original issue reported on code.google.com by [email protected] on 4 May 2011 at 3:55

Attachments:

DocumentProperties

I created class Properties for DocumentProperties. See attach file. 
I hope you will understand the code

Original issue reported on code.google.com by dublicator on 21 Mar 2011 at 3:25

Attachments:

problem with cirrylic text

What web framework and version are you using (Struts1, Struts2, Spring,
JBoss Seam)?

It's not a WEB project.

Did you download j2w-ejb-2.0.zip or built from the source code?

Downloaded class files.

Which web server did you deploy your .WAR (Tomcat, JBoss)?

It's not a WEB project.

Are you using Maven or Ant?

It's not a WEB project.

What is your Operational System?

WinXP

What steps will reproduce the problem?
1.
2.
3.


Please provide any additional information below.

Code works fine:
IDocument myDoc = new Document2004();
myDoc.addEle(Paragraph.with("english text").create());

Code prodeces a file that could not be opened:
IDocument myDoc = new Document2004();
myDoc.addEle(Paragraph.with("русский текст").create());



Original issue reported on code.google.com by [email protected] on 12 Apr 2011 at 1:08

Image styling

reported by Jitendra Rajput.

Image has no style at the moment. Maybe start with align (left, right).
I had this on the plan... will do it soon. Watch this issue to get informed ok.


thanks again!

cheers

Leonardo  


Original issue reported on code.google.com by [email protected] on 7 Mar 2011 at 12:47

(Task) Add all fonts

<a 
href="http://office.microsoft.com/en-us/infopath-help/which-fonts-are-included-i
n-office-2003-HA001187231.aspx">Here</a> you can see list of all fonts in Word 
2003. Can you add this into ParagraphPieceStyle?

Original issue reported on code.google.com by dublicator on 19 Mar 2011 at 10:03

Attachments:

add a image from Web url

Hi,

I am trying to add a image from Web url and getting the following exception .
I attached here my sample program.can u plz help me How can I resolve this 
problem .
I am using struts2 in my application ,Is that possible to direct access the web 
url from my localhost apllication.
can u plz help me ,its Urgent plz.

Please.......

thanks 

Hemlata



program mmm run 
Exception in thread "main" java.lang.RuntimeException: Can't create ImageIO. 
Maybe the path is not valid. Path: 
http://www.google.com/images/logos/ps_logo2.png
ImageLocation: WEB_URL
    at word.w2004.elements.Image.<init>(Image.java:48)
    at word.w2004.elements.Image.from_WEB_URL(Image.java:147)
    at Testdoc.main(Testdoc.java:49)
Caused by: javax.imageio.IIOException: Can't get input stream from URL!
    at javax.imageio.ImageIO.read(Unknown Source)
    at word.w2004.elements.Image.<init>(Image.java:41)
    ... 2 more
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.URL.openStream(Unknown Source)
    ... 4 more

Original issue reported on code.google.com by [email protected] on 30 Jun 2011 at 8:50

Attachments:

New-Development

Hi,
For my word document I need some function where are not develop on your API.
I develop it and I send you the source file I update for your validation.

I develop to upgrade : 
- highlight on paragraph
- setting tabs align and position on a paragraph (it's useful to align some 
value on the right border page)

For this upgrade I modify to classes :
- Paragraph.java
- ParagraphStyle.java

I send you a zip file with the 2 java source file, a java code and a word DOC 
file for demo.

Thx.
Guillaume DARONA

Original issue reported on code.google.com by [email protected] on 11 Mar 2011 at 10:47

Attachments:

encoding ISO8859-1 instead of UTF-8

Output file: is it possible to have the first line

<?xml version="1.0" encoding="ISO8859-1" standalone="yes"?>

instead of

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

because of accented vowels ?

Tank you.
Francesco Navarria

Original issue reported on code.google.com by [email protected] on 4 Apr 2011 at 2:15

133% scale of image

also when i tried:

myDoc.addEle(new 
word.w2004.elements.Image("1.png",ImageLocation.FULL_LOCAL_PATH));

It insert image but with 133% scale in properties of image object in word. I 
want 100%.

Original issue reported on code.google.com by [email protected] on 12 Apr 2011 at 1:12

Create a WAR version of the Web Test Application

At the moment if you want to deploy the Web Test App in order to test your word 
document, you have to use JBoss (or any EJB container). 

We need to create a Web Test App to be deployed on Tomcat. The intention is 
eliminate the dependency of JBoss. I know that a lot of people use Tomcat and 
it is much lighter.

Before someone ask, I utilized JBoss Seam for the Web Test because I am 
currently working with it. I know that there is no reason to use an EAR 
application because the code is so simple.

It could be a very simple Web App using only Servlet and the code could be 
something like:

      servletResponse.setContentType("application/msword");
      servletResponse.setHeader("Content-disposition", "inline;filename=wordDoc.doc");

      PrintWriter writer = servletResponse.getWriter();
      writer.println(put_here_xml_generated_by_getContent);


It could be called "j2w-web-test", WAR app built using maven. 

It should have one page with a big textarea and a submit button sending the 
content to this Servlet above.

It doesn't really need to be fancy. 


any volunteers? 



Leonardo


Original issue reported on code.google.com by [email protected] on 1 Nov 2010 at 12:33

Table, When I pass empty string ("") to TD, cell is not drown!

(reported by Igor Samardzija)

When I pass empty string ("") to TD, cell is not drown!

Yes Igor, I realized this issue. solution will be: if the content is "", the 
component Table will make it " ". This "space" will draw the cell properly.  

Leonardo

Original issue reported on code.google.com by [email protected] on 6 Mar 2011 at 10:34

If the Image path is invalid => ArrayIndexOutOfBoundsException at word.w2004.elements.Image.setUpSize [Image.java:50]

Since I appear to be the first to add a bug report to this library, then let me 
first congratulate you on this fine piece of work :)

Now, getting down to the small bug that I discovered:

When calling
myDoc.getBody().addEle(new Image("/wrong/path/image.jpg"))

then Image.getContent() will be called, which in turn will call 
Image.setUpSize() [Image.java:82].

Then getOriginalWidthHeight() will be called at Image.java:48, which instead of 
throwing IOException will instead return the string "error".

Then this string will be "split" to an array with one element, which will then 
throw an ArrayIndexOutOfBoundsException at Image.java:50

If you want to silently ignore these errors, then I guess the solution would be 
to add a check at Image.java:49 :

if (wh.length > 1) {
  String ww = wh[0];
  String hh = wh[1];
  if("".equals(this.width)){
    this.width = ww; 
  }
  if("".equals(this.height)){
    this.height = hh; 
  }
}

Otherwise, maybe you can just throw an IOException in case of an invalid image 
file.

Actually, I got to this error because I use your library in a web application 
(as your example also shows), and I assumed that the "/full/image/path" refers 
to an URL of an image served by the application.

Which brings me to another issue, about possibly allowing the use of an URL 
instead of the "/full/image/path", because ImageIO.read() can also read from an 
URL. Otherwise, I don't know how can I specify the image path in my 
web-application, because the application is being served from a WAR file and 
ServletContext.getRealPath will return null.
If preferable, I will open another Issue report for this issue.

Original issue reported on code.google.com by [email protected] on 29 Jul 2010 at 3:22

(Task) Design Framework to Apply Style

(Design) Design a new framework to apply style to elements/text (Now everything 
takes default styles). This I will think carefully because can get really messy 
I don't design well. 

Original issue reported on code.google.com by [email protected] on 8 Aug 2010 at 12:22

Make Java2word only one project.


Currently, the development environment you have to check out those projects: 
j2w-app, j2w-ear, j2w-ejb, j2w-war.

There is also the web testing project: j2w-webtest 
(http://code.google.com/p/java2word/source/browse/#svn%2Ftrunk%2Fj2w-webtest%253
Fstate%253Dclosed)

This page shows how to set up the dev environment: 
http://code.google.com/p/java2word/wiki/How_to_Implement_a_New_Element


I had those four projects (j2w-app, j2w-ear, j2w-ejb, j2w-war.) because 
Java2word started inside a JBoss Seam project, using EJB.

Nowadays, there is no reason to have j2w-app, j2w-ear, j2w-ejb, j2w-war. 


As part of the simplification process of this library, I will make j2w-ejb the 
only one and renamed to java2word. 

Future will be:
- check out java2word svn code:
- run maven clean install (my alais is mci)

Done!

j2w-webtest project will keep the same...


Who will be affected? only java2word developers - not who use the library.



cheers
Leonardo



Original issue reported on code.google.com by [email protected] on 25 Mar 2011 at 5:06

Read Template files

Feature:
As a Java2word user or java developer
I want to provide my own template 
So that I can use Java2word elements to replace place holders

Scenario:
Given I have my MS Word template
And this template saved as 2003 XML
And optionally renamed to xxx.doc

When I read my template
And replace all place holders with java2word elements
Then I should see the document with place holders replaced


* I will create a wiki page with steps to work with templates


Original issue reported on code.google.com by [email protected] on 22 Mar 2011 at 6:03

(Task) Example Using all Components in the API

(Task) In the current ExampleStruts, create an example Word Document where we 
use a little bit of everything. Place to see all components working eg.: 
Header, footer, images, page numbers, paragraphs, break line, break page, 
headings1 to 3 (in order to generate table of contents) and tables. 

Original issue reported on code.google.com by [email protected] on 8 Aug 2010 at 12:12

Word says generated file is corrupted

What steps will reproduce the problem?
1. Generate simple word document using Document2004 (I used the code from the 
first excample removing the image, as a "hello world" test)
2. Serve as docx file using 
"application/vnd.openxmlformats-officedocument.wordprocessingml.document; 
charset=utf-8" as content type
3. Open in word (Opens just fine, using OpenOffice or LibreOffice, though)

What is the expected output? What do you see instead?
Word says the file is corrupt and cannot be opened.


What version of the product are you using? On what operating system?
java2word V2 - 07-11-2010, on a Ubuntu Server using an AbstractView from Spring 
framework. (Don't know the Word version i tested, but it's a fairly recent 
version on a Vista computer)

Please provide any additional information below.

This might be a issue with using incorrect content-type and or file extension. 
After trying several combinations of file extensions and content type I found 
the only combination that OpenOffice were able to open was docx and type
"application/vnd.openxmlformats-officedocument.wordprocessingml.document; 
charset=utf-8" (I develop on Linux so I tested using open office). The 
content-type from the excample caused OpenOffice to try to "import" the file 
and ask for charset; no matter what I chose I ended up with a document with the 
source XML as content instead of a formatted document)

But word won't open this file.

It would be nice if the Document implementation could have a method that 
returns the appropriate file extension and content-type so I don't have to 
guess.

Since the output is an XML string, I assume this really is docx, not doc which 
is a binary format, perhaps j2w actually produces a correct document per "spec" 
but MSWord does not implement their own specification correctly in all 
versions, or I've chosen an incorrect content-type that makes Word expect some 
undocumented quirks in to work..?

PS: I'm sorry if this report is a bit longwinded.. I'd really like this to 
work, because this is the first library I've found that is really simple and 
easy and that actually can create a document from scratch.

Original issue reported on code.google.com by [email protected] on 27 Jan 2011 at 3:19

Provide support for open office

My concern is about the fact that, Java2Word is working fine in MS Office(Word) 
but the document so formed is getting rendered in Open Office in a completely 
different format.

So can you please let me know , how to deal with this situation.

Waiting for reply.

Regards

Original issue reported on code.google.com by [email protected] on 14 Jun 2011 at 12:15

Table Style

(reported by Igor Samardzija)

Table will still have the default style but will allow to change it. I don't 
know how much style can be implemented but will give it a try.

Leonardo

Original issue reported on code.google.com by [email protected] on 8 Mar 2011 at 10:24

can not use web URL

What web framework and version are you using (Struts1, Struts2, Spring,
JBoss Seam)?

struts2

Did you download j2w-ejb-2.0.zip or built from the source code?

yes

Which web server did you deploy your .WAR (Tomcat, JBoss)?
tomcat

Are you using Maven or Ant?
no

What is your Operational System?
windows xp


What steps will reproduce the problem?
1.trying to add image
2.
3.


Please provide any additional information below.

error: 
java.lang.RuntimeException: Can't create ImageIO. Maybe the path is not valid. 
Path: 
http://www.google.com/images/logos/ps_logo2.png
ImageLocation: WEB_URL
    at word.w2004.elements.Image.<init>(Image.java:48)
    at word.w2004.elements.Image.from_WEB_URL(Image.java:147)
    at com.tietoenator.artifact.action.B.main(B.java:17)
Caused by: javax.imageio.IIOException: Can't get input stream from URL!
    at javax.imageio.ImageIO.read(Unknown Source)
    at word.w2004.elements.Image.<init>(Image.java:41)
    ... 2 more

Original issue reported on code.google.com by [email protected] on 30 Jun 2011 at 9:07

not supporting in my exsting apllication

private byte[] getword(String xml, String type) throws IOException, 
SAXException, ParserConfigurationException, 
TransformerFactoryConfigurationError, TransformerException, FOPException {
        File fileObj = new File("c:\\Tietoword1.doc"); 
        PrintWriter writer = null;
         IDocument myDoc = null;
     try
     {       
         writer = new PrintWriter(fileObj);     
     }catch(FileNotFoundException e)
     {
         e.printStackTrace();
     }       
     myDoc = new Document2004();
     myDoc.addEle(Heading1.with("===== Headings1 ======").create());  
      //myDoc.encoding("UTF_8");
     myDoc.addEle(BreakLine.times(1).create()); // this is one breakline   
         // Headings       
     myDoc.addEle(Heading1.with("===== Headings1 ======").create());   

     myDoc.addEle(Heading2.with("===== Headings2 ======").create());    
     myDoc.addEle(Paragraph.with("This doc has been generated by the unit test testJava2wordAllInOne() in the         
     myDoc.addEle(BreakLine.times(1).create());


     // Generating the word file here 
     String myWord = myDoc.getContent();
     writer.println(myWord);     
     writer.close();

     res.setContentType("application/msword");
     res.setHeader("Content-disposition", "attachment; filename=myDoc.doc");
     res.setHeader("Cache-Control", "no-cache");


        return null;

    }


I am writing this code in my strut2 apllication . Getting a exception 
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception 

java.lang.reflect.InvocationTargetException
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)
    com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)
    com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
    org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
    org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)


note The full stack trace of the root cause is available in the Apache 
Tomcat/5.5.27 logs.




in my previous code i m generating pdf lik this ..now use the same  for to 
generate word .
my getpdf method is lik this ...
tht is working fine for my application ..i need to same for the word file by 
using ur code .....

private byte[] getpdf(String xml, String type) throws IOException, 
SAXException, ParserConfigurationException, 
TransformerFactoryConfigurationError, TransformerException, FOPException {
        // TODO Auto-generated method stub
        String fo = getfo(type);
        // the XSL FO file
        File xsltfile = new File(fo);
        // the XML file from which we take the name
        final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        final Document document = builder.parse(new InputSource(new StringReader(xml)));
        // Process the source tree with XSL to produce FO 
        //This transformer instance may then be used to process XML from a variety of sources and write the transformation output to a variety of sinks.
        final Transformer transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(xsltfile));
        final DOMSource source = new DOMSource(document);
        final StringWriter transformWriter = new StringWriter();
        final StreamResult streamResult = new StreamResult(transformWriter);
        transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
        transformer.transform(source, streamResult);
        final String foDocument = transformWriter.toString();
        final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        try{
            //final Driver driver=new Driver();
            final Driver driver = new Driver(new InputSource(new StringReader(foDocument)), byteArrayOutputStream);

        driver.setRenderer(Driver.RENDER_PDF);
        driver.run();
        driver.reset();         
        }catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        final byte[] byteArr = byteArrayOutputStream.toByteArray();
        byteArrayOutputStream.close();
        FileOutputStream output = new FileOutputStream("c://test.pdf");

        output.write(byteArr);
        output.flush();
        output.close(); 
        res.setHeader("Content-Disposition"," attachment; filename=Report.pdf ");
        res.setContentType("application/pdf");
        res.setHeader("Cache-Control", "no-cache");
        res.setContentLength(byteArr.length);
        res.getOutputStream().write(byteArr);
        res.getOutputStream().flush();

        return byteArr;

    }



I attached here whole BaseAction class ....
can u plz give the suggession .
thanks & regards
Milind patil

Original issue reported on code.google.com by [email protected] on 20 Jun 2011 at 12:24

Attachments:

Hebrew text gets reversed

What web framework and version are you using (Struts1, Struts2, Spring,
JBoss Seam)?
None.


Did you download j2w-ejb-2.0.zip or built from the source code?
Download.


Which web server did you deploy your .WAR (Tomcat, JBoss)?
Tomcat.

Are you using Maven or Ant?
None.

What is your Operational System?
Windows 7.


What steps will reproduce the problem?
1. I create a Word file with Hebrew text in it and save it using UTF-8 encoding.
2. I can see the text just fine, but the order of the words in the file gets 
reversed, ie. The first word in the line becomes the last (left-most), and so 
on. 


Please provide any additional information below.
Is there a way to tell J2W to set the text alignment to Right-To-Left 
(Ctrl+Shift in Word)?

Original issue reported on code.google.com by [email protected] on 30 May 2011 at 11:48

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.