Click here to Skip to main content
15,666,947 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi All,

I need to create a PDF including css how is it possible. I am using itext dll but css not appying.
ASP.NET
<asp:Panel ID="pnl1" runat="server">
            <h1>
                <img src="../images/logo.png" style="height: 70px; text-indent: -9999px; width: 180px;" /></h1>
            <table class="pop-form-sec p-detail">
                <tr>
                    <td colspan="2">
                        <h2>Center Wise Roll Number Details</h2>
                    </td>
                </tr>

                <tr>
                    <td>Session:
                    </td>
                    <td><%Response.Write(dtDetails.Rows[0]["pkksession"]);%></td>
                </tr>
                <tr>
                    <td>Center Code:
                    </td>
                    <td><%Response.Write(dtDetails.Rows[0]["CCode"]);%></td>
                </tr>
                <tr>
                    <td>Center Name:
                    </td>
                    <td><%Response.Write(dtDetails.Rows[0]["CName"]);%></td>
                </tr>
                <tr>
                    <td>Center Head:
                    </td>
                    <td><%Response.Write(dtDetails.Rows[0]["CHead"]);%></td>
                </tr>
                <tr>
                    <td>Center Address:
                    </td>
                    <td><%Response.Write(dtDetails.Rows[0]["CAddress"]);%></td>
                </tr>
                <tr>
                    <td>Start RollNumber:
                    </td>
                    <td><%Response.Write(dtDetails.Rows[0]["StartRollno"]);%></td>
                </tr>
                <tr>
                    <td>End RollNumber:
                    </td>
                    <td><%Response.Write(dtDetails.Rows[0]["EndRollno"]);%></td>
                </tr>
                <tr>
                    <td>Last RollNumber:
                    </td>
                    <td><%Response.Write(dtDetails.Rows[0]["LastRollno"]);%></td>
                </tr>
                <tr>
                    <td>Allocated RollNumber:
                    </td>
                    <td><%Response.Write(dtDetails.Rows[0]["AllocatedRollno"]);%></td>
                </tr>
            </table>
        </asp:Panel>
Posted
Comments
Sunasara Imdadhusen 1-May-14 1:29am    
IN which technology are talking about

1 solution

HTML concepts, including CSS, are inapplicable to PDF. The concepts are very different. PDF is very similar to the result of the print (of HTML or anything which can be rendered on a printer); this is a kind of "software paper document".

All HTML to PDF "converters" are not really converters, because the concept of conversion is inapplicable. All I saw so far just create some fixed rendering of some HTML document for some fixed page size and rendering methods and write it to PDF file. A lot of information is lost in the output document. Not only the styles, but even the paragraphs and other flow elements: they are broken into separate objects each representing a single typographic line with individual formatting properties; in general case, you cannot tell if two such lines belong to the same paragraph (div, any other flow element) or different ones.

You can do something like this, taking into account the styles and other HTML features on input and losing them all on output, creating just a hard copy of the fixed rendered pages. Taking all of the above into account, you should see that your question does not make strict sense.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900