Ticket #599 (reopened enhancement)

Opened 20 months ago

Last modified 19 months ago

Add lineSpacing support for text blocks

Reported by: olt Owned by: jeichar
Priority: minor Milestone:
Component: print Version: SVN
Keywords: linespacing, text formating, print, itext Cc:
State:

Description

This patch makes the lineSpacing configurable for textblocks.

There were some tricky parts on the side of itext. Nesting of Phrases into Paragraphs didn't work well with lineSpacing/leading, so I changed PDFUtils.renderString to return the string, and not a Phrase.

A Paragraph needs to be inserted into a Cell in composite-mode to retain the styling. Thats done with cell.addElement.

cell.setUseAscender is necessary to remove the leading in the first line of a cell.

Attachments

line-spacing.patch (4.1 kB) - added by olt 20 months ago.

Change History

Changed 20 months ago by olt

Changed 20 months ago by jeichar

  • status changed from new to closed
  • resolution set to fixed

(In [3640]) Patch for controlling line spacing

r=jeichar closes #599

Changed 19 months ago by jeichar

  • status changed from closed to reopened
  • resolution fixed deleted

I am reverting this commit since it ruins alignment parameters. I am not so good with IText so I am not sure how to fix this issue. I will spend some time looking into the issue right now and see if I can find a solution that works for both situations.

More details on the one that fails is as follows: Given the config:

header:

height: 75 items:

  • !columns widths: [30, 70] items:
    • !text fontSize: 24 fontColor: #333333 text: |

${print_short_txt}

  • !image align: right maxWidth: 516 maxHeight: 70 backgroundColor: #ff0000 url: "${configDir}/${print_img}"

The align: right is ignored with this change which breaks an existing application.

Changed 19 months ago by jeichar

The patch also ruins the layout of scalebars.

Note: See TracTickets for help on using tickets.