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 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dorothy TincherPosted May 15, 2014, 3:37 AM
Code uses this .NET component for Word, so in short you can retrieve the raw HTML of the rendered page and you can convert that HTML into a PDF file in VB.NET.
Also 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.
lili anaPosted May 4, 2014, 4:53 AM
DANNY jacabooPosted Sep 9, 2013, 2:34 AM
rebecca yangPosted Sep 6, 2013, 2:40 AM
{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;
}
}
}
}
Sanjeeb LenkaPosted Jul 1, 2013, 7:34 AM
http://www.mindfiresolutions.com/HTML-to-PDF-conversion-using-iTextsharp-1088.php
http://pdfcrowd.com/web-html-to-pdf-net/