class FpdiHelper extends PDF_Japanese

Properties

array $tpls Array of Tpl-Data from FPDF_TPL
int $tpl Current Template-ID from FPDF_TPL
boolean $_intpl "In Template"-Flag from FPDF_TPL
string $tplprefix Nameprefix of Templates used in Resources-Dictonary from FPDF_TPL
array $_res Resources used By Templates and Pages from FPDF_TPL
array $lastUsedTemplateData Last used Template data from FPDF_TPL
string $current_filename Actual filename from FPDI
array $parsers Parser-Objects from FPDI
object $current_parser Current parser from FPDI
array $_obj_stack object stack from FPDI
array $_don_obj_stack done object stack from FPDI
integer $_current_obj_id Current Object Id. from FPDI
string $lastUsedPageBox The name of the last imported page box from FPDI
array $_importedPages Cache for imported pages/template ids from FPDI
$enable_conv_sjis SJIS 変換を有効とするか

Methods

_putstream($s)

No description

from FPDF
_getxobjectdict()

No description

from FPDF
pdf_write_value(array $value)

Writes a value Needed to rebuild the source document

from FPDI
string
_unescape(string $s)

Unescapes a PDF string

from FPDF
string
hex2str(string $hex)

Hexadecimal to string

from FPDF
string
str2hex(string $str)

String to hexadecimal

from FPDF
int
beginTemplate(int $x = null, int $y = null, int $w = null, int $h = null)

Start a Template

from FPDF_TPL
mixed
endTemplate()

End Template

from FPDF_TPL
useTemplate(int $tplidx, int $_x = null, int $_y = null, int $_w, int $_h, $adjustPageSize = false)

Use a Template in current Page or other Template

from FPDI
array
getTemplateSize(int $tplidx, int $_w, int $_h)

Get The calculated Size of a Template

from FPDF_TPL
SetFont($family, $style = '', $size)

See FPDF/TCPDF-Documentation ;-)

from FPDF_TPL
Image($file, $x = null, $y = null, $w, $h, $type = '', $link = '')

See FPDF/TCPDF-Documentation ;-)

from FPDF_TPL
AddPage($orientation = '', $format = '')

See FPDF-Documentation ;-)

from FPDF_TPL
Link($x, $y, $w, $h, $link)

Preserve adding Links in Templates .

from FPDF_TPL
AddLink()

No description

from FPDF_TPL
SetLink($link, $y, $page = -1)

No description

from FPDF_TPL
_putformxobjects()

Private Method that writes the form xobjects

from FPDI
_putimages()

Overwritten to add _putformxobjects() after _putimages()

from FPDF_TPL
_putxobjectdict()

No description

from FPDF_TPL
_out($s)

Private Method

from FPDF_TPL
int
setSourceFile(string $filename)

Set a source-file

from FPDI
_getPdfParser(string $filename)

Returns a PDF parser object

from FPDI
string
getPDFVersion()

Get the current PDF version

from FPDI
string
setPDFVersion($version = '1.3')

Set the PDF version

from FPDI
int
importPage($pageno, $boxName = '/CropBox')

Import a page

from FPDI
getLastUsedPageBox()

No description

from FPDI
_putimportedobjects()

Private method, that rebuilds all needed objects of source files

from FPDI
_newobj($obj_id = false, $onlynewobj = false)

Rewritten to handle existing own defined objects

from FPDI
_straightOut($s)

Modified so not each call will add a newline to the output.

from FPDI
_enddoc()

rewritten to close opened parsers

from FPDI
_closeParsers()

close all files opened by parsers

from FPDI
AddCIDFont($family, $style, $name, $cw, $CMap, $registry)

No description

AddCIDFonts($family, $name, $cw, $CMap, $registry)

No description

AddSJISFont()

PDF_Japanese の明朝フォントに加えゴシックフォントを追加定義

AddSJIShwFont($family = 'SJIS-hw')

No description

GetStringWidth($s)

No description

GetSJISStringWidth($s)

No description

MultiCell($w, $h, $txt, $border, $align = 'L', $fill = false)

No description

SJISMultiCell()

No description

Write($h, $txt, $link = '')

No description

SJISWrite($h, $txt, $link)

No description

_putType0($font)

No description

FancyTable($header, $data, $w)

Colored table

Text($x, $y, $txt)

No description

Cell($w, $h, $txt = '', $border, $ln, $align = '', $fill = false, $link = '')

No description

lfConvSjis($conv_str)

No description

Details

in FPDF at line 31
_putstream($s)

Parameters

$s

in FPDF at line 35
_getxobjectdict()

in FPDI at line 395
pdf_write_value(array $value)

Writes a value Needed to rebuild the source document

Parameters

array $value

in FPDF at line 85
string _unescape(string $s)

Unescapes a PDF string

Parameters

string $s

Return Value

string

in FPDF at line 150
string hex2str(string $hex)

Hexadecimal to string

Parameters

string $hex

Return Value

string

in FPDF at line 160
string str2hex(string $str)

String to hexadecimal

Parameters

string $str

Return Value

string

in FPDF_TPL at line 76
int beginTemplate(int $x = null, int $y = null, int $w = null, int $h = null)

Start a Template

This method starts a template. You can give own coordinates to build an own sized Template. Pay attention, that the margins are adapted to the new templatesize. If you want to write outside the template, for example to build a clipped Template, you have to set the Margins and "Cursor"-Position manual after beginTemplate-Call.

If no parameter is given, the template uses the current page-size. The Method returns an ID of the current Template. This ID is used later for using this template. Warning: A created Template is used in PDF at all events. Still if you don't use it after creation!

Parameters

int $x The x-coordinate given in user-unit
int $y The y-coordinate given in user-unit
int $w The width given in user-unit
int $h The height given in user-unit

Return Value

int The ID of new created Template

in FPDF_TPL at line 134
mixed endTemplate()

End Template

This method ends a template and reset initiated variables on beginTemplate.

Return Value

mixed If a template is opened, the ID is returned. If not a false is returned.

in FPDI at line 208
useTemplate(int $tplidx, int $_x = null, int $_y = null, int $_w, int $_h, $adjustPageSize = false)

Use a Template in current Page or other Template

You can use a template in a page or in another template. You can give the used template a new size like you use the Image()-method. All parameters are optional. The width or height is calculated automaticaly if one is given. If no parameter is given the origin size as defined in beginTemplate() is used. The calculated or used width and height are returned as an array.

Parameters

int $tplidx A valid template-Id
int $_x The x-position
int $_y The y-position
int $_w The new width of the template
int $_h The new height of the template
$adjustPageSize

in FPDF_TPL at line 238
array getTemplateSize(int $tplidx, int $_w, int $_h)

Get The calculated Size of a Template

If one size is given, this method calculates the other one.

Parameters

int $tplidx A valid template-Id
int $_w The width of the template
int $_h The height of the template

Return Value

array The height and width of the template

in FPDF_TPL at line 262
SetFont($family, $style = '', $size)

See FPDF/TCPDF-Documentation ;-)

Parameters

$family
$style
$size

in FPDF_TPL at line 288
Image($file, $x = null, $y = null, $w, $h, $type = '', $link = '')

See FPDF/TCPDF-Documentation ;-)

Parameters

$file
$x
$y
$w
$h
$type
$link

in FPDF_TPL at line 309
AddPage($orientation = '', $format = '')

See FPDF-Documentation ;-)

AddPage is not available when you're "in" a template.

Parameters

$orientation
$format

Preserve adding Links in Templates .

..won't work

Parameters

$x
$y
$w
$h
$link

Parameters

$link
$y
$page

in FPDI at line 267
_putformxobjects()

Private Method that writes the form xobjects

in FPDF_TPL at line 424
_putimages()

Overwritten to add _putformxobjects() after _putimages()

in FPDF_TPL at line 429
_putxobjectdict()

in FPDF_TPL at line 442
_out($s)

Private Method

Parameters

$s

in FPDI at line 86
int setSourceFile(string $filename)

Set a source-file

Parameters

string $filename a valid filename

Return Value

int number of available pages

in FPDI at line 102
fpdi_pdf_parser _getPdfParser(string $filename)

Returns a PDF parser object

Parameters

string $filename

Return Value

fpdi_pdf_parser

in FPDI at line 111
string getPDFVersion()

Get the current PDF version

Return Value

string

in FPDI at line 120
string setPDFVersion($version = '1.3')

Set the PDF version

Parameters

$version

Return Value

string

in FPDI at line 130
int importPage($pageno, $boxName = '/CropBox')

Import a page

Parameters

$pageno
$boxName

Return Value

int Index of imported page - to use with fpdf_tpl::useTemplate()

in FPDI at line 204
getLastUsedPageBox()

in FPDI at line 237
_putimportedobjects()

Private method, that rebuilds all needed objects of source files

in FPDI at line 374
_newobj($obj_id = false, $onlynewobj = false)

Rewritten to handle existing own defined objects

Parameters

$obj_id
$onlynewobj

in FPDI at line 497
_straightOut($s)

Modified so not each call will add a newline to the output.

Parameters

$s

in FPDI at line 523
_enddoc()

rewritten to close opened parsers

in FPDI at line 531
_closeParsers()

close all files opened by parsers

in PDF_Japanese at line 17
AddCIDFont($family, $style, $name, $cw, $CMap, $registry)

Parameters

$family
$style
$name
$cw
$CMap
$registry

in PDF_Japanese at line 26
AddCIDFonts($family, $name, $cw, $CMap, $registry)

Parameters

$family
$name
$cw
$CMap
$registry

at line 40
AddSJISFont()

PDF_Japanese の明朝フォントに加えゴシックフォントを追加定義

in PDF_Japanese at line 44
AddSJIShwFont($family = 'SJIS-hw')

Parameters

$family

in PDF_Japanese at line 55
GetStringWidth($s)

Parameters

$s

in PDF_Japanese at line 63
GetSJISStringWidth($s)

Parameters

$s

in PDF_Japanese at line 95
MultiCell($w, $h, $txt, $border, $align = 'L', $fill = false)

Parameters

$w
$h
$txt
$border
$align
$fill

at line 49
SJISMultiCell()

in PDF_Japanese at line 213
Write($h, $txt, $link = '')

Parameters

$h
$txt
$link

in PDF_Japanese at line 221
SJISWrite($h, $txt, $link)

Parameters

$h
$txt
$link

in PDF_Japanese at line 327
_putType0($font)

Parameters

$font

at line 69
FancyTable($header, $data, $w)

Colored table

FIXME: 後の列の高さが大きい場合、表示が乱れる。

Parameters

$header
$data
$w

at line 123
Text($x, $y, $txt)

Parameters

$x
$y
$txt

at line 128
Cell($w, $h, $txt = '', $border, $ln, $align = '', $fill = false, $link = '')

Parameters

$w
$h
$txt
$border
$ln
$align
$fill
$link

at line 134
lfConvSjis($conv_str)

Parameters

$conv_str