|
dolibarr
x.y.z
|
Set of functions used for PDF generation. More...
Go to the source code of this file.
Functions | |
| pdf_admin_prepare_head () | |
| Return array head with list of tabs to view object informations. More... | |
| pdf_getFormat (Translate $outputlangs=null, $mode='setup') | |
| Return array with format properties of default PDF format. More... | |
| pdf_getInstance ($format='', $metric='mm', $pagetype='P') | |
| Return a PDF instance object. More... | |
| pdf_getEncryption ($pathoffile) | |
| Return if pdf file is protected/encrypted. More... | |
| pdf_getPDFFont ($outputlangs) | |
| Return font name to use for PDF generation. More... | |
| pdf_getPDFFontSize ($outputlangs) | |
| Return font size to use for PDF generation. More... | |
| pdf_getHeightForLogo ($logo, $url=false) | |
| Return height to use for Logo onto PDF. More... | |
| pdfGetHeightForHtmlContent (&$pdf, $htmlcontent) | |
| Function to try to calculate height of a HTML Content. More... | |
| pdfBuildThirdpartyName ($thirdparty, Translate $outputlangs, $includealias=0) | |
| Returns the name of the thirdparty. More... | |
| pdf_build_address ($outputlangs, $sourcecompany, $targetcompany='', $targetcontact='', $usecontact=0, $mode='source', $object=null) | |
| Return a string with full address formated for output on documents. More... | |
| pdf_pagehead (&$pdf, $outputlangs, $page_height) | |
| Show header of page for PDF generation. More... | |
| pdf_getSubstitutionArray ($outputlangs, $exclude=null, $object=null, $onlykey=0) | |
| Return array of possible substitutions for PDF content (without external module substitutions). More... | |
| pdf_watermark (&$pdf, $outputlangs, $h, $w, $unit, $text) | |
| Add a draft watermark on PDF files. More... | |
| pdf_bank (&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber=0, $default_font_size=10) | |
| Show bank informations for PDF generation. More... | |
| pdf_pagefoot (&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0, $page_largeur=0, $watermark='') | |
| Show footer of page for PDF generation. More... | |
| pdf_writeLinkedObjects (&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size) | |
| Show linked objects for PDF generation. More... | |
| pdf_writelinedesc (&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref=0, $hidedesc=0, $issupplierline=0) | |
| Output line description into PDF. More... | |
| pdf_getlinedesc ($object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0) | |
| Return line description translated in outputlangs and encoded into htmlentities and with More... | |
| pdf_getlinenum ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line num. More... | |
| pdf_getlineref ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line product ref. More... | |
| pdf_getlineref_supplier ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line ref_supplier. More... | |
| pdf_getlinevatrate ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line vat rate. More... | |
| pdf_getlineupexcltax ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line unit price excluding tax. More... | |
| pdf_getlineupwithtax ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line unit price including tax. More... | |
| pdf_getlineqty ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line quantity. More... | |
| pdf_getlineqty_asked ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line quantity asked. More... | |
| pdf_getlineqty_shipped ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line quantity shipped. More... | |
| pdf_getlineqty_keeptoship ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line keep to ship quantity. More... | |
| pdf_getlineunit ($object, $i, $outputlangs, $hidedetails=0, $hookmanager=false) | |
| Return line unit. More... | |
| pdf_getlineremisepercent ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line remise percent. More... | |
| pdf_getlineprogress ($object, $i, $outputlangs, $hidedetails=0, $hookmanager=null) | |
| Return line percent. More... | |
| pdf_getlinetotalexcltax ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line total excluding tax. More... | |
| pdf_getlinetotalwithtax ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line total including tax. More... | |
| pdf_getLinkedObjects (&$object, $outputlangs) | |
| Return linked objects to use for document generation. More... | |
| pdf_getSizeForImage ($realpath) | |
| Return dimensions to use for images onto PDF checking that width and height are not higher than maximum (16x32 by default). More... | |
| pdfGetLineTotalDiscountAmount ($object, $i, $outputlangs, $hidedetails=0) | |
| Return line total amount discount. More... | |
Set of functions used for PDF generation.
Definition in file pdf.lib.php.
| pdf_admin_prepare_head | ( | ) |
Return array head with list of tabs to view object informations.
Definition at line 46 of file pdf.lib.php.
| pdf_bank | ( | & | $pdf, |
| $outputlangs, | |||
| $curx, | |||
| $cury, | |||
| $account, | |||
$onlynumber = 0, |
|||
$default_font_size = 10 |
|||
| ) |
Show bank informations for PDF generation.
| TCPDF | Object PDF | |
| Translate | $outputlangs | Object lang |
| int | $curx | X |
| int | $cury | Y |
| Account | $account | Bank account object |
| int | $onlynumber | Output only number (bank+desk+key+number according to country, but without name of bank and domiciliation) |
| int | $default_font_size | Default font size |
Definition at line 819 of file pdf.lib.php.
| pdf_build_address | ( | $outputlangs, | |
| $sourcecompany, | |||
$targetcompany = '', |
|||
$targetcontact = '', |
|||
$usecontact = 0, |
|||
$mode = 'source', |
|||
$object = null |
|||
| ) |
Return a string with full address formated for output on documents.
| Translate | $outputlangs | Output langs object |
| Societe | $sourcecompany | Source company object |
| Societe | string | null | $targetcompany | Target company object |
| Contact | string | null | $targetcontact | Target contact object |
| int | $usecontact | Use contact instead of company |
| string | $mode | Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url) |
| Object | $object | Object we want to build document for |
Definition at line 434 of file pdf.lib.php.
| pdf_getEncryption | ( | $pathoffile | ) |
Return if pdf file is protected/encrypted.
| string | $pathoffile | Path of file |
Definition at line 234 of file pdf.lib.php.
| pdf_getFormat | ( | Translate | $outputlangs = null, |
$mode = 'setup' |
|||
| ) |
Return array with format properties of default PDF format.
| Translate | $outputlangs | Output lang to use to autodetect output format if we need 'auto' detection |
| string | $mode | 'setup' = Use setup, 'auto' = Force autodetection whatever is setup |
Definition at line 84 of file pdf.lib.php.
| pdf_getHeightForLogo | ( | $logo, | |
$url = false |
|||
| ) |
Return height to use for Logo onto PDF.
| string | $logo | Full path to logo file to use |
| bool | $url | Image with url (true or false) |
Definition at line 313 of file pdf.lib.php.
| pdf_getInstance | ( | $format = '', |
|
$metric = 'mm', |
|||
$pagetype = 'P' |
|||
| ) |
Return a PDF instance object.
We create a FPDI instance that instantiate TCPDF.
| string | $format | Array(width,height). Keep empty to use default setup. |
| string | $metric | Unit of format ('mm') |
| string | $pagetype | 'P' or 'l' |
Definition at line 126 of file pdf.lib.php.
| pdf_getlinedesc | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hideref = 0, |
|||
$hidedesc = 0, |
|||
$issupplierline = 0 |
|||
| ) |
Return line description translated in outputlangs and encoded into htmlentities and with
| Object | $object | Object |
| int | $i | Current line number (0 = first line, 1 = second line, ...) |
| Translate | $outputlangs | Object langs for output |
| int | $hideref | Hide reference |
| int | $hidedesc | Hide description |
| int | $issupplierline | Is it a line for a supplier object ? |
Definition at line 1404 of file pdf.lib.php.
| pdf_getlinenum | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line num.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 1718 of file pdf.lib.php.
| pdf_getlineprogress | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0, |
|||
$hookmanager = null |
|||
| ) |
Return line percent.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
| HookManager | $hookmanager | Hook manager instance |
Definition at line 2209 of file pdf.lib.php.
| pdf_getlineqty | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line quantity.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 1962 of file pdf.lib.php.
| pdf_getlineqty_asked | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line quantity asked.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 2002 of file pdf.lib.php.
| pdf_getlineqty_keeptoship | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line keep to ship quantity.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 2082 of file pdf.lib.php.
| pdf_getlineqty_shipped | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line quantity shipped.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 2042 of file pdf.lib.php.
| pdf_getlineref | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line product ref.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 1751 of file pdf.lib.php.
| pdf_getlineref_supplier | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line ref_supplier.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 1783 of file pdf.lib.php.
| pdf_getlineremisepercent | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line remise percent.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 2166 of file pdf.lib.php.
| pdf_getlinetotalexcltax | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line total excluding tax.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 2260 of file pdf.lib.php.
| pdf_getlinetotalwithtax | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line total including tax.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide value (0 = no, 1 = yes, 2 = just special lines) |
Definition at line 2316 of file pdf.lib.php.
| pdf_getlineunit | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0, |
|||
$hookmanager = false |
|||
| ) |
Return line unit.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
| HookManager | $hookmanager | Hook manager instance |
Definition at line 2123 of file pdf.lib.php.
| pdf_getlineupexcltax | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line unit price excluding tax.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 1877 of file pdf.lib.php.
| pdf_getlineupwithtax | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line unit price including tax.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide value (0 = no, 1 = yes, 2 = just special lines) |
Definition at line 1920 of file pdf.lib.php.
| pdf_getlinevatrate | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line vat rate.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 1815 of file pdf.lib.php.
| pdf_getLinkedObjects | ( | & | $object, |
| $outputlangs | |||
| ) |
Return linked objects to use for document generation.
Warning: To save space, this function returns only one link per link type (all links are concated on same record string). This function is used by pdf_writeLinkedObjects
| object | $object | Object |
| Translate | $outputlangs | Object lang for output |
Definition at line 2371 of file pdf.lib.php.
| pdf_getPDFFont | ( | $outputlangs | ) |
Return font name to use for PDF generation.
| Translate | $outputlangs | Output langs object |
Definition at line 265 of file pdf.lib.php.
| pdf_getPDFFontSize | ( | $outputlangs | ) |
Return font size to use for PDF generation.
| Translate | $outputlangs | Output langs object |
Definition at line 288 of file pdf.lib.php.
| pdf_getSizeForImage | ( | $realpath | ) |
Return dimensions to use for images onto PDF checking that width and height are not higher than maximum (16x32 by default).
| string | $realpath | Full path to photo file to use |
Definition at line 2505 of file pdf.lib.php.
| pdf_getSubstitutionArray | ( | $outputlangs, | |
$exclude = null, |
|||
$object = null, |
|||
$onlykey = 0 |
|||
| ) |
Return array of possible substitutions for PDF content (without external module substitutions).
| Translate | $outputlangs | Output language |
| array | $exclude | Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...) |
| Object | $object | Object |
| int | $onlykey | 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip) |
Definition at line 744 of file pdf.lib.php.
| pdf_pagefoot | ( | & | $pdf, |
| $outputlangs, | |||
| $paramfreetext, | |||
| $fromcompany, | |||
| $marge_basse, | |||
| $marge_gauche, | |||
| $page_hauteur, | |||
| $object, | |||
$showdetails = 0, |
|||
$hidefreetext = 0, |
|||
$page_largeur = 0, |
|||
$watermark = '' |
|||
| ) |
Show footer of page for PDF generation.
| TCPDF | The PDF factory | |
| Translate | $outputlangs | Object lang for output |
| string | $paramfreetext | Constant name of free text |
| Societe | $fromcompany | Object company |
| int | $marge_basse | Margin bottom we use for the autobreak |
| int | $marge_gauche | Margin left (no more used) |
| int | $page_hauteur | Page height |
| Object | $object | Object shown in PDF |
| int | $showdetails | Show company adress details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both) |
| int | $hidefreetext | 1=Hide free text, 0=Show free text |
| int | $page_largeur | Page width |
| int | $watermark | Watermark text to print on page |
Definition at line 996 of file pdf.lib.php.
| pdf_pagehead | ( | & | $pdf, |
| $outputlangs, | |||
| $page_height | |||
| ) |
Show header of page for PDF generation.
| TCPDF | Object PDF | |
| Translate | $outputlangs | Object lang for output |
| int | $page_height | Height of page |
Definition at line 718 of file pdf.lib.php.
| pdf_watermark | ( | & | $pdf, |
| $outputlangs, | |||
| $h, | |||
| $w, | |||
| $unit, | |||
| $text | |||
| ) |
Add a draft watermark on PDF files.
| TCPDF | Object PDF | |
| Translate | $outputlangs | Object lang |
| int | $h | Height of PDF |
| int | $w | Width of PDF |
| string | $unit | Unit of height (mm, pt, ...) |
| string | $text | Text to show |
Definition at line 764 of file pdf.lib.php.
| pdf_writelinedesc | ( | & | $pdf, |
| $object, | |||
| $i, | |||
| $outputlangs, | |||
| $w, | |||
| $h, | |||
| $posx, | |||
| $posy, | |||
$hideref = 0, |
|||
$hidedesc = 0, |
|||
$issupplierline = 0 |
|||
| ) |
Output line description into PDF.
| TCPDF | PDF object | |
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object lang for output |
| int | $w | Width |
| int | $h | Height |
| int | $posx | Pos x |
| int | $posy | Pos y |
| int | $hideref | Hide reference |
| int | $hidedesc | Hide description |
| int | $issupplierline | Is it a line for a supplier object ? |
Definition at line 1354 of file pdf.lib.php.
| pdf_writeLinkedObjects | ( | & | $pdf, |
| $object, | |||
| $outputlangs, | |||
| $posx, | |||
| $posy, | |||
| $w, | |||
| $h, | |||
| $align, | |||
| $default_font_size | |||
| ) |
Show linked objects for PDF generation.
| TCPDF | Object PDF | |
| object | $object | Object |
| Translate | $outputlangs | Object lang |
| int | $posx | X |
| int | $posy | Y |
| float | $w | Width of cells. If 0, they extend up to the right margin of the page. |
| float | $h | Cell minimum height. The cell extends automatically if needed. |
| int | $align | Align |
| string | $default_font_size | Font size |
Definition at line 1318 of file pdf.lib.php.
| pdfBuildThirdpartyName | ( | $thirdparty, | |
| Translate | $outputlangs, | ||
$includealias = 0 |
|||
| ) |
| pdfGetHeightForHtmlContent | ( | & | $pdf, |
| $htmlcontent | |||
| ) |
Function to try to calculate height of a HTML Content.
| TCPDF | PDF initialized object | |
| string | $htmlcontent | HTML Contect |
Definition at line 338 of file pdf.lib.php.
| pdfGetLineTotalDiscountAmount | ( | $object, | |
| $i, | |||
| $outputlangs, | |||
$hidedetails = 0 |
|||
| ) |
Return line total amount discount.
| Object | $object | Object |
| int | $i | Current line number |
| Translate | $outputlangs | Object langs for output |
| int | $hidedetails | Hide details (0=no, 1=yes, 2=just special lines) |
Definition at line 2535 of file pdf.lib.php.