How to convert text to PDF file [Resolved]

Posted by Mahendrabasutkar under Others on 9/19/2011 | Points: 10 | Views : 2545 | Status : [Member] | Replies : 5
Hi All,

How to convert text to PDF file

Thanks&Regards,
mahendrabasutkar




Responses

Posted by: SheoNarayan on: 9/19/2011 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
Hi Mahendra,

Use this article as a guide http://www.dotnetfunda.com/articles/article977-pdf-generator-in-net-dynamically-generate-pdf-in-aspnet-.aspx.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Mahendrabasutkar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Peterpatrickgo on: 9/26/2011 [Member] Starter | Points: 25

Up
0
Down
the most easy way is to use the default feature of MS Word 2007/2010, you could directly save as PDf format

While there are also many free online service and desktop tool availabe:
1. free online service---zamzar:http://www.zamzar.com
2. desktop tool---nemo pdf converter:http://www.nemopdf.com/pdf-converter.html

Mahendrabasutkar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Toynbee on: 5/20/2013 [Member] Starter | Points: 25

Up
0
Down
Following code example demonstrates how to convert PDF files into Text in .net
http://www.rasteredge.com/how-to/csharp-imaging/pdf-convert-text/

Mahendrabasutkar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Evanpan on: 2/17/2016 [Member] Starter | Points: 25

Up
0
Down
How about this pdf to text converter ( http://www.pqscan.com/pdf-to-text/ ) I am tetsing these days? Any suggestion will be appreciated. Thanks in advance.

Mahendrabasutkar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ashokst on: 2/29/2016 [Member] Starter | Points: 25

Up
0
Down
Here is a solution:

using Spire.Pdf;
using System.IO;
using Spire.Pdf.Graphics;
using System.Drawing;

namespace TexttoPDF
{
class Program
{
static void Main(string[] args)
{
string text = File.ReadAllText("TestDocument.txt");
PdfDocument doc = new PdfDocument();
PdfSection section = doc.Sections.Add();
PdfPageBase page = section.Pages.Add();
PdfFont font = new PdfFont(PdfFontFamily.Helvetica, 11);
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 20f;
PdfBrush brush = PdfBrushes.Black;
PdfTextWidget textWidget = new PdfTextWidget(text, font, brush);
float y = 0;
PdfTextLayout textLayout = new PdfTextLayout();
textLayout.Break = PdfLayoutBreakType.FitPage;
textLayout.Layout = PdfLayoutType.Paginate;
RectangleF bounds = new RectangleF(new PointF(0, y), page.Canvas.ClientSize);
textWidget.StringFormat = format;
textWidget.Draw(page, bounds, textLayout);
doc.SaveToFile("TxtToPDf.pdf", FileFormat.PDF);
}
}


More details: http://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Convert-Text-to-PDF-with-C-VB.NET.html

Mahendrabasutkar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response