Dear Sir or Madam,
We develop an winform software and we need to generate a pdf report with different sections. One of them came from a RTF text, that it has previosly loaded from a RichEditControl.
we use a exaple code, it works for almost all cases, but it does not work when we want to print a table with a large cell text (from RTF).
When we have a many-line cell in a table, the text does not wrap properly and the border is from a single line cell (it attach text out site of the cell).
I have tried to find a solution to this bug but I have not find solution as long as all code is behind syncfusion libraries.
Our code is
Private Shared Sub PintarLinea(doc As PdfDocument, ByRef pointY As Integer, texto As String)
Dim page As PdfPage = doc.Pages(doc.Pages.Count - 1)
Dim bounds As SizeF = page.GetClientSize()
Dim metafile As PdfMetafile = DirectCast(PdfImage.FromRtf(texto, bounds.Width - 30, PdfImageType.Metafile), PdfMetafile)
Dim format As New PdfMetafileLayoutFormat()
IncrementarPointY(metafile.Draw(page, 30, pointY, format), doc, pointY)
end Sub
Private Shared Sub IncrementarPointY(ByRef layout As PdfLayoutResult, doc As PdfDocument, ByRef pointY As Integer)
If (layout.Bounds.Bottom > 710) Then
doc.Pages.Add()
pointY = 20.0F
Else
pointY = layout.Bounds.Bottom + 20.0F
End If
End Sub
The RTF text in this case is:
I attach a zip file with the right table (docx) and how it is show (PDF).
Please, let me know if you need more information about it.
Yours sincerely,
Attachment:
TableRTF_4f776c46.zip