Example #1
0
	NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

	No technical support is available for any of this source code. In general,
	you must modify and test this code before incorporating it into your programs.

	Warning: Some code contains mistakes or deliberately incorrect coding for the
	purpose of serving as an example for the book. Please read the book carefully
	to determine which code is suitable for reuse in your own applications.

	Copyright 2013 Marc J. Rochkind. All rights reserved. May be copied and used
	under the BSD-type license at http://basepath.com/aup/copyright.htm.
*/
require_once 'lib/fpdf17/fpdf.php';
require_once 'lib/fpdf-plus/mc_table.php';
$in = fopen('data/cwa_panels.csv', 'r');
$pdf = new PDF_MC_Table('L', 'pt', array(300, 500));
$pdf->SetFont('Helvetica', '', 7);
$pdf->SetLineWidth(0.1);
$pdf->SetMargins(30, 20);
$pdf->SetAutoPageBreak(true, 20);
$pdf->SetHorizontalPadding(2);
$pdf->SetVerticalPadding(3);
$pdf->SetStyles(array('', 'B', 'B', '', '', 'I'));
$pdf->AddPage();
$pdf->SetWidths(array(70, 50, 50, 70, 40, 140));
$pdf->SetAligns(array('R', 'C', 'C', 'C', 'C', 'L'));
while ($row = fgetcsv($in)) {
    $pdf->RowX($row);
}
$pdf->Output();