phpfpdf

FPDF bullet list


I found some code here: http://www.fpdf.org/en/script/script56.php

That works all the way up to the array part. The sample text it provides is bulleted, but it just keeps repeating. There doesn't seem to be some sort of delimiting so the sample text will break out into a list of separate items

The salient code is here:

$column_width = $pdf->w-30;
 $sample_text = 'This is sample text.\n This is a new line of text';

 $test1 = array();
 $test1['bullet'] = chr(149);
 $test1['margin'] = ' ';
 $test1['indent'] = 0;
 $test1['spacer'] = 0;
 $test1['text'] = array();
 for ($i=0; $i<2; $i++)
 {
     $test1['text'][$i] = $sample_text;

 }
 $pdf->SetX(10);
 $pdf->MultiCellBltArray($column_width-$pdf->x, 6, $test1);
 $pdf->Ln(10);

Another poster a few years back raised the same issue, but the matter was never resolved: using fpdf to output a bullet list from an array

I have the exact same question.


Solution

  • It looks like this question is too specialized or something. In case anybody wonders what I did, the work around was to individually place each bullet on the page. Ugly, but the benefit of the code above is it tabs over the content away from the number. I used excel, dumped all the clauses, and made a long unbroken string of what you see above and using fill down and modifying the bullet # to suit and the indent to suit, I was able to get the look.