2017-12-16 2 views
-1

나는 html 코드를 pdf 파일로 변환하는 가장 빠른 방법은 무엇입니까?

<table style='width: 720px; border-collapse: collapse; border: none;' width='100%'> 
<thead> 
    <tr style='page-break-inside: avoid; height: .35in;'> 
     <td style='width: 476.6pt; border: solid gray 1.0pt; padding: 1.45pt 4.3pt 1.45pt 4.3pt; height: .35in;' width='635'> 
      <p style='text-align: center;'><img src='img/Josmap_logo.png' width='275' height='203' alt='josmap logo'/></p> 
      <p style='text-align: center;'>Website: <a href='http://www.josmap.co.za'>www.mywebsite.co.za</a>&nbsp;&nbsp; Email: <a href='mailto:[email protected]'>[email protected]</a> &nbsp;&nbsp;Contact # xxxxxxxx Fax # xxxxxxxx</p> 
     </td> 
    </tr> 
    <tr style='page-break-inside: avoid; height: .35in;'> 
     <td style='width: 476.6pt; border: solid gray 1.0pt; border-top: none; background: gray; padding: 1.45pt 4.3pt 1.45pt 4.3pt; height: .35in; text-align: center;' width='635'> 
      <h1> MESSAGE </h1> 
     </td> 
    </tr> 
</thead> 
<tbody> 
    <tr style='page-break-inside: avoid; height: .2in;'> 
     <td style='width: 476.6pt; border: solid gray 1.0pt; border-top: none; background: #D9D9D9; padding: 1.45pt 4.3pt 1.45pt 4.3pt; height: .2in; text-align: center;' width='635'> 
      <h2>Contact Us Form</h2> 
     </td> 
    </tr> 
    <tr style='page-break-inside: avoid; height: 12.95pt;'> 
     <td style='width: 476.6pt; border: solid gray 1.0pt; border-top: none; padding: 1.45pt 4.3pt 1.45pt 4.3pt; height: 12.95pt;' width='635'> 
      <p>Message From Contact Us Form;</p> 
      <p>Name: $fullname<br> 
       E-mail: $email<br> 
       Subject: $subject 
      </p> 
      <p>$message</p> 
      <p>End of message<br> 
      </p> 
     </td> 
    </tr> 
</tbody> 
... 우리가 하중 형성 연락처 데이터베이스에 값을 입력하고 다음과 템플릿 날입니다 소유자에게 이메일 확인 메시지를 전송해야하지만 어떻게 내가 위의 내용을 생성 할 PDF 파일에?

+0

http://phptopdf.com/ – TarangP

답변

0

Here에서 phptopdf 코드를 다운로드하십시오.

require("../lib/phpToPDF/phpToPDF.php"); 
phptopdf_html(
     ' 
     <table style='width: 720px; border-collapse: collapse; border: none;' width='100%'> 
     <thead> 
     <tr style='page-break-inside: avoid; height: .35in;'> 
     <td style='width: 476.6pt; border: solid gray 1.0pt; padding: 1.45pt 4.3pt 1.45pt 4.3pt; height: .35in;' width='635'> 
     <p style='text-align: center;'><img src='img/Josmap_logo.png' width='275' height='203' alt='josmap logo'/></p> 
     <p style='text-align: center;'>Website: <a href='http://www.josmap.co.za'>www.mywebsite.co.za</a>&nbsp;&nbsp; Email: <a href='mailto:josma[email protected]'>[email protected]</a> &nbsp;&nbsp;Contact # xxxxxxxx Fax # xxxxxxxx</p> 
     </td> 
     </tr> 
     <tr style='page-break-inside: avoid; height: .35in;'> 
     <td style='width: 476.6pt; border: solid gray 1.0pt; border-top: none; background: gray; padding: 1.45pt 4.3pt 1.45pt 4.3pt; height: .35in; text-align: center;' width='635'> 
     <h1> MESSAGE </h1> 
     </td> 
     </tr> 
     </thead> 
     <tbody> 
     <tr style='page-break-inside: avoid; height: .2in;'> 
     <td style='width: 476.6pt; border: solid gray 1.0pt; border-top: none; background: #D9D9D9; padding: 1.45pt 4.3pt 1.45pt 4.3pt; height: .2in; text-align: center;' width='635'> 
     <h2>Contact Us Form</h2> 
     </td> 
     </tr> 
     <tr style='page-break-inside: avoid; height: 12.95pt;'> 
     <td style='width: 476.6pt; border: solid gray 1.0pt; border-top: none; padding: 1.45pt 4.3pt 1.45pt 4.3pt; height: 12.95pt;' width='635'> 
     <p>Message From Contact Us Form;</p> 
     <p>Name: $fullname<br> 
      E-mail: $email<br> 
      Subject: $subject</p> 
     <p>$message</p> 
     <p>End of message<br> 
     </p> 
     </td> 
     </tr> 
     </tbody> 
     </table> 
     ' 
     ,'', 'yourfilepath/filename.pdf'); 
0

사용 HTML2PDF 라이브러리가 지원 CSS를입니다 가장 좋은 방법은

관련 문제