SAMPLE:
OnClientClick="Show all" />
colspan="2">
The purpose of this policy is to assure survey participants that their school's
data with be used with respect and understanding within a limited group of decision-makers
at other schools. Schools are more likely to share information with such an understanding.
Schools may use averages in the survey results (which blend the data of at least
several schools, and which do not identify the specific data of another individual
school) with other persons within its school community.
PLEASEEEEEEEEEEE HELPPPPPP MEEEEE FASTERRRR .......
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsForums
Top experts
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 1, 2013, 3:34 AM EDT
http://www.mindfiresolutions.com/HTML-to-PDF-conversion-using-iTextsharp-1088.php
http://pdfcrowd.com/web-html-to-pdf-net/
rebecca yang18 reputationPosted Sep 5, 2013, 10:40 PM EDT
{VB.NET}
Imports System.Drawing
Imports System.Drawing.Text
Imports System.IO
Imports Spire.Pdf
Imports Spire.Pdf.Graphics
Imports Spire.Pdf.Graphics.Fonts
Namespace text_to_pdf
Class Program
Private Shared Sub Main(args As String())
Dim doc As New PdfDocument()
DrawText(doc.Sections.Add())
doc.SaveToFile("result.pdf")
doc.Close()
System.Diagnostics.Process.Start("result.pdf")
End Sub
Private Shared Sub DrawText(section As PdfSection)
Dim text As String = File.ReadAllText("..\..\test.txt")
Dim page As PdfPageBase = section.Pages.Add()
Dim font As New PdfFont(PdfFontFamily.Helvetica, 11)
Dim format As New PdfStringFormat()
format.LineSpacing = 20F
Dim pageWidth As Single = page.Canvas.ClientSize.Width
Dim brush As PdfBrush = PdfBrushes.LightSeaGreen
Dim y As Single = 30
Dim textLayouter As New PdfStringLayouter()
Dim result As PdfStringLayoutResult = textLayouter.Layout(text, font, format, New
SizeF(pageWidth, 0))
For Each line As LineInfo In result.Lines
page.Canvas.DrawString(line.Text, font, brush, 0, y, format)
y = y + result.LineHeight
Next
End Sub
End Class
{C#}
using System.Drawing;
using System.Drawing.Text;
using System.IO;
using Spire.Pdf;
using Spire.Pdf.Graphics;
using Spire.Pdf.Graphics.Fonts;
namespace text_to_pdf
{
class Program
{
static void Main(string[] args)
{
PdfDocument doc = new PdfDocument();
DrawText(doc.Sections.Add());
doc.SaveToFile("result.pdf");
doc.Close();
System.Diagnostics.Process.Start("result.pdf");
}
private static void DrawText(PdfSection section)
{
string text = File.ReadAllText(@"..\..\test.txt");
PdfPageBase page = section.Pages.Add();
PdfFont font = new PdfFont(PdfFontFamily.Helvetica, 11);
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 20f;
float pageWidth = page.Canvas.ClientSize.Width;
PdfBrush brush = PdfBrushes.LightSeaGreen;
float y = 30;
PdfStringLayouter textLayouter = new PdfStringLayouter();
PdfStringLayoutResult result
= textLayouter.Layout(text, font, format, new SizeF(pageWidth, 0));
foreach (LineInfo line in result.Lines)
{
page.Canvas.DrawString(line.Text, font, brush, 0, y, format);
y = y + result.LineHeight;
}
}
}
}
DANNY jacaboo6 reputationPosted Sep 8, 2013, 10:34 PM EDT
lili ana4 reputationPosted May 4, 2014, 12:53 AM EDT
Dorothy Tincher10 reputationPosted May 14, 2014, 11:37 PM EDT
Protected Sub PdfExportBtn_Click(sender As Object, e As EventArgs) Dim sw As New StringWriter() Dim hw As New HtmlTextWriter(sw) Me.Page.RenderControl(hw) Dim document As DocumentModel Dim options = New HtmlLoadOptions() With {.BaseAddress = Me.Request.PhysicalApplicationPath} Using htmlStream As New MemoryStream(options.Encoding.GetBytes(sw.ToString())) document = DocumentModel.Load(htmlStream, options) End Using document.Save(Me.Response, "Page.pdf") End SubAlso the last code line will save that new PDF document to a current response, in other words it will export that PDF document to an ASP.NET client.