You are only looking at "current" but can also look at "current + 1" and
"current - 1" to decide what to do.
 
Paulo


________________________________

        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom
Tolman
        Sent: Thursday, November 08, 2007 7:02 PM
        To: [email protected]
        Subject: [iText-questions] Question about splitCharacter
        
        

         

         

        I have implemented SplitCharacter and was hoping to have it
split after the close parenthesis ')', but not before this character,
As such I have something like:

         

        public boolean isSplitCharacter(int start, int current, int end,
char[] cc, PdfChunk[] ck) {

           char c;

           if (ck == null)

               c = cc[current];

           else

               c = ck[Math.min(current, ck.length -
1)].getUnicodeEquivalent(cc[current]);

           if ((c ')') || (c==' ')) {

               return true;

           }

         

        This appears to work in some situations such as the breaking of
"aaa)bbb" is correct and desired as:

        aaa) 

        bbb 

         

        However, in the case where a closing parenthesis ends the line,
it is treating it as a "split before character".  In other words, the
line:

         

        hello (test)

         

        is split as follows:

        hello (test

        )

         

        instead of what I want which is:

        hello

        (test)

         

         

        According to the implicit definition "treat a split character as
if it can go at the beginning or end of a line" it is working, but what
I desire is "treat this split character as if it only can go on the end
of the line".

         

        So my questions are:

         

        1) Is there native support for this concept of the split
character being at the start or end of a contiguous set of characters?

        2) If not, can I "force" it by breaking the text into chunks
that are stuck next to each other?

        3) If breaking the text into chunks does not work, is the only
real remaining course of action to insert line breaks manually?

         

        Thanks for any ideas,

         

         

         



Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to