LoginSignup
3
1

More than 1 year has passed since last update.

PHP: TCPDF で太字を書く

Last updated at Posted at 2018-04-19

TCPDF で太字を書く方法です。

thick_apr1901.png

thick_letter.php
#! /usr/bin/php
<?php
// ------------------------------------------------------------------
//
//  thick_letter.php
//
//                      Jun/11/2021
// ------------------------------------------------------------------

// require_once('/usr/share/php/tcpdf/tcpdf.php');
require_once('/opt/php-tcpdf/tcpdf.php');

$pdf = new TCPDF(PDF_PAGE_ORIENTATION,PDF_UNIT,"A4",true);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetAutoPageBreak(false, 0);
$pdf->AddPage();

$pdf->SetFont('kozminproregular','', 30);

//
$pdf->Text(70, 10, "ブレーメンの音楽隊");
$pdf->Text(70, 30, "ブレーメンの音楽隊",0.1);
$pdf->Text(70, 50, "ブレーメンの音楽隊",0.3);

//

$pdf->Output();

// ------------------------------------------------------------------
?>

実行コマンド

./thick_letter.php > bremen.pdf

Arch Linux で TCPDF は次のようにインストールしました。

yay -S php-tcpdf

バージョンの確認

$ yay -Q php-tcpdf
php-tcpdf 6.3.5-1

tcpdf.php のインストールされた場所を探すには

$ yay -Ql php-tcpdf | grep tcpdf.php
php-tcpdf /opt/php-tcpdf/tcpdf.php
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1