Код: Выделить всё
using System.IO;
using PdfSharp;
using PdfSharp.Pdf;
using TheArtOfDev.HtmlRenderer.PdfSharp;
namespace webservice.texttopdf {
class Program
{
static void Main(string[] args)
{
string inputFileName = args[0];
string outputFileName = args[1];
string text = File.ReadAllText(inputFileName);
PdfDocument pdfDocument = PdfGenerator.GeneratePdf(text, PageSize.A4, 20, PdfGenerator.ParseStyleSheet(@" table, td, h1, h2, h3, p { page-break-inside: avoid; } ")); //CSS config to avoid cutting of text between page breaks
pdfDocument.Save(outputFileName);
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... is-reached
Мобильная версия