Hello,
I am doping tests to see if Migradoc can be useful for me and I have seen a problem while doing my tests. The idea would be to read a RDLC document and convert it to PDF without the reportviewer.
I create a table and in a cell I want to have some texts at specific locations. (TextFrames).
The problem is that the locations of the texts are ignored.
If I don't set the WrapFormat there is the first text and on the next line the second line.
With the WrapFormat both texts are exactly in the same place.
Can you please tell me what I do wrong?
I use the PDFSharp-Migradoc-gdi version 1.50.5147 (preview 2 had the same problem) in a desktop application c#6 (not WPF)
What I would expect is that the Left And Top properties are used.
Changing the relative Horizontal and Vertical didn't help either.
The problem is with the pdf file too.
I can also zip the project if you want.
Thank you
Marc
Here is my code (simple project)
Code:
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
Document document = new Document();
var Sec = document.AddSection();
var tb = Sec.AddTable();
tb.AddColumn(MigraDoc.DocumentObjectModel.Unit.FromCentimeter(4));
tb.AddColumn(MigraDoc.DocumentObjectModel.Unit.FromCentimeter(12));
var NewRow = tb.AddRow();
NewRow.Height = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(5);
NewRow.Cells[0].AddParagraph().AddText("TEST COL1");
var TF1 = NewRow.Cells[1].AddTextFrame();
TF1.Left = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(0);
TF1.Top = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(0);
TF1.Width = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(4);
TF1.Height = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(1);
TF1.RelativeHorizontal = MigraDoc.DocumentObjectModel.Shapes.RelativeHorizontal.Column ;
TF1.RelativeVertical = MigraDoc.DocumentObjectModel.Shapes.RelativeVertical.Paragraph;
TF1.AddParagraph().AddText("C2Part1");
TF1.WrapFormat.Style = MigraDoc.DocumentObjectModel.Shapes.WrapStyle.Through;
var TF2 = NewRow.Cells[1].AddTextFrame();
TF2.Left = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(8);
TF2.Top = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(0.5);
TF2.Width = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(4);
TF2.Height = MigraDoc.DocumentObjectModel.Unit.FromCentimeter(1);
TF2.RelativeHorizontal = MigraDoc.DocumentObjectModel.Shapes.RelativeHorizontal.Column;
TF2.RelativeVertical = MigraDoc.DocumentObjectModel.Shapes.RelativeVertical.Paragraph ;
TF2.AddParagraph().AddText("C2Part2");
TF2.WrapFormat.Style = MigraDoc.DocumentObjectModel.Shapes.WrapStyle.Through;
PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(true);
pdfRenderer.Document = document;
pdfRenderer.RenderDocument();
pdfRenderer.Save("tstdoc.pdf");
docPrev.Document = document;