Title: php   html table page generates errors
Last modified: August 31, 2016

---

# php html table page generates errors

 *  Resolved [ideepak3m](https://wordpress.org/support/users/ideepak3m/)
 * (@ideepak3m)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php-html-table-page-generates-errors/)
 * I have a page with php code to extract data from database and it creates an html
   page table structure with all the relevant data.
    I have placed a pdf button (
   manually) on the page and when I click on it, it generates an error indicating
   that it was trying to run the php script to extract data from the database and
   it fails at that point.
 * Does this mean that for a pdf conversion to work, it should be a pure html page?
 * I also have the whole html in a php variable, is there a way that I can pass 
   this variable to this plugin to generate a pdf page?
 * [https://wordpress.org/plugins/dk-pdf/](https://wordpress.org/plugins/dk-pdf/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [dinamiko](https://wordpress.org/support/users/dinamiko/)
 * (@dinamiko)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php-html-table-page-generates-errors/#post-7130758)
 * Hi ideepak3m,
 * I think that you can accomplish these tasks doing template customizations, follow
   these information:
    [http://wp.dinamiko.com/demos/dkpdf/doc/how-to-use-dk-pdf-templates-in-your-theme/](http://wp.dinamiko.com/demos/dkpdf/doc/how-to-use-dk-pdf-templates-in-your-theme/)
   [http://www.dinamiko.com/dk-pdf-template-customization-woocommerce-tutorial/](http://www.dinamiko.com/dk-pdf-template-customization-woocommerce-tutorial/)
 * doing template customizations allows get data from WordPress database (like you
   do in theme templates), add your own HTML/CSS markup…
 * try it and tell me 🙂
 * Best.
 *  Plugin Author [dinamiko](https://wordpress.org/support/users/dinamiko/)
 * (@dinamiko)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php-html-table-page-generates-errors/#post-7130760)
 * once you’ve the template dkpdf-index.php in your theme, you can try something
   like this for example:
 *     ```
       <?php
       $content = whatever_function_get_content();
       echo esc_html( $content );
       ?>
       ```
   
 * Best.
 *  Thread Starter [ideepak3m](https://wordpress.org/support/users/ideepak3m/)
 * (@ideepak3m)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php-html-table-page-generates-errors/#post-7130824)
 * Thanks for the quick reply.
 * Do I need to have woocommerce to create a template?
 * Is there an other example you can think of?
 * my real problem is that I have created an html in a php variable and I need to
   convert that html in the variable as a pdf and email it.
 *  Plugin Author [dinamiko](https://wordpress.org/support/users/dinamiko/)
 * (@dinamiko)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php-html-table-page-generates-errors/#post-7130903)
 * Hi ideepak3m,
 * no, woocommerce tutorial is just an example of template customization.
 * try this:
    1 – copy plugins/dk-pdf/templates/dkpdf-index.php to the root of your
   theme in a folder named dkpdf 2 – delete all code in this template and paste 
   your own code there.
 * Best.
 *  Thread Starter [ideepak3m](https://wordpress.org/support/users/ideepak3m/)
 * (@ideepak3m)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php-html-table-page-generates-errors/#post-7130970)
 * Thanks will do that
 *  Plugin Author [dinamiko](https://wordpress.org/support/users/dinamiko/)
 * (@dinamiko)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/php-html-table-page-generates-errors/#post-7130985)
 * OK 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘php html table page generates errors’ is closed to new replies.

 * ![](https://ps.w.org/dk-pdf/assets/icon-256x256.png?rev=3396282)
 * [DK PDF - WordPress PDF Generator](https://wordpress.org/plugins/dk-pdf/)
 * [Support Threads](https://wordpress.org/support/plugin/dk-pdf/)
 * [Active Topics](https://wordpress.org/support/plugin/dk-pdf/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dk-pdf/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dk-pdf/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [dinamiko](https://wordpress.org/support/users/dinamiko/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/php-html-table-page-generates-errors/#post-7130985)
 * Status: resolved