Bug 531685

Summary: Incorrect rendering of PDF using <example> tags.
Product: [Community] Publican Reporter: BenC <bclare>
Component: publicanAssignee: Jeff Fearn <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 1.6CC: jfearn, mmcallis, publican-list, r.landmann
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: 1.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-29 23:52:42 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
Image showing pdf result
image of corrected output none

Description BenC 2009-10-29 01:06:14 EDT
Created attachment 366552 [details]
Image showing pdf result

Description of problem:

Version-Release number of selected component (if applicable): 
publican 0.44
publican-jboss 0.19 

How reproducible:


public class NumberGuess implements Serializable {
  private int randomNumber;
  private Integer currentGuess;
  private int biggest;
  private int smallest;
  private int guessCount;
  private int maxGuesses;
  private boolean cheated;
  public void begin() {
    randomNumber = new Random().nextInt(100);
    guessCount = 0;
    biggest = 100;
    smallest = 1;
  public void setCurrentGuess(Integer guess) {
    this.currentGuess = guess;
  public Integer getCurrentGuess() {
    return currentGuess;
  public void guess() {
    if (currentGuess>randomNumber) {
      biggest = currentGuess - 1;
    if (currentGuess<randomNumber) {
      smallest = currentGuess + 1;
    guessCount ++;
  public boolean isCorrectGuess() {
    return currentGuess==randomNumber;
  public int getBiggest() {
    return biggest;
  public int getSmallest() {
    return smallest;
  public int getGuessCount() {
    return guessCount;
  public boolean isLastGuess() {
    return guessCount==maxGuesses;

  public int getRemainingGuesses() {
    return maxGuesses-guessCount;

  public void setMaxGuesses(int maxGuesses) {
    this.maxGuesses = maxGuesses;

  public int getMaxGuesses() {
    return maxGuesses;

  public int getRandomNumber() {
    return randomNumber;

  public void cheated() {
    cheated = true;
  public boolean isCheat() {
    return cheated;
  public List<Integer> getPossibilities() {
    List<Integer> result = new ArrayList<Integer>();
    for(int i=smallest; i<=biggest; i++) result.add(i);
    return result;

Additional info:
Note that the example label is rendered over the code listing in the pdf document. See attached image.
Comment 1 Jeff Fearn 2009-10-29 01:17:22 EDT
A: Please provide a link to the SVN repo, it makes it easier for me to test stuff.

B: You are nesting blocks in a way that FOP doesn't handle very well, similar to nested tables and lists of lists, see bforte for a dissertation of this issue :)

Having said that if you supply a repo I have access to I'll poke around and see what I can come up with.
Comment 2 BenC 2009-10-29 03:06:19 EDT
Here is the repo:

https://svn.jboss.org/repos/jbossas/projects/docs/enterprise/5.0/Seam_Reference_Guide. The relevant chapter is Tutorial.xml.

I am in the process of tidying this up (including removing the <example> tags) and haven't committed my changes to the repo.

The code example in the bugzilla ticket is an example of the code which produces the problem:





Comment 3 BenC 2009-10-29 20:28:18 EDT
Below is a link to the source (JBoss Community) pdf document:


Note the correct rendering of the Example label (it doesn't overwrite the code as does our version). 

Is positioning the "Example" label above the code a JBoss "workaround"? Will it fix our rendering problems?

Comment 4 BenC 2009-10-29 20:30:06 EDT

Go to page 3 for a relevant example relating to the above comment.
Comment 5 Jeff Fearn 2009-10-29 23:49:59 EDT
Created attachment 366758 [details]
image of corrected output

attribute-set formal.object.properties hard codes keep-together.within-column to 'always', this constrains an example to a single page, resulting in the mis-formatting of the supplied eaxmple.

Modified attribute-set example.properties to set keep-together.within-column to null, which allows the example to break across pages and displays the title correctly.
Comment 6 Jeff Fearn 2009-10-29 23:52:42 EDT
This fix will ship with Publican 1.0