MaikJaek / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

CSS dynamic content (counter) forces text wrapping #147

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Convert to PDF a document with CSS-generated dynamic content that fits 
horizontally inside its parent element like the following:

<style type="text/css">
.fixed {
  font-size: 16pt;
  width: 10mm;
  border: 1px solid black;
}

.counter-content:before {
  content: counter(page);
}
</style>
<body>
  <div class="fixed">
    1/1
  </div>
  <div class="fixed">
    <span class="counter-content"/>/<span class="counter-content"/>
  </div>
</body>

What is the expected output?

Two boxes containing the text "1/1" without wrapping.

What do you see instead?

The first box has no wrapping, as expected. The second box wraps the text after 
each character.

What version of the product are you using? On what operating system?

Master branch (8.99.2-26-g9176297) on Windows 7.

Please provide any additional information below.

Text wrapping works as expected when inserting static content using CSS:

.static-content:before {
  content: "1";
}

A workaround to this bug is to forbid any wrapping in the containing element:

.fixed {
  ...
  white-space: nowrap;
}

Original issue reported on code.google.com by diog...@gmail.com on 29 Apr 2011 at 1:13