From e172fd458e0dbe330452059f6bf463d691384522 Mon Sep 17 00:00:00 2001 From: Yan Maniez Date: Tue, 11 Jun 2019 08:15:59 +0200 Subject: [PATCH] Push --- AideDeJeu/AideDeJeu/Pdf/PdfService.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AideDeJeu/AideDeJeu/Pdf/PdfService.cs b/AideDeJeu/AideDeJeu/Pdf/PdfService.cs index 8e703dde..670285f1 100644 --- a/AideDeJeu/AideDeJeu/Pdf/PdfService.cs +++ b/AideDeJeu/AideDeJeu/Pdf/PdfService.cs @@ -36,7 +36,7 @@ namespace AideDeJeu.Pdf var pipeline = new Markdig.MarkdownPipelineBuilder().UseYamlFrontMatter().UsePipeTables().Build(); var parsed = Markdig.Markdown.Parse(md, pipeline); - _Document = new Document(); + _Document = new Document(new Rectangle(822, 1122)); _Writer = PdfWriter.GetInstance(_Document, stream); _Document.Open(); //PdfReader reader = null; @@ -120,7 +120,12 @@ namespace AideDeJeu.Pdf private void Render(ParagraphBlock block) { - _Document.Add(CreateFormatted(block.Inline, Font.HELVETICA, 0, new Color(0, 0, 0), 20)); + ColumnText ct = new ColumnText(_Writer.DirectContent); + ct.AddText(CreateFormatted(block.Inline, Font.HELVETICA, 0, new Color(0, 0, 0), 20)); + ct.Alignment = Element.ALIGN_JUSTIFIED; + ct.SetSimpleColumn(10, 10, 200, 200); + ct.Go(); + //_Document.Add(CreateFormatted(block.Inline, Font.HELVETICA, 0, new Color(0, 0, 0), 20)); } private Phrase CreateFormatted(ContainerInline inlines, int fontFamily, int fontStyle, Color fontColor, float fontSize)