• 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_LinkReplacer::factory()

Description

class SetaPDF_LinkReplacer extends SetaPDF {
mixed factory ( string $sourcefile[, string $dest="F"[, boolean $stream=false]] ) }

This method has to be called static and will return an instance of the SetaPDF_LinkReplacer 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.

$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.

Return Values

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

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