private static void RunTypeset(CommandLineOptions commandLineOptions) { var typesetter = new Typesetter(); var documentFormatting = new DocumentFormatting( commandLineOptions.FontFamily, commandLineOptions.PageSize, commandLineOptions.PageMargin, commandLineOptions.LineHeight, commandLineOptions.FontSize, commandLineOptions.PrintPageNumbers, commandLineOptions.PrintMarginals); var documentMetadata = new DocumentMetadata( commandLineOptions.Title, documentFormatting); var markdownPages = commandLineOptions.InputFilePaths.Select(File.ReadAllText).ToArray(); Console.WriteLine("Typesetting document, please wait..."); var stream = typesetter.CreatePdfDocument(documentMetadata, markdownPages); using var fileStream = new FileStream(commandLineOptions.OutputFilepath, FileMode.Create); stream.CopyTo(fileStream); Console.WriteLine($"Finished! {commandLineOptions.OutputFilepath} has been created"); }
public DocumentMetadata(string title, DocumentFormatting documentFormatting) { Title = title; DocumentFormatting = documentFormatting; }