Topics

allow codeblock to break across pages? #PDF #FOP

Leigh White
 

PDF2 customization, OT 2.5.4, FOP. Codeblocks are not breaking across pages. When a codeblock is/would be the last thing on a page and it can't fit entirely on the page, the build breaks with a "Position cannot be cast to org.apache.fop.layoutmgr.LeafPosition" error. I have tried everything I can think of. I've created a new attribute set for codeblocks that has no keeps whatsoever (mycodeblocks) and am using that instead of the default codeblock attr set. No luck. It works with AH. Is there something unique about codeblock and FOP that I don't understand? Appreciate any suggestions. Thanks much, Leigh

ekimber@contrext.com
 

Can you post the FO for a page that ends with the code block? The message sounds like maybe an FOP bug. Have tried using the latest version of FOP? 2.4 was recently released (which includes support for revision bars, by the way).

Cheers,

E.

--
Eliot Kimber
http://contrext.com


On 1/3/20, 5:16 PM, "Leigh White" <dita-users@groups.io on behalf of lwwhite5@...> wrote:

PDF2 customization, OT 2.5.4, FOP. Codeblocks are not breaking across pages. When a codeblock is/would be the last thing on a page and it can't fit entirely on the page, the build breaks with a "Position cannot be cast to org.apache.fop.layoutmgr.LeafPosition" error. I have tried everything I can think of. I've created a new attribute set for codeblocks that has no keeps whatsoever (mycodeblocks) and am using that instead of the default codeblock attr set. No luck. It works with AH. Is there something unique about codeblock and FOP that I don't understand? Appreciate any suggestions. Thanks much, Leigh

Leigh White
 

Hi Eliot. I haven't tried using the latest version of FOP. I'm honestly not sure how to make that switch. Just swapping out the jar files or even the FOP plugin did not work. All kinds of "missing..." messages that I don't have time to unravel. Probably a much easier way. Sorry to be dense there. But here is the topic.fo from FOP and also from AH. The section in question starts on line 444 in both. They are identical as far as I can tell. (If the line count is off, do a search for "tar" to get you to the right spot. Thanks! L.

ekimber@contrext.com
 

I can reproduce the failure using FOP run directly from Oxygen against the FO file, which I think is FOP 2.3.

Probably an FOP bug--the block is within a list block, which might be contributing to the problem.

But otherwise I don't see anything odd about the FO markup.

Cheers,

E.

--
Eliot Kimber
http://contrext.com


On 1/4/20, 3:39 PM, "Leigh White" <dita-users@groups.io on behalf of lwwhite5@...> wrote:

Hi Eliot. I haven't tried using the latest version of FOP. I'm honestly not sure how to make that switch. Just swapping out the jar files or even the FOP plugin did not work. All kinds of "missing..." messages that I don't have time to unravel. Probably a much easier way. Sorry to be dense there. But here is the topic.fo from FOP and also from AH. The section in question starts on line 444 in both. They are identical as far as I can tell. (If the line count is off, do a search for "tar" to get you to the right spot. Thanks! L.

ekimber@contrext.com
 

Looking at the FOP 2.4 code I can see the call sequence and the coding error that is almost certainly the cause of the runtime failure (the code as written makes an assumption that doesn't hold in this case).

Would take a little time to put together a failing test case and report the issue in an actionable way, but even then a fix could take a long time (it took a couple of years for my change bar code to finally see release in 2.4).

So would probably be necessary to create a patched version of FOP if this is a blocking issue.

Without having actually tested the running code my guess is that the code that handles list blocks makes an assumption that the code for handling the inner block doesn't match. I'm guessing that putting this much formatting in a list item is an edge case for most FOP developers, although it's not uncommon in DITA content....

Cheers,

E.

--
Eliot Kimber
http://contrext.com


On 1/6/20, 11:14 AM, "ekimber@..." <dita-users@groups.io on behalf of ekimber@...> wrote:

I can reproduce the failure using FOP run directly from Oxygen against the FO file, which I think is FOP 2.3.

Probably an FOP bug--the block is within a list block, which might be contributing to the problem.

But otherwise I don't see anything odd about the FO markup.

Cheers,

E.

--
Eliot Kimber
http://contrext.com


On 1/4/20, 3:39 PM, "Leigh White" <dita-users@groups.io on behalf of lwwhite5@...> wrote:

Hi Eliot. I haven't tried using the latest version of FOP. I'm honestly not sure how to make that switch. Just swapping out the jar files or even the FOP plugin did not work. All kinds of "missing..." messages that I don't have time to unravel. Probably a much easier way. Sorry to be dense there. But here is the topic.fo from FOP and also from AH. The section in question starts on line 444 in both. They are identical as far as I can tell. (If the line count is off, do a search for "tar" to get you to the right spot. Thanks! L.