How to export custom module form content as PDF file in drupal 7? I have a custom module with some form fields. I want to submit this form and generate pdf file of user filled values in new tab. I am trying with TCPDF but it doesn't display any fieldset ( as border ).

In submit funciton , I am taking $form array and using drupal_render($form) that render form values as html ( if I print ). If I pass this html to WriteHTML($html, true) , it gives pdf but there is no styling left on that form.
TCPDF doesn't support all styling attributes.It only supports some of the features that are given below.it has a very limited CSS support.

font-family
font-size
font-weight
font-style
color
background-color
text-decoration
width
height
text-align


Basically, You can use tables to style your pdf data And styling pdf throught table attributes.like

colspan
rowspan
align
cellpadding
cellspacing
width
border


etc.

And Note That PDF and HTML and different formats that hardly have anything in common. If TCPDF allows you to provide input data using HTML and CSS it's because it implements a simple parser for these two languages and tries to figure out how to translate that into PDF. So it's logical that TCPDF only supports a little subset of the HTML and CSS specification and, even in supported stuff, it's probably not as perfect as in first class web browsers.