PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

NewLine-Seperator does not work
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1625
Page 1 of 1

Author:  ReinerWolff [ Tue Apr 19, 2011 5:32 pm ]
Post subject:  NewLine-Seperator does not work

Hello again,

now I'm trying my luck with MigraDoc. Created a nice header and footer on every page and found some problems I don't understand.
I have code like this in VB.Net:
Dim doc As New MigraDoc.DocumentObjectModel.Document
Dim sec As MigraDoc.DocumentObjectModel.Section = doc.AddSection
Dim para As MigraDoc.DocumentObjectModel.Paragraph = sec.AddParagraph("Test \n Test")

Dim Render As MigraDoc.Rendering.PdfDocumentRenderer = New MigraDoc.Rendering.PdfDocumentRenderer(True, PdfSharp.Pdf.PdfFontEmbedding.Always)
Render.Document = doc
Render.RenderDocument()

' Save the document...
Dim filename As String = "Test.pdf"
Render.PdfDocument.Save(filename)
' ...and start a viewer.
Process.Start(filename)

Schouldn't that be two lines in the created PDF?
If I run the HelloMigraDoc-Example the '\n' always makes a new line.

Second thing I was wandering about:
If I create a table with one cell, add a paragraph to the cell and set the borders.distance-property to a value it looks like this value is ignored.

I'm sure, someone has an idea for that.
Thanks in advance.

Author:  Thomas Hoevel [ Wed Apr 20, 2011 6:51 am ]
Post subject:  Re: NewLine-Seperator does not work

ReinerWolff wrote:
If I run the HelloMigraDoc-Example the '\n' always makes a new line.

It looks as if you have to translate "\n" to Visual Basic.
"\n" in C/C++/C# is CHR$(10) in Basic.
"\r" in C/C++/C# is CHR$(13) in Basic.
"\t" in C/C++/C# is the Tab character.

Author:  ReinerWolff [ Wed Apr 20, 2011 9:03 pm ]
Post subject:  Re: NewLine-Seperator does not work

Ah, thank you.
My knowledge of C/C++/C# is obviously to small.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/