PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Can pdfsharp convert .txt to .pdf?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1922
Page 1 of 1

Author:  huutoanphan [ Fri Feb 24, 2012 3:34 pm ]
Post subject:  Can pdfsharp convert .txt to .pdf?

Hi, I'm using csharp and I'd like to convert .txt file to save it in .pdf. would greatly apreciated if you can pass me any sample of codes doing such tasks.
Thanks in advance

Author:  () => true [ Sun Feb 26, 2012 8:25 am ]
Post subject:  Re: Can pdfsharp convert .txt to .pdf?

Hi!

PDFsharp can write PDF files - and .NET can read .TXT files.

Use MigraDoc, create a Document, add a Section, read the .TXT file line by line and call
Code:
section.AddParagraph(line);
for every line of text.

You can set page header, page footer, page margins, fonts, document description, ...

See also:
http://www.pdfsharp.net/wiki/MigraDocHe ... ample.ashx

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/