Class SevenPdf_Client

Description

Located in /Client.php (line 30)


	
			
Class Constant Summary
 VERSION = '1.0.1'
Variable Summary
Method Summary
void __construct ([array $options = null])
int compareVersion (string $version)
SevenPdf_Client convertToPdf (string $inputFilepath, string $outputFilePath)
string|null getPassword ()
Soap_Client getSoapClient ()
string|null getUsername ()
string getVersion ()
string getWsdl ()
boolean isFileSupported (string $inputFilepath)
SevenPdf_Client setChanges (int $value)
SevenPdf_Client setEncryptFile (boolean $value)
SevenPdf_Client setExportNotes (boolean $value)
SevenPdf_Client setPageRange (string $value)
SevenPdf_Client setPassword (string $password)
SevenPdf_Client setQuality (int $value)
SevenPdf_Client setSoapClient ( $soapClient)
SevenPdf_Client setUsername (string $username)
SevenPdf_Client setUseTaggedPDF (boolean $value)
SevenPdf_Client setWsdl (string $wsdl)
SevenPdf_Client useSsl (boolean $useSsl)
object _callSoapConversion (string $fileRemotePath)
void _createDirectoryViaWebDav (string $remotePath)
void _downloadPdf (object $outObject, string $outputFilePath)
string _getExtension (string $filename)
void _initSoapClient (string $endpoint)
void _sendWebDavCommands (array $lines)
void _uploadFileViaWebDav (string $inputFilepath, string $fileRemotePath)
Variables
array $_credentials = array() (line 77)

Array of credentials (username and password) to log into server

  • access: protected
array $_options = array(
'UseTaggedPDF' => false,
'ExportNotes' => true,
'ExportNotesPages' => true,
'ExportBookmarks' => true,
'SelectPDFVersion' => 0,
'PageRange' => '',
'UseLosslessCompression' => true,
'Quality' => 75,
'ReduceImageResolution' => false,
'MaxImageResolution' => 300,
'EncryptFile' => false,
'DocumentOpenPassword' => '',
'RestrictPermissions' => false,
'PermissionPassword' => '',
'Printing' => 2,
'Changes' => 4,
'EnableCopyingOfContent' => true,
'EnableTextAccessForAccessibilityTools' => true
)
(line 83)

Array with all options, prefilled with standard options

  • access: protected
string $_serviceHost = 'api.7-pdf.com' (line 53)

Hostname of 7-PDF API Server

  • access: protected
int $_servicePort = null (line 59)

Port of 7-PDF API Server. If set to NULL, 80/443 is used.

  • access: protected
Soap_Client $_soapClient (line 41)

SOAP client used to connect to 7-PDF service

  • access: protected
int $_socketTimeout = 180 (line 71)

Time to wait for a connection or the response from the server

  • access: protected
array $_supportedFileExtensions = array(
'doc', 'dot', 'xls', 'xlt', 'ppt', 'pps', 'pot',
'odt', 'ott', 'ods', 'ots', 'odp', 'otp', 'sxw',
'stw', 'sxc', 'stc', 'swi', 'sti', 'sdw', 'vor',
'sdc', 'sdd', 'rtf', 'txt', 'csv', 'html', 'htm',
'xml', 'dif', 'dxf', 'eps', 'tif', 'odg', 'otg',
'sxd', 'std', 'jpg', 'jpeg', 'png', 'gif', 'bmp',
'odf', 'sxm', 'mml', 'smf', 'docx', 'docm', 'dotx',
'dotm', 'xlsx', 'xlsb', 'xlsm', 'xltm', 'xltx', 'pptx',
'pptm', 'potm', 'odm', 'sxg', 'sgl', 'slk', 'wpd',
'oth', 'wb2', 'sda', 'emf', 'met', 'pct', 'sgf',
'sgv', 'svm', 'wmf', 'pbm', 'pcx', 'pgm', 'ppm',
'psd', 'ras', 'tga', 'tiff', 'xbm', 'xpm', 'pcd'
)
(line 108)

Array with all supported filename extensions

  • access: protected
boolean $_useSsl = false (line 65)

Switch whether to use SSL or not

  • access: protected
string $_wsdl = '/1.0/Converter?WSDL' (line 47)

WSDL path of 7-PDF web service

  • access: protected
Methods
Constructor __construct (line 140)

Constructor

Optionally, pass an array of options

If an option with the key 'soapClient' is provided, that value will be used to set the internal SOAP client used to connect to the 7-PDF service.

If you prefer to not pass the username and password through the constructor, you can also call the following methods: setUsername() and setPassword()

  • throws: SevenPdf_Client_Exception
  • access: public
void __construct ([array $options = null])
  • array $options
compareVersion (line 644)

Compare the current API version with another version

  • return: -1 (version is less than API version), 0 (versions are equal), or 1 (version is greater than API version)
  • access: public
int compareVersion (string $version)
  • string $version: (STRING NOT FLOAT)
convertToPdf (line 668)

Starts a conversion run. Will upload file, start conversion and download PDF

  • throws: SevenPdf_Client_Exception
  • access: public
SevenPdf_Client convertToPdf (string $inputFilepath, string $outputFilePath)
  • string $inputFilepath: The file that you would like to convert to PDF. You can use relative and absolute filepaths like files/letter.doc or /usr/local/files/letter.doc
  • string $outputFilePath: Where to store the converted PDF
getPassword (line 599)

Return current password

  • access: public
string|null getPassword ()
getSoapClient (line 233)

Get SOAP client

  • access: public
Soap_Client getSoapClient ()
getUsername (line 586)

Return current username

  • access: public
string|null getUsername ()
getVersion (line 633)

Return the current API version

  • access: public
string getVersion ()
getWsdl (line 612)

Return WSDL of 7-PDF web service

  • access: public
string getWsdl ()
isFileSupported (line 846)

Checks if a filename is supported by conversion server

  • access: public
boolean isFileSupported (string $inputFilepath)
  • string $inputFilepath
setChanges (line 549)

Set permissions for changes for the generated PDF File.

Possible is -> 0: Not permitted, 1: Inserting, deleting and rotating pages, 2: Filling in form fields, 3: Commenting, filling in form fields, 4: Any except extracting pages (default) Notice: setRestrictPermissionsPDFOption method must be set to true and setPermissionPasswordPDFOption must be set with a permission password

SevenPdf_Client setChanges (int $value)
  • int $value: The permission value of printing (0,1,2,3,4)
setDocumentOpenPassword (line 486)

Password that must be known when the generated PDF will be opened.

So the generated PDF File is password protected Notice: setEncryptFilePDFOption() method must be set to true.

SevenPdf_Client setDocumentOpenPassword (string $value)
  • string $value
setEnableCopyingOfContent (line 563)

If set a pdf reader of the PDF File can extract and copy included pdf content

  • access: public
SevenPdf_Client setEnableCopyingOfContent (boolean $value)
  • boolean $value: This permission value can be true (default) or false.
setEnableTextAccessForAccessibilityTools (line 575)

Accessibility Tools have access to the pdf text.

  • access: public
SevenPdf_Client setEnableTextAccessForAccessibilityTools (boolean $value)
  • boolean $value: This permission value can be true (default) or false.
setEncryptFile (line 471)

Enables the PDF File Encryption for generated PDF Files

  • access: public
SevenPdf_Client setEncryptFile (boolean $value)
  • boolean $value: The encryption state can be true (encrypt files) or false (no encryption, default).
setExportBookmarks (line 377)

Exports bookmarks to generate PDF Files

  • access: public
SevenPdf_Client setExportBookmarks (boolean $value)
  • boolean $value: The value can be true (default) or false
setExportNotes (line 353)

Exports notes to the generated PDF Files

  • access: public
SevenPdf_Client setExportNotes (boolean $value)
  • boolean $value: The value can be true or false (default)
setExportNotesPages (line 365)

Exports notes pages to generate PDF Files

  • access: public
SevenPdf_Client setExportNotesPages (boolean $value)
  • boolean $value: The value can be true (default) or false
setMaxImageResolution (line 455)

The value of the maximum allowed image resolution Possible values (DPI) are 75 (default), 150, 300, 600, 1200 Notice: The PDF Option ReduceImageResolution must be set to true to enable this option!

SevenPdf_Client setMaxImageResolution (int $value)
  • int $value: Should be a possible value that stands for a DPI resolution of images inside the PDF.
setOptions (line 161)

Set options One or more of username, password, soapClient

  • access: public
SevenPdf_Client setOptions ( $options)
  • array $options
setPageRange (line 401)

Sets the page range for pdf generation

  • access: public
SevenPdf_Client setPageRange (string $value)
  • string $value: The value can be a valid PageRange string like 1; 1-2;
    e.g. or you leave it empty for all pages.
setPassword (line 268)

Set password

  • access: public
SevenPdf_Client setPassword (string $password)
  • string $password
setPermissionPassword (line 512)

Password that protects the pdf permission level for generated PDF Files.

Notice: setRestrictPermissionsPDFOption method must be set to true.

SevenPdf_Client setPermissionPassword (string $value)
  • string $value: The value can be any password string that you would like to use for your pdf encryption.
setPrinting (line 529)

Set permissions for printing level of the generated PDF File.

Possible is -> 0: Not permitted, 1: Low resolution (150 DPI), 2: High resolution (default) Notice: setRestrictPermissionsPDFOption method must be set to true and setPermissionPasswordPDFOption must be set with a permission password

SevenPdf_Client setPrinting (int $value)
  • int $value: The permission value of printing (0,1,2)
setQuality (line 426)

Sets the quality value in percent (0 - 100) for image jpeg compressions inside the generated PDF.

  • access: public
SevenPdf_Client setQuality (int $value)
  • int $value
setReduceImageResolution (line 440)

Reduces the image resolution level of images

  • access: public
SevenPdf_Client setReduceImageResolution (boolean $value)
  • boolean $value: The ReduceImageResolution state can be true or false (default).
setRestrictPermissions (line 498)

Enables the encryption level to restrict pdf permissions

  • access: public
SevenPdf_Client setRestrictPermissions (boolean $value)
  • boolean $value: The restrict permission state can be true (pdf with permission settings) or false (pdf without permission settings, default).
setSelectPDFVersion (line 389)

Sets the pdf version that should be generated

  • access: public
SevenPdf_Client setSelectPDFVersion (int $value)
  • int $value: The value can be 0 (PDF 1.4, default) or 1 (PDF/A-1)
setServiceHost (line 292)

Set Service Host of 7-PDF service

  • access: public
SevenPdf_Client setServiceHost (string $host)
  • string $host
setServicePort (line 304)

Set Service Port of 7-PDF service (mostly 80 or 8080)

  • access: public
SevenPdf_Client setServicePort (int $port)
  • int $port
setSoapClient (line 244)

Set SOAP client

  • access: public
SevenPdf_Client setSoapClient ( $soapClient)
  • Soap_Client $soapClient
setSocketTimeout (line 328)

Change the connection timeout in seconds (for very large files it has to be increased)

  • access: public
SevenPdf_Client setSocketTimeout (int $seconds)
  • int $seconds
setUseLosslessCompression (line 414)

Sets a lossless compression level for images inside the generated PDF

  • access: public
SevenPdf_Client setUseLosslessCompression (boolean $value)
  • boolean $value: This compression state can be true (default) or false. If this option is set to true the setQuality() value is always disabled.
setUsername (line 256)

Set username

  • access: public
SevenPdf_Client setUsername (string $username)
  • string $username
setUseTaggedPDF (line 341)

Sets the PDFOption UseTaggedPDF to generate tagged PDF Files

  • access: public
SevenPdf_Client setUseTaggedPDF (boolean $value)
  • boolean $value: The value can be true or false (default)
setWsdl (line 280)

Set WSDL of 7-PDF web service

  • access: public
SevenPdf_Client setWsdl (string $wsdl)
  • string $wsdl
useSsl (line 316)

Switch whether to use SSL or not

  • access: public
SevenPdf_Client useSsl (boolean $useSsl)
  • boolean $useSsl
_callSoapConversion (line 771)

call the convertLAN soap function and return result object

  • throws: SevenPdf_Client_Exception
  • access: protected
object _callSoapConversion (string $fileRemotePath)
  • string $fileRemotePath
_createDirectoryViaWebDav (line 700)

Send a MKCOL command to server

  • access: protected
void _createDirectoryViaWebDav (string $remotePath)
  • string $remotePath
_downloadPdf (line 798)

Download pdf from server and store into file

  • throws: SevenPdf_Client_Exception
  • access: protected
void _downloadPdf (object $outObject, string $outputFilePath)
  • object $outObject
  • string $outputFilePath
_getExtension (line 623)

Return the document format (extension) of a filename

  • access: protected
string _getExtension (string $filename)
  • string $filename
_getHttpAuthorizationString (line 835)

Returns Authorization: Basic... String

  • access: protected
string _getHttpAuthorizationString ()
_getRemoteFolderName (line 654)

Return a 12 character random directory string

  • access: protected
string _getRemoteFolderName ()
_getWsdlCompatibleOptionsArray (line 178)

Internal function to convert option array to API-compatible array

  • access: protected
array _getWsdlCompatibleOptionsArray ()
_initSoapClient (line 207)

Init Soap client - connect to SOAP service

  • throws: SevenPdf_Client_Exception
  • throws: SevenPdf_Client_Exception
  • access: protected
void _initSoapClient (string $endpoint)
  • string $endpoint
_sendWebDavCommands (line 737)

Send an array of commands to server

  • throws: SevenPdf_Client_Exception
  • access: protected
void _sendWebDavCommands (array $lines)
  • array $lines
_uploadFileViaWebDav (line 718)

Send a PUT command to server

  • access: protected
void _uploadFileViaWebDav (string $inputFilepath, string $fileRemotePath)
  • string $inputFilepath
  • string $fileRemotePath
Class Constants
VERSION = '1.0.1' (line 35)

7-PDF PHP Client version

Documentation generated on Tue, 02 Mar 2010 22:39:36 +0100 by phpDocumentor 1.4.3