OS Property support center

Export PDF file

  • Alejandro Usma Vasquez
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 6 days ago #29980 by Alejandro Usma Vasquez
Export PDF file was created by Alejandro Usma Vasquez
how to insert the logo of the company in export PDF files. And how to change the distribution of information in it.

Thanks

Please Log in or Create an account to join the conversation.

More
11 years 5 days ago #30013 by Mr. Dam
Replied by Mr. Dam on topic Re: Export PDF file
Hi Alejandro,
To add logo into the pdf file, you should use FPDF library (from Configuration > Tab property > Field Select pdf export library)
And then open source code file
root > components > com_osproperty > classes > listing.php
Find
require_once(JPATH_COMPONENT.DS."helpers".DS."pdf".DS."html2fpdf.php");
$pdf=new HTML2FPDF();
$pdf->AddPage();
$pdf->WriteHTML($body);
$pdf->Output($pdf_root.DS.$filename);
//update completed, download it
HelperOspropertyCommon::downloadfile($filename);
and replace by
require_once(JPATH_COMPONENT.DS."helpers".DS."pdf".DS."html2fpdf.php");
$pdf=new HTML2FPDF();
$pdf->AddPage();
$pdf->Image('url',100,10,12,12,'PNG');
$pdf->WriteHTML($body);
$pdf->Output($pdf_root.DS.$filename);
//update completed, download it
HelperOspropertyCommon::downloadfile($filename);

in above code, url is the link of the logo, it's should be png photo, and mod of photo is "indexed color", depend on the width and height size of photo, you can adjust 4 next parameters to the center top of the pdf page.
Good luck
Dam
The following user(s) said Thank You: Alejandro Usma Vasquez

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #35233 by Ábaco Creación
Replied by Ábaco Creación on topic Re: Export PDF file
Hi Dam,
Our site is in spanish language, and we need work with specials characters, so we have selected the tcpdf mode in export options.
Is it possible add a logo in this mode?.
We try add the line:

$html2pdf->_drawImage('url');

in th file listing.php, but without success.
Thanks in advance.
Alvaro

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamNguyen Phu Quan