### RE: Paragraph indentation with no cut lines

```
Hi Robert.
Ok and thank you for your time.
Best regards.
--
View this message in context:
http://old.nabble.com/Paragraph-indentation-with-no-cut-lines-tp33969052p33979960.html
Sent from the FOP - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org

```

### RE: Paragraph indentation with no cut lines

```

@Robert Meyer

Robert Meyer wrote:
Just to clarify, are you asking for a block to be indented from the left
but expand back left if the line was too long to fit in the block?

Almost but not exactly... :)
Let me try to clarify. Indeed, something is missing from the reasoning.

A] Let's say that a paragraph P is a sequence of n lines L1, L2,
..., Ln like for example:

L1: Lorem ipsum dolor sit amet
L2: consectetur adipisicing elit, sed do eiusmod tempor incididunt
...
Ln: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat

B] Let's choose a minimum indentation Imin and a maximum indentation
Imax for P.

C] Let's say that w is the width of the page.

w
-
+-+ Page
| -- would be Imin  |
| -- would be Imax  |
| |
| |
| |
| |
+-+

Then four cases are possible.

Case 1)
All the lines are short enough to be indented using the largest indentation
possible Imax.
P indentation is Imax.

+-+
| -- Imax   |
| |
| | P:
| -- Lorem ipsum| L1
| -- Ut enim| L2
| -- Sed ut perspiciatis| L3
| |
| |
| |
+-+

Case 2)
The largest line length is wk  (w - Imax).
P indentation is wk.

+-+
| -- Imax   |
| --- wk|
| |
| | P:
| --- Lorem ipsum   | L1
| --- Nemo enim ipsam voluptatem qu | L2
| --- Sed ut perspiciatis   | L3
| |
| |
| |
+-+

Case 3)
The largest line length is exactly (w - Imin).
The paragraph indentation is Imin.
(No line is cut.)

+-+
| -- Imin   |
| |
| | P:
| -- Lorem ipsum| L1
| -- sed quia non numquam eius modi tem | L2
| -- Sed ut perspiciatis| L3
| |
| |
| |
+-+

Case 4)
At least one of the lines length is wk  (w - Imin).
This line (and maybe some others) has to be cut.
P indentation is Imin.

+-+
| -- Imin   |
| |
| |
| | P:
| -- Lorem ipsum| L1
| -- sed quia non numquam eius modi tem | L2
| -- consectetur adipisicing elit, sed  | L3
| -- do eiusmod tempor incididunt ut|
| -- labore et dolore magna aliqua. |
| |
| |
| |
+-+

Here it is... is it a little bit clearer :/?

Thank you for helping me :).
Best regards.
--
View this message in context:
http://old.nabble.com/Paragraph-indentation-with-no-cut-lines-tp33969052p33974568.html
Sent from the FOP - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org

```

### RE: Paragraph indentation with no cut lines

```
Hi

Thanks for describing your requirements further. Unfortunately I am unaware of
a feature within FOP that would provide this functionality at this time.

Blocks extend in the inline direction up to the region extents, but I don't
think they have the ability to push back the other way dependant on their
content.

Your best bet at the moment would be to keep the indentation to a minimum and
allow the content to wrap. It would make the document more uniform as the
content would be aligned instead of having varying margins which would make it
look a bit messy.

If you feel it warrants it, you can always raise an issue with FOP to suggest
the addition of this functionality in the future [1]

[1] https://issues.apache.org/bugzilla/

Best Regards,

Robert Meyer

Date: Thu, 7 Jun 2012 02:01:45 -0700
From: lmhe...@orange.fr
To: fop-users@xmlgraphics.apache.org
Subject: RE: Paragraph indentation with no cut lines

@Robert Meyer

Robert Meyer wrote:
Just to clarify, are you asking for a block to be indented from the left
but expand back left if the line was too long to fit in the block?

Almost but not exactly... :)
Let me try to clarify. Indeed, something is missing from the reasoning.

A] Let's say that a paragraph P is a sequence of n lines L1, L2,
..., Ln like for example:

L1: Lorem ipsum dolor sit amet
L2: consectetur adipisicing elit, sed do eiusmod tempor incididunt
...
Ln: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat

B] Let's choose a minimum indentation Imin and a maximum indentation
Imax for P.

C] Let's say that w is the width of the page.

w
-
+-+ Page
| -- would be Imin  |
| -- would be Imax  |
| |
| |
| |
| |
+-+

Then four cases are possible.

Case 1)
All the lines are short enough to be indented using the largest indentation
possible Imax.
P indentation is Imax.

+-+
| -- Imax   |
| |
| | P:
| -- Lorem ipsum| L1
| -- Ut enim| L2
| -- Sed ut perspiciatis| L3
| |
| |
| |
+-+

Case 2)
The largest line length is wk  (w - Imax).
P indentation is wk.

+-+
| -- Imax   |
| --- wk|
| |
| | P:
| --- Lorem ipsum   | L1
| --- Nemo enim ipsam voluptatem qu | L2
| --- Sed ut perspiciatis   | L3
| |
| |
| |
+-+

Case 3)
The largest line length is exactly (w - Imin).
The paragraph indentation is Imin.
(No line is cut.)

+-+
| -- Imin   |
| |
| | P:
| -- Lorem ipsum| L1
| -- sed quia non numquam eius modi tem | L2
| -- Sed ut perspiciatis| L3
| |
| |
| |
+-+

Case 4)
At least one of the lines length is wk  (w - Imin).
This line (and maybe some others) has to be cut.
P indentation is Imin.

+-+
| -- Imin   |
| |
| |
| | P:
| -- Lorem ipsum| L1
| -- sed quia non numquam eius modi tem | L2
| -- consectetur adipisicing elit, sed  | L3
| -- do eiusmod tempor incididunt ut|
| -- labore et dolore magna aliqua. |
| |
| |
| |
+-+

Here it is... is it a little bit clearer :/?

Thank you for helping me :).
Best regards.
--
View this message in context:
http://old.nabble.com/Paragraph-indentation```

### Re: Paragraph indentation with no cut lines

```
It's some kind of fit block to contents and float right I want to do...
--
View this message in context:
http://old.nabble.com/Paragraph-indentation-with-no-cut-lines-tp33969052p33970164.html
Sent from the FOP - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org

```

### RE: Paragraph indentation with no cut lines

```
Hi,

Just to clarify, are you asking for a block to be indented from the left but
expand back left if the line was too long to fit in the block? e.g.

+--+
|-- Indentation
|
|
|
|
|This us a small line.
| This is a longer line that fits.
|Here is a long line that
|exceeds the full width of a
|page.
|
|
|
|
|
+--+

If so, I am not sure that is possible with FOP at present. I suppose if you had
a fixed sized font (Courier), you could implement some XSLT to write each block
and determine it's indentation based upon the length of the text (content)
being written. This will not work though with any variable sized font, so
unless anyone else has any suggestions I think you may need to think again

Let me know if I have misunderstood.

Regards,

Robert Meyer

Date: Wed, 6 Jun 2012 03:11:16 -0700
From: lmhe...@orange.fr
To: fop-users@xmlgraphics.apache.org
Subject: Paragraph indentation with no cut lines

Hello,

Thank you for reading my post.

I'm using an XML data file and an XSL-FO stylesheet to generate a PDF file
using fop.
Here is what I want to do:
I'd like to have some paragraph indented with lines:
- left-aligned,
- uncut (unless they really spread over several lines).
Of course, the contents of the paragraph is variable.
For example:

+---+
|   |
|   |
|   |
|   |
|   |
|Some indented text |
|And another line   |
|And again  |
|   |
|   |
|   |
|   |
|   |
|   |
+---+

If possible, I don't want any of the paragraph lines to be cut.
For example, here is something that I do not want:

+---+
|   |
|   |
|   |
|   |
|   |
|Some cut indented  |
|text   |
|And another line   |
|And again  |
|   |
|   |
|   |
|   |
|   |
|   |
+---+

Here is the result I want instead:

+---+
|   |
|   |
|   |
|   |
|   |
|  Some uncut indented text |
|  And another line |
|  And again|
|   |
|   |
|   |
|   |
|   |
|   |
+---+

Meaning I can't just set a fixed indentation.
The indentation depends on the longest line in the paragraph.

The only case when a line can be cut is when it takes more than the whole
width of the page:

+---+
|   |
|   |
|   |
|   |
|   |
| This line is cut because  |
| it spreads over several   |
| lines in the page |
| And another line  |
| And again |
|   |
|   |
|   |
|   |
|   |
|   |
+---+

Is it possible to get such results automatically and how?

Thank you for helping and best regards.
--
View this message in context:
http://old.nabble.com/Paragraph-indentation-with-no-cut-lines-tp33969052p33969052.html
Sent from the FOP - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org

```

### Re: Paragraph indentation with no cut lines

```My guess is that you need to put each line in it's own block, wrapped in
a block-contiainer

On 06/06/2012 04:11 AM, Léa Massiot wrote:

Hello,

Thank you for reading my post.

I'm using an XML data file and an XSL-FO stylesheet to generate a PDF file
using fop.
Here is what I want to do:
I'd like to have some paragraph indented with lines:
- left-aligned,
- uncut (unless they really spread over several lines).
Of course, the contents of the paragraph is variable.
For example:

+---+
|   |
|   |
|   |
|   |
|   |
|Some indented text |
|And another line   |
|And again  |
|   |
|   |
|   |
|   |
|   |
|   |
+---+

If possible, I don't want any of the paragraph lines to be cut.
For example, here is something that I do not want:

+---+
|   |
|   |
|   |
|   |
|   |
|Some cut indented  |
|text   |
|And another line   |
|And again  |
|   |
|   |
|   |
|   |
|   |
|   |
+---+

Here is the result I want instead:

+---+
|   |
|   |
|   |
|   |
|   |
|  Some uncut indented text |
|  And another line |
|  And again|
|   |
|   |
|   |
|   |
|   |
|   |
+---+

Meaning I can't just set a fixed indentation.
The indentation depends on the longest line in the paragraph.

The only case when a line can be cut is when it takes more than the whole
width of the page:

+---+
|   |
|   |
|   |
|   |
|   |
| This line is cut because  |
| it spreads over several   |
| lines in the page |
| And another line  |
| And again |
|   |
|   |
|   |
|   |
|   |
|   |
+---+

Is it possible to get such results automatically and how?

Thank you for helping and best regards.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org