Writing multiline text in pdf. Auto splitting

I want write long text in pdf. Does exist any way to split it to lines automaticly using only pdf specification?

6 0 obj
    << /Length 999 >>
    stream
        BT
            /F1 24 Tf 
            100 520 Td 
            (loooooong looooo...ooong text) Tj 
        ET
    endstream
endobj

As result text goes out of right border of page. I can split text by ', but it means I will have to calculate length of every word and split text, when sum of lengths reach some number.

6 0 obj
    << /Length 999 >>
    stream
        BT
            /F1 24 Tf 
            30 TL
            100 520 Td 
            (loooooong looooo...ooong text) Tj
            (loooooong looooo...ooong text) '
            (loooooong looooo...ooong text) '
        ET
    endstream
endobj

I want something like:

6 0 obj
    << /Length 999 >>
    stream
        BT
            /F1 24 Tf 
            100 520 Td
            YYY XX
            (loooooong looooo...ooong text) Tj 
        ET
    endstream
endobj

where YYY is length of line and XX some operator.

Upvotes: 1

Views: 126

Answers (1)

David van Driessche
David van Driessche

Reputation: 7048

No.

Short answer, but that's because it's not possible. PDF allows you to very accurately specify where each character needs to go, but it can't automatically do line-splitting for you. That's always your responsibility.

Upvotes: 2

Related Questions