[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/assign/feedback/editpdf/fpdi/ -> fpdi.php (summary)

This file is part of FPDI

Copyright: Copyright (c) 2015 Setasign - Jan Slabon (http://www.setasign.com)
License: http://opensource.org/licenses/mit-license The MIT License
Version: 1.6.1
File Size: 693 lines (24 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 mod/assign/feedback/editpdf/fpdi/fpdi_pdf_parser.php
 mod/assign/feedback/editpdf/fpdi/fpdf_tpl.php

Defines 1 class

FPDI:: (15 methods):
  setSourceFile()
  _getPdfParser()
  getPdfVersion()
  setPdfVersion()
  importPage()
  getLastUsedPageBox()
  useTemplate()
  _putimportedobjects()
  _putformxobjects()
  _newobj()
  _writeValue()
  _straightOut()
  _enddoc()
  _closeParsers()
  cleanUp()


Class: FPDI  - X-Ref

Class FPDI

setSourceFile($filename)   X-Ref
Set a source-file.

Depending on the PDF version of the used document the PDF version of the resulting document will
be adjusted to the higher version.

param: string $filename A valid path to the PDF document from which pages should be imported from
return: int The number of pages in the document

_getPdfParser($filename)   X-Ref
Returns a PDF parser object

param: string $filename
return: fpdi_pdf_parser

getPdfVersion()   X-Ref
Get the current PDF version.

return: string

setPdfVersion($version = '1.3')   X-Ref
Set the PDF version.

param: string $version

importPage($pageNo, $boxName = 'CropBox', $groupXObject = true)   X-Ref
Import a page.

The second parameter defines the bounding box that should be used to transform the page into a
form XObject.

Following values are available: MediaBox, CropBox, BleedBox, TrimBox, ArtBox.
If a box is not especially defined its default box will be used:

<ul>
<li>CropBox: Default -> MediaBox</li>
<li>BleedBox: Default -> CropBox</li>
<li>TrimBox: Default -> CropBox</li>
<li>ArtBox: Default -> CropBox</li>
</ul>

It is possible to get the used page box by the {@link getLastUsedPageBox()} method.

param: int $pageNo The page number
param: string $boxName The boundary box to use when transforming the page into a form XObject
param: boolean $groupXObject Define the form XObject as a group XObject to support transparency (if used)
return: int An id of the imported page/template to use with e.g. fpdf_tpl::useTemplate()

getLastUsedPageBox()   X-Ref
Returns the last used page boundary box.

return: string The used boundary box: MediaBox, CropBox, BleedBox, TrimBox or ArtBox

useTemplate($tplIdx, $x = null, $y = null, $w = 0, $h = 0, $adjustPageSize = false)   X-Ref
Use a template or imported page 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. All parameters are optional.
The width or height is calculated automatically if one is given. If no
parameter is given the origin size as defined in beginTemplate() or of
the imported page is used.

The calculated or used width and height are returned as an array.

param: int $tplIdx A valid template-id
param: int $x The x-position
param: int $y The y-position
param: int $w The new width of the template
param: int $h The new height of the template
param: boolean $adjustPageSize If set to true the current page will be resized to fit the dimensions
return: array The height and width of the template (array('w' => ..., 'h' => ...))

_putimportedobjects()   X-Ref
Copy all imported objects to the resulting document.


_putformxobjects()   X-Ref
Writes the form XObjects to the PDF document.


_newobj($objId = false, $onlyNewObj = false)   X-Ref
Creates and optionally write the object definition to the document.

Rewritten to handle existing own defined objects

param: bool $objId
param: bool $onlyNewObj
return: bool|int

_writeValue(&$value)   X-Ref
Writes a PDF value to the resulting document.

Needed to rebuild the source document

param: mixed $value A PDF-Value. Structure of values see cases in this method

_straightOut($s)   X-Ref
Modified _out() method so not each call will add a newline to the output.


_enddoc()   X-Ref
Ends the document

Overwritten to close opened parsers

_closeParsers()   X-Ref
Close all files opened by parsers.

return: boolean

cleanUp()   X-Ref
Removes cycled references and closes the file handles of the parser objects.




Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1