【PDF_fit_textlineの「fitmethod」オプションを指定する】
※アスペクト比:文字の縦横の比率。これを保持してフォントサイズを変更すると文字の見た目(形)は変わらない。無視すると文字の見た目(形)も変化する。
【例】
(x1,y1)(x2,y2)=(0,0)(100,200)の領域に「x軸左寄せy軸中央配置」で「領域に収まる最大サイズ」で文字列"abcde"を出力する
//出力文字列
$val = "abcde";
//始点
$x = 0;
$y = 0;
//領域サイズ指定
$box_w = 100;
$box_h = 200;
//寄せの指定
$align_x = "0";
$align_y = "50";
//フィットタイプの指定
$fittype = "meet";
//オプション引数の組み立て
$opt_str = "boxsize {".$box_w." ";
$opt_str .= $box_h."} ";
$opt_str .= "position {".$align_x." ";
$opt_str .= $align_y."} ";
$opt_str .= "fitmethod $fittype ";
//テキスト描画実行
PDF_fit_textline($pdf_obj,$val,$x,$y,$opt_str);