RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • About Me
  • My Publications
  • My Work Domain
  • phpResource Feeds
  •  

    Version Update :: Url2PdfReport Class

    Yesterday I released version 1.1 of Url2PdfReport Class. Changes that come with this version are simple but helpful. Because of some user-queries, I added the following methods to the class:

    ———————————————————–

    /**
    * Sets PDF version (added on 06/23/2006)
    * @param pdf version
    * @return none
    */
    function setPdfVersion($pdfVersion)
    {
    /*
    $pdfVersion = 1.3 for Adobe Acrobat Reader 4
    $pdfVersion = 1.4 for Adobe Acrobat Reader 5
    $pdfVersion = 1.5 for Adobe Acrobat Reader 6
    */
    $this->pdfVersion = $pdfVersion;
    }

    /**
    * Sets PDF header (added on 06/26/2006)
    * @param pdf header
    * @return none
    */
    function setPdfHeader($pdfHeader)
    {
    $this->headerHtml = $pdfHeader;
    }

    /**
    * Sets PDF footer (added on 06/26/2006)
    * @param pdf header
    * @return none
    */
    function setPdfFooter($pdfFooter)
    {
    $this->footerHtml = $pdfFooter;
    }
    ———————————————

    I got some mails from some members of phpclasses.org. They suggested me to give a pdf version option so that they can choose their version option according to their available pdf reader. I did so.

    And yesterday one of the phpResource members asked if header and footer can be added to the pdf. I added so to the class.

    To use the latest options with your PDF, use the class as following :
    ——————————————————————
    require_once(’Url2PdfReport.class.php’);

    $obj = new Url2PdfReport();

    //pdf version
    $pdfVersion = ‘1.4′; //change it according to your need
    /*
    $pdfVersion = 1.3 for Acrobat Reader 4
    $pdfVersion = 1.4 for Acrobat Reader 5
    $pdfVersion = 1.5 for Acrobat Reader 6
    */

    //set PDF version
    $obj->setPdfVersion($pdfVersion);

    //set Pdf Header
    $headerHtml = “put whatever you want to put in header”;
    $obj->setPdfHeader($headerHtml);

    //set Pdf Footer
    $footerHtml = “put whatever you want to put in footer”;
    $obj->setPdfFooter($footerHtml);

    //sets URL of the HTML file which will be converted to PDF
    //change this according to your URL
    $obj->setUrl(”http://localhost/phpclasses/url2pdfreport/first_test.html”);

    //gets the pdf report of the URL data
    $obj->getPdfReport();

    ——————————————————————-

    Hopefully programmers using this class will get some more helps by these changes.

    Regards,
    $Rupom

    One Response to “Version Update :: Url2PdfReport Class”

    1. isla Says:

      Mark this point.

      I think this article was interest for you.

    Leave a Reply

    You must be logged in to post a comment.