PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 16, 2024 7:42 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Apr 19, 2011 5:32 pm 
Offline

Joined: Wed Apr 13, 2011 6:39 pm
Posts: 21
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.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 20, 2011 6:51 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 20, 2011 9:03 pm 
Offline

Joined: Wed Apr 13, 2011 6:39 pm
Posts: 21
Ah, thank you.
My knowledge of C/C++/C# is obviously to small.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 165 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group