Hello,
I am reading data from a text file and creating a PDF. There is an instance where I need to adjust the line height of one row in the pdf. Below is the code I am using. It doesn’t seem to work. It either makes the disappear or adds more spacing instead of less. We are trying to adjust the line height smaller.
Any ideas? In the code below where I put the ? mark is where I am editing…
’ *************************************************************************************
Dim document As Document = New Document()
document.Pages.Add()
Dim data As System.IO.StreamReader = New StreamReader(txtPath)
Dim nextLine As String = “”
Dim page As Page = document.Pages(1)
Dim i As Integer = 0
Dim priorLine As String = ""
Dim pageNum As Integer = 1
While (data.EndOfStream = False)
i += 1
priorLine = nextLine
If i = 1 Then
While nextLine = ""
nextLine = data.ReadLine
End While
Else
nextLine = data.ReadLine
End If
Dim text As TextFragment = New TextFragment(nextLine)
text.TextState.Font = FontRepository.FindFont("Courier")
text.TextState.FontSize = Fontsize
' TRYING TO DO THE LINE HEIGHT HERE
text.TextState.Linespacing = ?
page.Paragraphs.Add(text)
End While
document.Save(pdfPath) ' & "\" & "test_out.pdf")