Is there a question in there somewhere?
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Do Hello in red, then world in black.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Could you write a small class that extends PdfContentByte and write a new method with the parameters that you want to pass that simply calls the original setCMYKColorFillF method followed by the showTextAligned method? Then you can call that new method as you need.
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
That's now how I wanted to do it.
I know iwould have to do this
WriteTxt.setCMYKColorFillF(00, 99, 100, 00);
WriteTxt.showTextAligned(0 ,"Hello", 100, 20, 0f);
WriteTxt.setCMYKColorFillF(00, 00, 00, 00);
WriteTxt.showTextAligned(0 ,"World", 120, 20, 0f);
The problem with setCMYKColorFillF is that u can't specify what text of string you want to change.
It should be like WriteTxt.setCMYKColorFillF(00, 00, 00, 00, "World") or something like that.
Well, I'm sorry. There are a lot of things I don't like, that doesn't mean I don't have to do them. darkagn has it correct, create one of your own. Or, search the library you're using (I don't know which one it is) and see if there is a another method (or simply an overloaded version of the same) that does what you want, if not, as already said, implement a "convenience" method, yourself. If the method your using doesn't allow what you want, directly, then you aren't going to be able change that (you could always suggest an enhancement to whoever produced the library, though).
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
One way to do this, will be to embed it in html code. I.e.
String helloStrng = " Hello
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494