dolibarr 25.0.0-alpha
pdf_storm.modules.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
4 * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
5 * Copyright (C) 2008 Chiptronik
6 * Copyright (C) 2011-2021 Philippe Grand <philippe.grand@atoo-net.com>
7 * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
8 * Copyright (C) 2020 John BOTELLA
9 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
10 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
11 * Copyright (C) 2024 Nick Fragoulis
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 * or see https://www.gnu.org/
26 */
27
34require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php';
35require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
38
39
44{
48 public $db;
49
53 public $name;
54
58 public $description;
59
63 public $update_main_doc_field;
64
68 public $type;
69
74 public $version = 'dolibarr';
75
79 public $position = 50;
80
81
87 public function __construct($db)
88 {
89 global $langs, $mysoc;
90
91 // Translations
92 $langs->loadLangs(array("main", "bills", "sendings", "companies"));
93
94 $this->db = $db;
95 $this->name = "Storm";
96 $this->description = $langs->trans("DocumentModelStorm");
97 $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
98
99 // Page size for A4 format
100 $this->type = 'pdf';
101 $formatarray = pdf_getFormat();
102 $this->page_largeur = $formatarray['width'];
103 $this->page_hauteur = $formatarray['height'];
104 $this->format = array($this->page_largeur, $this->page_hauteur);
105 $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
106 $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
107 $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
108 $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
109 $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
110 $this->option_logo = 1; // Display logo FAC_PDF_LOGO
111 $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
112
113 if ($mysoc === null) {
114 dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
115 return;
116 }
117
118 // Get source company
119 $this->emetteur = $mysoc;
120 if (empty($this->emetteur->country_code)) {
121 $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
122 }
123 }
124
125
126 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
138 public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
139 {
140 // phpcs:enable
141 global $user, $langs, $conf, $mysoc, $hookmanager;
142
143 if (!is_object($outputlangs)) {
144 $outputlangs = $langs;
145 }
146 // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
147 if (getDolGlobalString('MAIN_USE_FPDF')) {
148 $outputlangs->charset_output = 'ISO-8859-1';
149 }
150
151 // Load translation files required by the page
152 $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "sendings"));
153
154 if ($conf->expedition->dir_output) {
155 $object->fetch_thirdparty();
156
157 // Definition of $dir and $file
158 if ($object->specimen) {
159 $dir = $conf->expedition->dir_output."/receipt";
160 $file = $dir."/SPECIMEN.pdf";
161 } else {
162 $objectref = dol_sanitizeFileName($object->ref);
163 $dir = $conf->expedition->dir_output."/receipt/".$objectref;
164 $file = $dir."/".$objectref.".pdf";
165 }
166
167 if (!file_exists($dir)) {
168 if (dol_mkdir($dir) < 0) {
169 $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
170 return 0;
171 }
172 }
173
174 if (file_exists($dir)) {
175 // Add pdfgeneration hook
176 if (!is_object($hookmanager)) {
177 include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
178 $hookmanager = new HookManager($this->db);
179 }
180 $hookmanager->initHooks(array('pdfgeneration'));
181 $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
182 global $action;
183 $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
184
185 $nblines = count($object->lines);
186
187
188 // Loop on each lines to detect if there is at least one image to show
189 $realpatharray = array();
190 $this->atleastonephoto = false;
191 if (getDolGlobalString('MAIN_GENERATE_DELIVERY_WITH_PICTURE')) {
192 $objphoto = new Product($this->db);
193
194 for ($i = 0; $i < $nblines; $i++) {
195 if (empty($object->lines[$i]->fk_product)) {
196 continue;
197 }
198
199 $objphoto->fetch($object->lines[$i]->fk_product);
200 $pdir = array();
201
202 if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
203 $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
204 $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
205 } else {
206 $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default
207 $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
208 }
209
210 $arephoto = false;
211 $realpath = false;
212 foreach ($pdir as $midir) {
213 if (!$arephoto) {
214 $dir = $conf->product->dir_output.'/'.$midir;
215
216 foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
217 if (!getDolGlobalInt('CAT_HIGH_QUALITY_IMAGES')) { // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
218 if ($obj['photo_vignette']) {
219 $filename = $obj['photo_vignette'];
220 } else {
221 $filename = $obj['photo'];
222 }
223 } else {
224 $filename = $obj['photo'];
225 }
226
227 $realpath = $dir.$filename;
228 $arephoto = true;
229 $this->atleastonephoto = true;
230 }
231 }
232 }
233
234 if ($realpath && $arephoto) {
235 $realpatharray[$i] = $realpath;
236 }
237 }
238 }
239
240
241 // Create pdf instance
242 $pdf = pdf_getInstance($this->format);
243 $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
244 $heightforinfotot = 30; // Height reserved to output the info and total part
245 $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page
246 $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
247 if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) {
248 $heightforfooter += 6;
249 }
250 $pdf->setAutoPageBreak(true, 0);
251
252 if (class_exists('TCPDF')) {
253 $pdf->setPrintHeader(false);
254 $pdf->setPrintFooter(false);
255 }
256 $pdf->SetFont(pdf_getPDFFont($outputlangs));
257 // Set path to the background PDF File
258 if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
259 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
260 $tplidx = $pdf->importPage(1);
261 }
262
263 // We get the shipment that is the origin of delivery receipt
264 $expedition = new Expedition($this->db);
265 $result = $expedition->fetch($object->origin_id);
266 // Now we get the order that is origin of shipment
267 $commande = new Commande($this->db);
268 if ($expedition->origin == 'commande') {
269 $commande->fetch($expedition->origin_id);
270 }
271 $object->commande = $commande; // We set order of shipment onto delivery.
272 $object->commande->loadExpeditions();
273
274
275 $pdf->Open();
276 $pagenb = 0;
277 $pdf->SetDrawColor(128, 128, 128);
278
279 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
280 $pdf->SetSubject($outputlangs->transnoentities("DeliveryOrder"));
281 $pdf->SetCreator("Dolibarr ".DOL_VERSION);
282 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getAnonymisableFullName($outputlangs)));
283 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder"));
284 if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) {
285 $pdf->SetCompression(false);
286 }
287
288 // @phan-suppress-next-line PhanPluginSuspiciousParamOrder
289 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
290
291
292 // New page
293 $pdf->AddPage();
294 if (!empty($tplidx)) {
295 $pdf->useTemplate($tplidx);
296 }
297 $pagenb++;
298 $this->_pagehead($pdf, $object, 1, $outputlangs);
299 $pdf->SetFont('', '', $default_font_size - 1);
300 $pdf->MultiCell(0, 3, ''); // Set interline to 3
301 $pdf->SetTextColor(0, 0, 0);
302
303 $tab_top = 90;
304 $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
305
306 $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
307
308 $this->posxdesc = $this->marge_gauche + 1;
309
310 // Incoterm
311 $height_incoterms = 0;
312 if (isModEnabled('incoterm')) {
313 $desc_incoterms = $object->getIncotermsForPDF();
314 if ($desc_incoterms) {
315 $tab_top -= 2;
316
317 $pdf->SetFont('', '', $default_font_size - 1);
318 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
319 $nexY = $pdf->GetY();
320 $height_incoterms = $nexY - $tab_top;
321
322 // Rect takes a length in 3rd parameter
323 $pdf->SetDrawColor(192, 192, 192);
324 $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D');
325
326 $tab_top = $nexY + 6;
327 $height_incoterms += 4;
328 }
329 }
330
331 // display note
332 $notetoshow = empty($object->note_public) ? '' : $object->note_public;
333
334 // Extrafields in note
335 $extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
336 if (!empty($extranote)) {
337 $notetoshow = dol_concatdesc($notetoshow, $extranote);
338 }
339
340 if (!empty($notetoshow)) {
341 $tab_top = 88 + $height_incoterms;
342
343 $pdf->SetFont('', '', $default_font_size - 1);
344 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
345 $nexY = $pdf->GetY();
346 $height_note = $nexY - $tab_top;
347
348 // Rect takes a length in 3rd parameter
349 $pdf->SetDrawColor(192, 192, 192);
350 $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D');
351
352 $tab_height -= $height_note;
353 $tab_top = $nexY + 6;
354 } else {
355 $height_note = 0;
356 }
357
358 // Use new auto column system
359 $this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
360
361 // Table simulation to know the height of the title line
362 $pdf->startTransaction();
363 $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, 0);
364 $pdf->rollbackTransaction(true);
365
366 $iniY = $tab_top + $this->tabTitleHeight + 2;
367 $curY = $tab_top + $this->tabTitleHeight + 2;
368 $nexY = $tab_top + $this->tabTitleHeight + 2;
369
370 // Loop on each lines
371 for ($i = 0; $i < $nblines; $i++) {
372 // Fetch optionals
373 if (empty($object->lines[$i]->array_options)) {
374 $object->lines[$i]->fetch_optionals();
375 }
376
377 $curY = $nexY;
378 $pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
379 $pdf->SetTextColor(0, 0, 0);
380
381 // Define size of image if we need it
382 $imglinesize = array();
383 if (!empty($realpatharray[$i])) {
384 $imglinesize = pdf_getSizeForImage($realpatharray[$i]);
385 }
386
387
388 $pdf->setTopMargin($tab_top_newpage);
389 $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it.
390 $pageposbefore = $pdf->getPage();
391
392 // Description of product line
393 $curX = $this->posxdesc - 1;
394
395 $showpricebeforepagebreak = 1;
396
397 $posYAfterImage = 0;
398 $posYAfterDescription = 0;
399 if ($this->getColumnStatus('photo')) {
400 // We start with Photo of product line
401 if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // If photo too high, we moved completely on new page
402 $pdf->AddPage('', '', true);
403 if (!empty($tplidx)) {
404 $pdf->useTemplate($tplidx);
405 }
406 //if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs);
407 $pdf->setPage($pageposbefore + 1);
408
409 $curY = $tab_top_newpage;
410
411 // Allows data in the first page if description is long enough to break in multiples pages
412 if (getDolGlobalString('MAIN_PDF_DATA_ON_FIRST_PAGE')) {
413 $showpricebeforepagebreak = 1;
414 } else {
415 $showpricebeforepagebreak = 0;
416 }
417 }
418
419
420 if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) {
421 $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + 1, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi
422 // $pdf->Image does not increase value return by getY, so we save it manually
423 $posYAfterImage = $curY + $imglinesize['height'];
424 }
425 }
426
427
428 // Description of product line
429 if ($this->getColumnStatus('desc')) {
430 $pdf->startTransaction();
431 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 3, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
432 $pageposafter = $pdf->getPage();
433 if ($pageposafter > $pageposbefore) { // There is a pagebreak
434 $pdf->rollbackTransaction(true);
435 $pageposafter = $pageposbefore;
436 //print $pageposafter.'-'.$pageposbefore;exit;
437 $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
438 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 4, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
439 $posyafter = $pdf->GetY();
440 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text
441 if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page
442 $pdf->AddPage('', '', true);
443 if (!empty($tplidx)) {
444 $pdf->useTemplate($tplidx);
445 }
446 if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
447 $this->_pagehead($pdf, $object, 0, $outputlangs);
448 }
449 $pdf->setPage($pageposafter + 1);
450 }
451 } else {
452 // We found a page break
453 // Allows data in the first page if description is long enough to break in multiples pages
454 if (getDolGlobalString('MAIN_PDF_DATA_ON_FIRST_PAGE')) {
455 $showpricebeforepagebreak = 1;
456 } else {
457 $showpricebeforepagebreak = 0;
458 }
459 }
460 } else { // No pagebreak
461 $pdf->commitTransaction();
462 }
463
464 $posYAfterDescription = $pdf->GetY();
465 }
466
467 $nexY = $pdf->GetY();
468 $pageposafter = $pdf->getPage();
469 $pdf->setPage($pageposbefore);
470 $pdf->setTopMargin($this->marge_haute);
471 $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it.
472
473 // We suppose that a too long description is moved completely on next page
474 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
475 $pdf->setPage($pageposafter);
476 $curY = $tab_top_newpage;
477 }
478
479 $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default
480
481
482 // Quantity
483 if ($this->getColumnStatus('qty_shipped')) {
484 $this->printStdColumnContent($pdf, $curY, 'qty_shipped', (string) $object->lines[$i]->qty_shipped);
485 $nexY = max($pdf->GetY(), $nexY);
486 }
487
488 // Remaining to ship
489 if ($this->getColumnStatus('qty_remaining')) {
490 $qtyRemaining = $object->lines[$i]->qty_asked - $object->commande->expeditions[$object->lines[$i]->fk_origin_line];
491 $this->printStdColumnContent($pdf, $curY, 'qty_remaining', (string) $qtyRemaining);
492 $nexY = max($pdf->GetY(), $nexY);
493 }
494
495 $nexY = max($nexY, $posYAfterImage);
496
497 // Extrafields
498 if (!empty($object->lines[$i]->array_options)) {
499 foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue) {
500 if ($this->getColumnStatus($extrafieldColKey)) {
501 $extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey, $outputlangs);
502 $this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue);
503 $nexY = max($pdf->GetY(), $nexY);
504 }
505 }
506 }
507
508 // Add line
509 if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) {
510 $pdf->setPage($pageposafter);
511 $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80)));
512 //$pdf->SetDrawColor(190,190,200);
513 $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
514 $pdf->SetLineStyle(array('dash' => 0));
515 }
516
517 $nexY += 2; // Add space between lines
518
519 // Detect if some page were added automatically and output _tableau for past pages
520 while ($pagenb < $pageposafter) {
521 $pdf->setPage($pagenb);
522 if ($pagenb == 1) {
523 $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
524 } else {
525 $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
526 }
527 $this->_pagefoot($pdf, $object, $outputlangs, 1);
528 $pagenb++;
529 $pdf->setPage($pagenb);
530 $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it.
531 if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
532 $this->_pagehead($pdf, $object, 0, $outputlangs);
533 }
534 if (!empty($tplidx)) {
535 $pdf->useTemplate($tplidx);
536 }
537 }
538 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { // @phan-suppress-current-line PhanUndeclaredProperty
539 if ($pagenb == 1) {
540 $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
541 } else {
542 $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
543 }
544 $this->_pagefoot($pdf, $object, $outputlangs, 1);
545 // New page
546 $pdf->AddPage();
547 if (!empty($tplidx)) {
548 $pdf->useTemplate($tplidx);
549 }
550 $pagenb++;
551 if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
552 $this->_pagehead($pdf, $object, 0, $outputlangs);
553 }
554 }
555 }
556
557 // Show square
558 if ($pagenb == 1) {
559 $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
560 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
561 } else {
562 $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
563 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
564 }
565
566 // Affiche zone infos
567 $this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
568
569 // Pied de page
570 $this->_pagefoot($pdf, $object, $outputlangs);
571
572 if (method_exists($pdf, 'AliasNbPages')) {
573 $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
574 }
575
576 $pdf->Close();
577
578 $pdf->Output($file, 'F');
579
580 // Add pdfgeneration hook
581 if (!is_object($hookmanager)) {
582 include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
583 $hookmanager = new HookManager($this->db);
584 }
585 $hookmanager->initHooks(array('pdfgeneration'));
586 $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
587 global $action;
588 $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
589 $this->warnings = $hookmanager->warnings;
590 if ($reshook < 0) {
591 $this->error = $hookmanager->error;
592 $this->errors = $hookmanager->errors;
593 dolChmod($file);
594 return -1;
595 }
596
597 dolChmod($file);
598
599 $this->result = array('fullpath' => $file);
600
601 return 1; // No error
602 } else {
603 $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
604 return 0;
605 }
606 }
607
608 $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR");
609 return 0;
610 }
611
612 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
613 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
623 protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
624 {
625 // phpcs:enable
626 global $conf, $mysoc;
627 $default_font_size = pdf_getPDFFontSize($outputlangs);
628
629 $pdf->SetFont('', '', $default_font_size);
630 $pdf->SetXY($this->marge_gauche, $posy);
631
632 $larg_sign = ($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 3;
633 $pdf->RoundedRect($this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D');
634 $pdf->SetXY($this->marge_gauche + 2, $posy + 2);
635 $pdf->MultiCell($larg_sign, 2, $outputlangs->transnoentities("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":", '', 'L');
636
637 $pdf->RoundedRect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D');
638 $pdf->SetXY(2 * $larg_sign + $this->marge_gauche + 2, $posy + 2);
639 $pdf->MultiCell($larg_sign, 2, $outputlangs->transnoentities("ForCustomer").':', '', 'L');
640 }
641
642
643 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
656 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
657 {
658 global $conf;
659
660 // Force to disable hidetop and hidebottom
661 $hidebottom = 0;
662 if ($hidetop) {
663 $hidetop = -1;
664 }
665
666 $default_font_size = pdf_getPDFFontSize($outputlangs);
667
668 // Amount in (at tab_top - 1)
669 $pdf->SetTextColor(0, 0, 0);
670 $pdf->SetFont('', '', $default_font_size - 2);
671
672 if (empty($hidetop)) {
673 //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
674 if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
675 $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
676 }
677 }
678
679 $pdf->SetDrawColor(128, 128, 128);
680 $pdf->SetFont('', '', $default_font_size - 1);
681
682 // Output Rect
683 $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter
684
685
686 $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
687
688 if (empty($hidetop)) {
689 $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter
690 }
691 }
692
693 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
703 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
704 {
705 global $conf;
706
707 $default_font_size = pdf_getPDFFontSize($outputlangs);
708
709 pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
710
711 // Show Draft Watermark
712 if ($object->statut == 0 && getDolGlobalString('COMMANDE_DRAFT_WATERMARK')) {
713 pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('COMMANDE_DRAFT_WATERMARK'));
714 }
715
716 $pdf->SetTextColor(0, 0, 60);
717 $pdf->SetFont('', 'B', $default_font_size + 3);
718
719 $posy = $this->marge_haute;
720 $posx = $this->page_largeur - $this->marge_droite - 100;
721
722 $pdf->SetXY($this->marge_gauche, $posy);
723
724 // Logo
725 $logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
726 if ($this->emetteur->logo) {
727 if (is_readable($logo)) {
728 $height = pdf_getHeightForLogo($logo);
729 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
730 } else {
731 $pdf->SetTextColor(200, 0, 0);
732 $pdf->SetFont('', 'B', $default_font_size - 2);
733 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
734 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
735 }
736 } else {
737 $pdf->MultiCell(100, 4, $this->emetteur->name, 0, 'L');
738 }
739
740 $pdf->SetFont('', 'B', $default_font_size + 2);
741 $pdf->SetXY($posx, $posy);
742 $pdf->SetTextColor(0, 0, 60);
743 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R');
744
745 $pdf->SetFont('', '', $default_font_size + 2);
746
747 $posy += 5;
748 $pdf->SetXY($posx, $posy);
749 $pdf->SetTextColor(0, 0, 60);
750 if ($object->date_valid) {
751 $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_delivery, "%d %b %Y", false, $outputlangs, true), '', 'R');
752 } else {
753 $pdf->SetTextColor(255, 0, 0);
754 $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryNotValidated"), '', 'R');
755 $pdf->SetTextColor(0, 0, 60);
756 }
757
758 if ($object->thirdparty->code_client) {
759 $posy += 5;
760 $pdf->SetXY($posx, $posy);
761 $pdf->SetTextColor(0, 0, 60);
762 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities((string) $object->thirdparty->code_client), '', 'R');
763 }
764
765 $pdf->SetTextColor(0, 0, 60);
766
767 $posy += 2;
768
769 // Show list of linked objects
770 $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
771
772 if ($showaddress) {
773 // Sender properties
774 $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object);
775
776 // Show sender
777 $posy = 42;
778 $posx = $this->marge_gauche;
779 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
780 $posx = $this->page_largeur - $this->marge_droite - 80;
781 }
782 $hautcadre = 40;
783
784 // Show sender frame
785 $pdf->SetTextColor(0, 0, 0);
786 $pdf->SetFont('', '', $default_font_size - 2);
787 $pdf->SetXY($posx, $posy - 5);
788 $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L');
789 $pdf->SetXY($posx, $posy);
790 $pdf->SetFillColor(230, 230, 230);
791 $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F');
792 $pdf->SetTextColor(0, 0, 60);
793
794 // Show sender name
795 $pdf->SetXY($posx + 2, $posy + 3);
796 $pdf->SetFont('', 'B', $default_font_size);
797 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
798 $posy = $pdf->getY();
799
800 // Show sender information
801 $pdf->SetXY($posx + 2, $posy);
802 $pdf->SetFont('', '', $default_font_size - 1);
803 $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
804
805 // Client destinataire
806 $posy = 42;
807 $posx = 102;
808 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
809 $posx = $this->marge_gauche;
810 }
811 $pdf->SetTextColor(0, 0, 0);
812 $pdf->SetFont('', '', $default_font_size - 2);
813 $pdf->SetXY($posx, $posy - 5);
814 $pdf->MultiCell(80, 5, $outputlangs->transnoentities("DeliveryAddress"), 0, 'L');
815
816 // If SHIPPING contact defined on order, we use it
817 $usecontact = false;
818 $arrayidcontact = $object->commande->getIdContact('external', 'SHIPPING');
819 if (count($arrayidcontact) > 0) {
820 $usecontact = true;
821 $result = $object->fetch_contact($arrayidcontact[0]);
822 }
823
824 // Recipient name
825 if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || getDolGlobalString('MAIN_USE_COMPANY_NAME_OF_CONTACT')))) {
826 $thirdparty = $object->contact;
827 } else {
828 $thirdparty = $object->thirdparty;
829 }
830
831 $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
832
833 $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object);
834
835 // Show recipient
836 $widthrecbox = 100;
837 if ($this->page_largeur < 210) {
838 $widthrecbox = 84; // To work with US executive format
839 }
840 $posy = 42;
841 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
842 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
843 $posx = $this->marge_gauche;
844 }
845
846 // Show recipient frame
847 $pdf->SetTextColor(0, 0, 0);
848 $pdf->SetFont('', '', $default_font_size - 2);
849 $pdf->SetXY($posx + 2, $posy - 5);
850 //$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
851 $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D');
852
853 // Show recipient name
854 $pdf->SetXY($posx + 2, $posy + 3);
855 $pdf->SetFont('', 'B', $default_font_size);
856 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
857
858 $posy = $pdf->getY();
859
860 // Show recipient information
861 $pdf->SetFont('', '', $default_font_size - 1);
862 $pdf->SetXY($posx + 2, $posy);
863 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
864 }
865
866 $pdf->SetTextColor(0, 0, 60);
867
868 return 0;
869 }
870
871 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
881 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
882 {
883 $showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
884 return pdf_pagefoot($pdf, $outputlangs, 'DELIVERY_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
885 }
886
887
888
899 public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
900 {
901 global $hookmanager;
902
903 // Default field style for content
904 $this->defaultContentsFieldsStyle = array(
905 'align' => 'R', // R,C,L
906 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
907 );
908
909 // Default field style for content
910 $this->defaultTitlesFieldsStyle = array(
911 'align' => 'C', // R,C,L
912 'padding' => array(0.5, 0, 0.5, 0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
913 );
914
915 /*
916 * For example
917 $this->cols['theColKey'] = array(
918 'rank' => $rank, // int : use for ordering columns
919 'width' => 20, // the column width in mm
920 'title' => array(
921 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
922 'label' => ' ', // the final label : used fore final generated text
923 'align' => 'L', // text alignment : R,C,L
924 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
925 ),
926 'content' => array(
927 'align' => 'L', // text alignment : R,C,L
928 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
929 ),
930 );
931 */
932
933 $rank = 0; // do not use negative rank
934 $this->cols['desc'] = array(
935 'rank' => $rank,
936 'width' => false, // only for desc
937 'status' => true,
938 'title' => array(
939 'textkey' => 'Designation', // use lang key is useful in some case with module
940 'align' => 'L',
941 // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
942 // 'label' => ' ', // the final label
943 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
944 ),
945 'content' => array(
946 'align' => 'L',
947 ),
948 );
949
950 $rank += 10;
951 $this->cols['photo'] = array(
952 'rank' => $rank,
953 'width' => (float) getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH', 20), // in mm
954 'status' => false,
955 'title' => array(
956 'textkey' => 'Photo',
957 'label' => ' '
958 ),
959 'content' => array(
960 'padding' => array(0.0, 0.0, 0.0, 0.0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
961 ),
962 'border-left' => false, // remove left line separator
963 );
964
965 if (getDolGlobalString('MAIN_GENERATE_DELIVERY_WITH_PICTURE') && !empty($this->atleastonephoto)) {
966 $this->cols['photo']['status'] = true;
967 }
968
969
970 $rank += 10;
971 $this->cols['Comments'] = array(
972 'rank' => $rank,
973 'width' => 50.0, // in mm
974 'status' => true,
975 'title' => array(
976 'textkey' => 'Comments'
977 ),
978 'border-left' => true, // add left line separator
979 );
980
981 // $rank += 10;
982 // $this->cols['weight'] = array(
983 // 'rank' => $rank,
984 // 'width' => 30, // in mm
985 // 'status' => false,
986 // 'title' => array(
987 // 'textkey' => 'WeightVolShort'
988 // ),
989 // 'border-left' => true, // add left line separator
990 // );
991
992 $rank += 10;
993 $this->cols['qty_shipped'] = array(
994 'rank' => $rank,
995 'width' => 20.0, // in mm
996 'status' => !getDolGlobalString('DELIVERY_PDF_HIDE_SHIPPED'),
997 'title' => array(
998 'textkey' => 'QtyShippedShort'
999 ),
1000 'border-left' => true, // add left line separator
1001 );
1002
1003 $rank += 10;
1004 $this->cols['qty_remaining'] = array(
1005 'rank' => $rank,
1006 'width' => 20.0, // in mm
1007 'status' => !getDolGlobalString('DELIVERY_PDF_HIDE_QTYTOSHIP'),
1008 'title' => array(
1009 'textkey' => 'KeepToShipShort'
1010 ),
1011 'border-left' => true, // add left line separator
1012 );
1013
1014
1015 // Add extrafields cols
1016 if (!empty($object->lines)) {
1017 $line = reset($object->lines);
1018 $this->defineColumnExtrafield($line, $outputlangs, $hidedetails);
1019 }
1020
1021 $parameters = array(
1022 'object' => $object,
1023 'outputlangs' => $outputlangs,
1024 'hidedetails' => $hidedetails,
1025 'hidedesc' => $hidedesc,
1026 'hideref' => $hideref
1027 );
1028
1029 $reshook = $hookmanager->executeHooks('defineColumnField', $parameters, $this); // Note that $object may have been modified by hook
1030 if ($reshook < 0) {
1031 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1032 } elseif (empty($reshook)) {
1033 // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal
1034 $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys
1035 } else {
1036 $this->cols = $hookmanager->resArray;
1037 }
1038 }
1039}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition propal.php:281
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage customers orders.
prepareArrayColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Prepare Array Column Field.
getColumnStatus($colKey)
get column status from column key
printStdColumnContent($pdf, &$curY, $colKey, $columnText='')
print standard column content
getColumnContentXStart($colKey)
get column content X (abscissa) left position from column key
getColumnContentWidth($colKey)
get column content width from column key
getExtrafieldContent($object, $extrafieldKey, $outputlangs=null)
get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note...
printRoundedRect($pdf, $x, $y, $w, $h, $r, $hidetop=0, $hidebottom=0, $style='D')
Print a rounded rectangle on the PDF.
defineColumnExtrafield($object, $outputlangs, $hidedetails=0)
Define Array Column Field for extrafields.
Class to manage hooks.
Class mere des modeles de bon de livraison.
Class to manage products or services.
Class to build Delivery Order documents with storm model.
defineColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Define Array Column Field.
_tableau_info(&$pdf, $object, $posy, $outputlangs)
Show miscellaneous information (payment mode, payment term, ...)
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
__construct($db)
Constructor.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
global $mysoc
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
getCallerInfoString()
Get caller info as a string that can be appended to a log message.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
pdf_getSizeForImage($realpath)
Return dimensions to use for images onto PDF checking that width and height are not higher than maxim...
Definition pdf.lib.php:3263
pdf_watermark($pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
Definition pdf.lib.php:1200
pdf_getFormat($outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
Definition pdf.lib.php:87
pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation The hook 'pdf_writeLinkedObjects' can replace this block (retu...
Definition pdf.lib.php:1870
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
Definition pdf.lib.php:296
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref=0, $hidedesc=0, $issupplierline=0, $align='J')
Output line description into PDF.
Definition pdf.lib.php:1919
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
Definition pdf.lib.php:319
pdf_pagehead($pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
Definition pdf.lib.php:792
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.
Definition pdf.lib.php:1479
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
Definition pdf.lib.php:275
pdf_build_address($outputlangs, $sourcecompany, $targetcompany='', $targetcontact='', $usecontact=0, $mode='source', $object=null)
Return a string with full address formatted for output on PDF documents.
Definition pdf.lib.php:481
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
Definition pdf.lib.php:129
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
Definition pdf.lib.php:436
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:165