using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
// Set the text and document properties to be used for the resulting file.
gdpictureDocumentConverter.TxtFontFamily = "Times New Roman";
gdpictureDocumentConverter.TxtFontSize = 16;
gdpictureDocumentConverter.TxtFontBold = true;
gdpictureDocumentConverter.TxtFontItalic = false;
gdpictureDocumentConverter.TxtHorizontalTextAlignment = TextAlignment.TextAlignmentCenter;
gdpictureDocumentConverter.TxtPageHeight = 842; // A3 page size
gdpictureDocumentConverter.TxtPageWidth = 1191; // A3 page size
gdpictureDocumentConverter.TxtPageMarginTop = 20;
gdpictureDocumentConverter.TxtPageMarginBottom = 20;
gdpictureDocumentConverter.TxtPageMarginLeft = 20;
gdpictureDocumentConverter.TxtPageMarginRight = 20;
using (Stream inputStream = File.Open("input.txt", System.IO.FileMode.Open))
{
using (Stream outputStream = File.Create("output.pdf"))
{
gdpictureDocumentConverter.ConvertToPDF(inputStream, GdPicture14.DocumentFormat.DocumentFormatTXT, outputStream, PdfConformance.PDF1_5);
}
}
}