<p>I have the following webform:</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" 
    Inherits="TestWebApp.Default" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
        &lt;asp:TextBox ID="txtMultiLine" runat="server" 
            Width="400px" Height="300px" TextMode="MultiLine"&gt;&lt;/asp:TextBox&gt;
        &lt;br /&gt;
        &lt;asp:Button ID="btnSubmit" runat="server" 
            Text="Do A Postback" OnClick="btnSubmitClick" /&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and each time I post-back the leading line feeds in the textbox are being removed. Is there any way that I can prevent this behavior? </p>

<p>I was thinking of creating a custom-control that inherited from the textbox but I wanted to get a sanity check here first.</p>

[{'answer_id': 54834, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': "<p>Take my advice.  Ditch PDF for XPS.  I am working on two apps, both server based.  One displays image-based documents as PDFs in a browser.  The second uses FixedPage templates to construct XPS documents bound to data sources.  </p>\n\n<p>My conclusion after working on both projects is that PDFs suck; XPS documents less so.  You have to pay cash money for a decent PDF library, whereas XPS comes with the framework.  PDF document generation is a memory hog, has lots of potholes and isn't very server friendly.  XPS docs have a much smaller footprint and less chances of shooting yourself in the foot.  </p>\n"}, {'answer_id': 54846, 'author': 'DaveK', 'author_id': 4244, 'author_profile': 'https://Stackoverflow.com/users/4244', 'pm_score': 0, 'selected': False, 'text': '<p>I have had great success using Microsoft Word. The form is designed in Word and composited with XML data. The document is run through a PDF converter (Neevia in this case, but there are better) to generate the PDF.</p>\n\n<p>All of this is done in C#.</p>\n'}, {'answer_id': 55802, 'author': 'Tony BenBrahim', 'author_id': 80075, 'author_profile': 'https://Stackoverflow.com/users/80075', 'pm_score': 2, 'selected': True, 'text': '<p>can\'t help with VB6 solution, can help with .net or java solution on the server.<br>\nGet iText or iTextSharp from <a href="http://www.lowagie.com/iText/" rel="nofollow noreferrer">http://www.lowagie.com/iText/</a>.<br>\nIt has a PdfStamper class that can merge a  PDF and FDF  FDFReader/FDFWriter classes to generate FDF files, get field names out of PDF files, etc... </p>\n'}, {'answer_id': 69603, 'author': 'Jeremy', 'author_id': 8557, 'author_profile': 'https://Stackoverflow.com/users/8557', 'pm_score': 0, 'selected': False, 'text': "<p>Same boat. We're currently making pdfs this way: vb6 app drops a record into sql (with filename, create date, user, and final destination) and the xls (or doc) gets moved into a  server directory (share) and the server has a vb.net service that has a filewatcher monitoring that directory. The file shows up, the service kicks off excel (word) to pdf the file via adobe, looks to sql to figure out what to do with the PDF when it is made, and logs the finish time. </p>\n\n<p>This was the cheap solution- it only took about a day to do the code and another day to debug both ends and roll the build out.</p>\n\n<p><strong>This is not the way to do it.</strong> Adobe crashes at random times when trying to make the pdfs. it will run for two weeks with no issues at all, and then (like today) it will crash every 5 minutes. or every other hour. or at 11:07, 2:43, 3:05, and 6:11. </p>\n\n<p>We're going to convert the stuff out of excel and word and drop the data directly into pdfs using PDFTron in the next revision. Yes, PDFTron costs money, (we bought the 1-kilobuck-per-processor license) but it will do the job, and nicely. XPS are <em>nice</em> but I, like you, have to provide PDFs. It is the way of things.</p>\n\n<p>Check out pdfTron (google it) and see if it will do what you want. Then you just got to figure out which license you need and how you gonna pay for it. If someone comes up with something better, hope they'll vote it to the top of the list!!!</p>\n"}]
['https://Stackoverflow.com/questions/54833', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1980/']