Overview

Namespaces

  • Kotchasan
    • Cache
    • Database
    • Http
    • Log
    • Orm
  • None
  • PHP
  • Psr
    • Cache
    • Http
      • Message
    • Log

Classes

  • Accordion
  • ApiController
  • ArrayTool
  • CKEditor
  • Collection
  • Config
  • Controller
  • Country
  • Csv
  • Curl
  • Currency
  • Database
  • DataTable
  • Date
  • DOMNode
  • DOMParser
  • Email
  • File
  • Files
  • Form
  • Grid
  • Html
  • Htmldoc
  • HtmlTable
  • Image
  • InputItem
  • Inputs
  • KBase
  • Language
  • ListItem
  • Login
  • Menu
  • Mime
  • Model
  • Number
  • ObjectTool
  • Password
  • Pdf
  • Province
  • Router
  • Session
  • Singleton
  • Tab
  • TableRow
  • Template
  • Text
  • Validator
  • View

Exceptions

  • ApiException
  • InputItemException
  • Overview
  • Namespace
  • Class
  • Tree

Class Pdf

Pdf Class.

PDF\FPDF
Extended by Kotchasan\Pdf
Namespace: Kotchasan
Author: Goragod Wiriya admin@goragod.com
Since: 1.0
Located at Kotchasan/Pdf.php
Methods summary
public
# Cell( integer $w, integer $h = 0, string $txt = '', integer|string $border = 0, integer $ln = 0, string $align = '', boolean $fill = false, string $link = '', integer $tPadding = 0, integer $rPadding = 0, integer $bPadding = 0, integer $lPadding = 0 )

Output a cell.

Output a cell.

Parameters

$w
ความกว้าง, คำนวณอัตโนมัติ
$h
line-height
$txt
ข้อความที่แสดง
$border
ไม่แสดง, 1 แสดงทั้ง 4 ด้าน, LTRB กำหนดเอง
$ln
ตำแหน่งหลังจากวาดแล้ว (default) ไปทางขวา, 1 กลับไปจุดเริ่มต้น, 2 บรรทัดถัดไป
$align
L หรือค่าว่าง (default) ชิดซ้าย, R ชิดขวา, C ตรงกลาง, J justify (default)
$fill
true แสดงพื้นหลัง, false โปร่งใส
$link
URL
$tPadding
padding-top
$rPadding
padding-right
$bPadding
padding-bottom
$lPadding
padding-right
public
# Ln( integer $h = null )

ขึ้นบรรทัดใหม่.

ขึ้นบรรทัดใหม่.

Parameters

$h
line-height ถ้าไม่กำหนดจะใช้ค่าล่าสุด
public
# MultiCell( integer $w, integer $h, string $s, integer|string $border = 0, string $align = 'J', boolean $fill = false, integer $tPadding = 0, integer $rPadding = 0, integer $bPadding = 0, integer $lPadding = 0 )

Output text with automatic or explicit line breaks.

Output text with automatic or explicit line breaks.

Parameters

$w
ความกว้าง, คำนวณอัตโนมัติ
$h
line-height
$s
ข้อความที่แสดง
$border
ไม่แสดง, 1 แสดงทั้ง 4 ด้าน, LTRB กำหนดเอง
$align
L หรือค่าว่างชิดซ้าย, R ชิดขวา, C ตรงกลาง, J justify (default)
$fill
true แสดงพื้นหลัง, false โปร่งใส
$tPadding
padding-top
$rPadding
padding-right
$bPadding
padding-bottom
$lPadding
padding-right
public
# SetCssClass( string $className, array $attributes )

กำหนดรูปแบบของ class.

กำหนดรูปแบบของ class.

Parameters

$className
$attributes
public
# SetStyles( string $tag, array $attributes )

กำหนดรูปแบบของ tag.

กำหนดรูปแบบของ tag.

Parameters

$tag
$attributes
public
# WriteHTML( string $html, string $charset = 'cp874' )

สร้าง PDF จาก HTML โค้ด แสดงผลตามรูปแบบที่กำหนดโดย คชสาร.

สร้าง PDF จาก HTML โค้ด แสดงผลตามรูปแบบที่กำหนดโดย คชสาร.

Parameters

$html
โค้ด HTML4
$charset
default cp874 (ภาษาไทย)
public
# __construct( string $orientation = 'P', string $unit = 'mm', string $size = 'A4', integer $fontSize = 10 )

Create FPDF ภาษาไทย.

Create FPDF ภาษาไทย.

Parameters

$orientation
$unit
$size
$fontSize
protected
# CheckPageBreak( integer $h )

ตรวจสอบความสูงของตาราง ถ้าความสูงของตารางเกินหน้า จะขึ้นหน้าใหม่.

ตรวจสอบความสูงของตาราง ถ้าความสูงของตารางเกินหน้า จะขึ้นหน้าใหม่.

Parameters

$h
ความสูงของตาราง
protected integer
# NbLines( integer $w, string $s )

คำนวณความสูงของเซล.

คำนวณความสูงของเซล.

Parameters

$w
$s

Returns

integer
protected
# SetStyle( string $style, boolean $enable )

แสดงผลตัวหนา ตัวเอียง ขีดเส้นใต้.

แสดงผลตัวหนา ตัวเอียง ขีดเส้นใต้.

Parameters

$style
B I หรือ U
$enable
true เปิดใช้งาน, false ปิดใช้งาน
protected
# applyCSS( Kotchasan\DOMNode $node )

กำหนด CSS.

กำหนด CSS.

Parameters

$node
protected array
# calculateColumnsWidth( Kotchasan\DOMNode $table )

คำนวนขนาดของคอลัมน์เป็น %.

คำนวนขนาดของคอลัมน์เป็น %.

Parameters

$table

Returns

array
protected integer
# calculateSize( integer|string $size, integer $max_size )

คำนวนขนาด.

คำนวนขนาด.

Parameters

$size
ขนาด เช่น 100%, 20px
$max_size
ขนาดที่ 100%

Returns

integer
protected array
# colorToRGb( string $color )

แปลงค่าสี HTML hex เช่น #FF0000 เป็นค่าสี RGB คืนค่า array($r, $g, $b) เช่น #FF0000 = array(255, 0, 0).

แปลงค่าสี HTML hex เช่น #FF0000 เป็นค่าสี RGB คืนค่า array($r, $g, $b) เช่น #FF0000 = array(255, 0, 0).

Parameters

$color
ค่าสี HTML hex เช่น #FF0000

Returns

array
protected
# drawHr( Kotchasan\DOMNode $node )

เส้นคั่น.

เส้นคั่น.

Parameters

$node
protected
# drawImg( Kotchasan\DOMNode $node )

แสดงรูปภาพ.

แสดงรูปภาพ.

Parameters

$node
protected
# drawTable( Kotchasan\DOMNode $table )

แสดงตาราง.

แสดงตาราง.

Parameters

$table
protected
# loadStyle( Kotchasan\DOMNode $node )

อ่าน CSS ของโหนด.

อ่าน CSS ของโหนด.

Parameters

$node
protected string
# render( Kotchasan\DOMNode $node )

Parameters

$node

Returns

string
protected array
# resizeImage( Kotchasan\DOMNode $node )

คำนวนตำแหน่งและปรับขนาดของรูปภาพ คืนค่าขนาดและตำปหน่งของรูปภาพ ถ้ารูปภาพมีขนาดใหญ่กว่าพิ้นที่แสดงผลจะปรับขนาด ถ้ารูปภาพมีขนาดเล็กกว่าพิ้นที่แสดงผล จะแสดงขนาดเดิม ตามตำแหน่งที่กำหนด คืนค่า array(left, top, width, height) top เป็น null เสมอ.

คำนวนตำแหน่งและปรับขนาดของรูปภาพ คืนค่าขนาดและตำปหน่งของรูปภาพ ถ้ารูปภาพมีขนาดใหญ่กว่าพิ้นที่แสดงผลจะปรับขนาด ถ้ารูปภาพมีขนาดเล็กกว่าพิ้นที่แสดงผล จะแสดงขนาดเดิม ตามตำแหน่งที่กำหนด คืนค่า array(left, top, width, height) top เป็น null เสมอ.

Parameters

$node
tag IMG

Returns

array
protected
# restoredCSS( Kotchasan\DOMNode $node )

คืนค่า CSS.

คืนค่า CSS.

Parameters

$node
protected float
# sd( $array )

calculate standard deviation.

calculate standard deviation.

Parameters

$array

Returns

float
Properties summary
protected mixed $B
#
protected mixed $I
#
protected mixed $U
#
protected mixed $css
#
protected mixed $cssClass
#
protected mixed $fontSize
#
protected mixed $lastBlock
# true
protected integer $lineHeight
# 5
protected mixed $link
# null
protected mixed $unit
#
Kotchasan API documentation generated by ApiGen