thuliobuarque / java2word

Automatically exported from code.google.com/p/java2word
0 stars 0 forks source link

Bold / Italic / font sizing #87

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

It would by very handy to support bold / italic / font sizing and selections.

Original issue reported on code.google.com by bherrma...@gmail.com on 16 Feb 2012 at 8:50

GoogleCodeExporter commented 8 years ago
what do you mean exactly? selections? bold italic where? maybe give some 
examples or attach a file with final results

thanks! Leonardo  

Original comment by leonardo...@gmail.com on 16 Feb 2012 at 10:47

GoogleCodeExporter commented 8 years ago
I just want to be able to change the font size and coloring for contents in a 
paragraph.

Original comment by bherrma...@gmail.com on 16 Feb 2012 at 11:47

GoogleCodeExporter commented 8 years ago
It is all done already: 
http://java2word.blogspot.com.au/p/all-in-one-example.html

IDocument myDoc = new Document2004();

ParagraphPiece myParPieceJava = ParagraphPiece.with("I like Java and ")
                .withStyle().font(Font.COURIER).create();
        ParagraphPiece myParPieceRuby = ParagraphPiece.with("Ruby!!! ")
                .withStyle().bold().italic().create();
        ParagraphPiece myParPieceAgile = ParagraphPiece
                .with("I actually like Java, Ruby Agile, BDD, Cucumber... ")
                .withStyle().textColor("008000").create();

        myDoc.addEle(Paragraph.withPieces(myParPieceJava, myParPieceRuby,
                myParPieceAgile).create());

or 

myDoc.addEle(Paragraph.withPieces(
                ParagraphPiece.with("This is a manual 'bold' and 'italic'")
                        .withStyle().font(Font.COURIER).bold().italic()
                        .create()).create());

Original comment by leonardo...@gmail.com on 17 Feb 2012 at 1:42

GoogleCodeExporter commented 8 years ago
Thanks!

Original comment by bherrma...@gmail.com on 17 Feb 2012 at 2:03

GoogleCodeExporter commented 8 years ago
closing this issue, thanks

Original comment by leonardo...@gmail.com on 17 Feb 2012 at 11:46