• Bookmark at: Del.icio.us
  • Bookmark at: Mister Wong
  • Bookmark at: Linkarena
  • Bookmark at: Digg
  • Bookmark at: Yahoo
  • Bookmark at: Google
  • Bookmark at: Icio

Manuals

 

SetaPDF_FormFiller::factory()

Description

class SetaPDF_FormFiller extends SetaPDF {
mixed factory ( string $sourcefile[, string $password=""[, string $dest="F"[, boolean $stream=false[, boolean $renderAppearancesByViewer=false[, string $encoding="windows-1252//IGNORE"]]]]] ) }

This method has to be called static and will return an instance of the SetaPDF_FormFiller class or an SetaPDF_Error object.

Parameters

$sourcefile

A string that defines the path (relative or absolute) to the original document. Only local paths are allowed.

$password

Expects the owner password of the original PDF document if it is encrypted and no rights are granted for editing form fields.

$dest

Defines how the resulting document is handled:

  • "F" saves the file to the file system
  • "D" the file will be send to the client with a download dialogue
  • "I" the file will be displayed in the client's browser window.

$stream

This parameter is only used if dest is set to "D" or "I". If it is set to true, the document will be sent immediately as soon as the first content bytes are available. In this case the length-header will not be sent. If this parameter is set to false, the whole document is held in memory until it is completely assembled.

The streaming facility is very effective, because the client does not become aware of any script processing time.

$renderAppearancesByViewer

Defines that the rendering of form fields will be done by the viewer instead of the API. With this option you also can use UTF-16 strings in form field values and fill in rich text fields (see SetaPDF_TextField::setValue())

$encoding

The encoding used internally for field names. Also it is used as the default encoding for field values returned by any getValue()/getOptions() method.

Internally the encoding is passed to a wrapper class (SetaPDF/Tools/Encoding.php) which utilize iconv for the conversion.

Return Values

In case of success you get a new instance of the SetaPDF_FormFiller class.

On failure an SetaPDF_Error object will be returned. It is strongly recommened to check this return value with SetaPDF::isError().

Version

The $encoding parameter is available since version 1.5.4