HTML to PDF or DOC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • edwinparker
    New Member
    • Mar 2007
    • 3

    #1

    HTML to PDF or DOC

    I'm currently working on a ASP.NET (C#) web application to process bids. Right now the user will enter in some rich text into a textbox (I'm using FreeTextBox for this) and the text gets saved as HTML to a MYSQL database. I need some suggestions on how to take this HTML and put it into either a PDF or Word. The problem I'm having is keeping the formatting like it would show in a browser, but have it in a PDF.

    For example I might grab something like this from the database
    <ul>
    <li><font face="Century Gothic" size="2">Image</font></li>
    <li><font face="Century Gothic" size="2">Questi on</font></li>
    <li><font face="Century Gothic" size="2">Answer </font></li>
    </ul>
    and that's what will get put into a PDF or Word. I need it to retain the formatting as if it were viewed in a browser but inside a PDF or Word DOC. Does anyone have any suggestions for this?

    I've done lots of searching on the Internet for possible solutions to this, but so far I have not found anything that will do what I need it to. All the PDF plug-ins seem to just insert the text, I need it to insert HTML and not see the tags, but see the formatting of the tags.

    Thanks for any help. If you need any more details I can post more information/code/etc
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by edwinparker
    I'm currently working on a ASP.NET (C#) web application to process bids. Right now the user will enter in some rich text into a textbox (I'm using FreeTextBox for this) and the text gets saved as HTML to a MYSQL database. I need some suggestions on how to take this HTML and put it into either a PDF or Word. The problem I'm having is keeping the formatting like it would show in a browser, but have it in a PDF.

    For example I might grab something like this from the database
    <ul>
    <li><font face="Century Gothic" size="2">Image</font></li>
    <li><font face="Century Gothic" size="2">Questi on</font></li>
    <li><font face="Century Gothic" size="2">Answer </font></li>
    </ul>
    and that's what will get put into a PDF or Word. I need it to retain the formatting as if it were viewed in a browser but inside a PDF or Word DOC. Does anyone have any suggestions for this?

    I've done lots of searching on the Internet for possible solutions to this, but so far I have not found anything that will do what I need it to. All the PDF plug-ins seem to just insert the text, I need it to insert HTML and not see the tags, but see the formatting of the tags.

    Thanks for any help. If you need any more details I can post more information/code/etc
    There are two ways you could do this with a PDF. The first would be to completely build the page in the PDF, formatting, text, images would all need to be placed. The second would be to load up a PDF with the layout you desire, and then overlay the text onto that. I have not used PDF generation in .NET, so I do not know how easily this could be done.
    You may be able to do this easier in Word using a COM call to load up an HTML page, and then save it in as a .doc file.

    Comment

    • Motoma
      Recognized Expert Specialist
      • Jan 2007
      • 3236

      #3
      If you didn't have the requirement of taking raw HTML (and maybe even if you do), you could try using Crystal Reports to do this.

      Comment

      Working...