1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-12-17 23:59:47 +00:00

Zone de texte ok

This commit is contained in:
Yan Maniez 2019-04-24 21:56:08 +02:00
parent 48494e51be
commit 5da6215fd0

View file

@ -1140,30 +1140,42 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
// read the file // read the file
//PdfReader fondo = new PdfReader("listaPrecios.pdf"); //PdfReader fondo = new PdfReader("listaPrecios.pdf");
PdfStamper stamper = new PdfStamper(reader, stream); PdfStamper stamper = new PdfStamper(reader, stream);
var ct = new ColumnText(stamper.GetOverContent(1));
ct.SetSimpleColumn(20, 685, 200, 35); PdfContentByte cb = stamper.GetOverContent(1);
//ct.Canvas.SetRGBColorFill(255, 0, 0); cb.SetRGBColorFill(255, 0, 0);
//ct.Canvas. cb.Rectangle(reader.GetPageSize(1).Width - 90f, 830f, 50f, 50f);
//ct.Canvas.Rectangle(0, 0, 200f, 600f); cb.Stroke();
var p = new Paragraph(new Phrase(20, "Hello World! gfdgfd gfdgfd gfdgfdg gfdgdg zrerezr ezrzerez rezrezrze zrezrez zrezrez ffdfdsz rezrzerez fsffsdfs", bigFont)); iTextSharp.text.Rectangle rect = new iTextSharp.text.Rectangle(
p.Alignment = iTextSharp.text.Element.ALIGN_CENTER; reader.GetPageSize(1).Width - 90f, 730f,
ct.AddElement(p); reader.GetPageSize(1).Width - 40f, 780f);
ColumnText ct = new ColumnText(cb);
ct.SetSimpleColumn(rect.Left, rect.Bottom, rect.Right, rect.Top);
ct.AddElement(new Paragraph("This is the text added in the rectangle"));
ct.Go(); ct.Go();
//var ct = new ColumnText(stamper.GetOverContent(1));
//ct.SetSimpleColumn(20, 685, 200, 35);
////ct.Canvas.SetRGBColorFill(255, 0, 0);
////ct.Canvas.
////ct.Canvas.Rectangle(0, 0, 200f, 600f);
//var p = new Paragraph(new Phrase(20, "Hello World! gfdgfd gfdgfd gfdgfdg gfdgdg zrerezr ezrzerez rezrezrze zrezrez zrezrez ffdfdsz rezrzerez fsffsdfs", bigFont));
//p.Alignment = iTextSharp.text.Element.ALIGN_CENTER;
//ct.AddElement(p);
//ct.Go();
PdfContentByte content = stamper.GetOverContent(1); //PdfContentByte content = stamper.GetOverContent(1);
// add text //// add text
content.SetRGBColorFill(255, 0, 0); //content.SetRGBColorFill(255, 0, 0);
content.Rectangle(20, 685, 200, 35); //content.Rectangle(20, 685, 200, 35);
content.Stroke(); //content.Stroke();
ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase("Galefrin", bigFont), 40, 700, 0); //ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase("Galefrin", bigFont), 40, 700, 0);
ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Strength.ToString(), bigFont), 40, 620, 0); //ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Strength.ToString(), bigFont), 40, 620, 0);
ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Dexterity.ToString(), bigFont), 40, 545, 0); //ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Dexterity.ToString(), bigFont), 40, 545, 0);
ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Constitution.ToString(), bigFont), 40, 470, 0); //ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Constitution.ToString(), bigFont), 40, 470, 0);
ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Intelligence.ToString(), bigFont), 40, 395, 0); //ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Intelligence.ToString(), bigFont), 40, 395, 0);
ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Wisdom.ToString(), bigFont), 40, 320, 0); //ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Wisdom.ToString(), bigFont), 40, 320, 0);
ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Charisma.ToString(), bigFont), 40, 245, 0); //ColumnText.ShowTextAligned(content, iTextSharp.text.Element.ALIGN_LEFT, new Phrase(Charisma.ToString(), bigFont), 40, 245, 0);
//ColumnText ct = new ColumnText(content); //ColumnText ct = new ColumnText(content);
//// this are the coordinates where you want to add text //// this are the coordinates where you want to add text