diff --git a/lam/docs/devel/modules-specification.htm b/lam/docs/devel/modules-specification.htm index 81ef52fe..2c5bdc82 100644 --- a/lam/docs/devel/modules-specification.htm +++ b/lam/docs/devel/modules-specification.htm @@ -1053,11 +1053,16 @@ name</key><value&g value</value></block>
  • table: <block><key>attribute -name</key><td>first -value<td></block><block><td>second -value</td></block><block><td>third value</td></block>
  • +name</key><tr><td>value<td><td>value<td></tr></block><block><tr><td>value</td><td>value<td></tr></block>
    Special commands:
    @@ -1066,11 +1071,14 @@ Special commands:
    You can specify the alignment in <td> tags with align=(L|R|C) (e.g. <td align=\"L\">) +
  • Cell width: <td> +allows an attribute "width" to set the cell width (e.g. <td +width=20%> or <td width=30>).
    +
  • Line breaks: Line breaks can be specified by adding a <br /> -tag. The new line will start at the left border of the PDF document.
    -
  • +tag. The new line will start at the left border of the PDF document.
    Examples:
        'myAttribute' => '<block><key>AttrName</key><td + style="font-weight: bold; font-style: italic;"></key><tr><td align=\"L\">123</td></block><block><td + style="font-weight: bold; font-style: italic;"></td></tr></block><block><tr><td align=\"L\">456</td></block><block><td + style="font-weight: bold; font-style: italic;"></td></tr></block><block><tr><td align=\"L\">789</td></block></td></tr></block>'

    This will give the following PDF output:
    diff --git a/lam/lib/modules/quota.inc b/lam/lib/modules/quota.inc index 803d3d43..c0a12cfe 100644 --- a/lam/lib/modules/quota.inc +++ b/lam/lib/modules/quota.inc @@ -449,19 +449,19 @@ class quota extends baseModule { function get_pdfEntries($account_type = "user") { if (sizeof($this->quota) > 0) { $quotas = array(); - $quotas[] = '' . + $quotas[] = '' . '' . _('Mountpoint') . '' . '' . _('Soft block') . '' . '' . _('Hard block') . '' . '' . _('Soft inode') . '' . - '' . _('Hard inode') . ''; + '' . _('Hard inode') . ''; for ($i = 0; $i < sizeof($this->quota); $i++) { - $quotas[] = '' . + $quotas[] = '' . '' . $this->quota[$i][0] . '' . '' . $this->quota[$i][2] . '' . '' . $this->quota[$i][3] . '' . '' . $this->quota[$i][6] . '' . - '' . $this->quota[$i][7] . ''; + '' . $this->quota[$i][7] . ''; } return array( 'quota_quotas' => $quotas); diff --git a/lam/lib/pdf.inc b/lam/lib/pdf.inc index 36312ad3..4370621c 100644 --- a/lam/lib/pdf.inc +++ b/lam/lib/pdf.inc @@ -225,6 +225,8 @@ function processLine($line,$first_td = true, $fontName) { $value_pattern = '/(.*)(.*)<\/value>(<\/block>)/'; // PCRE matching a tag $td_pattern = '/(.*?)(.+?)<\/td>(.*<\/block>)/'; + // PCRE matching tag + $tr_pattern = '/<\/tr>/'; // PCRE matching a

    tag $p_pattern = '/(.*)

    (.+)<\/p>(.*<\/block>)/'; // PCRE matching a
    tag @@ -236,14 +238,14 @@ function processLine($line,$first_td = true, $fontName) { $line_width = $line_width - 50; $format = processFormatTags($matches[2],'B'); $return[] = array('setFont',array($fontName,$format[0],9)); - $return[] = array('Cell',array(50,0,$format[1] . ':',0,0,'R',0)); + $return[] = array('Cell',array(50,5,$format[1] . ':',0,0,'R',0)); $return[] = array('setFont',array($fontName,'',9)); return array_merge($return,processLine($matches[1] . $matches[3],false,$fontName)); } elseif(preg_match($value_pattern,$line,$matches)) { $format = processFormatTags($matches[2],''); $return[] = array('setFont',array($fontName,$format[0],9)); - $return[] = array('MultiCell',array(0,0,$format[1],0,'L',0)); + $return[] = array('MultiCell',array(0,5,$format[1],0,'L',0)); $return[] = array('setFont',array($fontName,'',9)); return array_merge($return,processLine($matches[1] . $matches[3],true,$fontName)); } @@ -260,7 +262,7 @@ function processLine($line,$first_td = true, $fontName) { $return[] = array('Cell',array(50,5,'',0,0,'L',0)); } $format = processFormatTags($matches[3],''); - $attrs = processAttributes($matches[2],array('width' => $line_width,'height' => 0,'align' => 'L')); + $attrs = processAttributes($matches[2],array('width' => $line_width,'height' => 5,'align' => 'L')); $return[] = array('setFont',array($fontName,$format[0],9)); $return[] = array('Cell',array($attrs['width'],$attrs['height'],$format[1],0,0,$attrs['align'],0)); $return[] = array('setFont',array($fontName,'',9)); @@ -270,6 +272,10 @@ function processLine($line,$first_td = true, $fontName) { return array(array('Ln',array(5))); } elseif(preg_match($block_pattern,$line,$matches)) { + $line_width = LAMPDF_LINEWIDTH; + return array(); + } + elseif(preg_match($tr_pattern,$line,$matches)) { $line_width = LAMPDF_LINEWIDTH; return array(array('Ln',array(5))); }