PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Tue Nov 04, 2025 9:45 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Feb 09, 2014 3:33 pm 
Offline

Joined: Sun Feb 09, 2014 3:29 pm
Posts: 1
I want to use PDFSharp or MigraDoc to create PDFs with a multi-column pagelayout. but I didnt find any hints how to do this?

The text should be placed on the page like in newspapers.

I cannot use tables, because tabels are organized by rows, but I only have a bulk of text, which should be filled in a three column page layout.

Can anybody help me?


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 09, 2014 9:52 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 355
Hi!

MigraDoc does not support several columns on one page.

One workaround: set a smaller page size for the MigraDoc document (size of one column) and draw several of these "logical" MigraDoc pages on the columns of one physical PDFsharp.
See also:
http://pdfsharp.net/wiki/MixMigraDocAnd ... ample.ashx

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 14, 2014 7:54 pm 
Offline

Joined: Thu Feb 13, 2014 7:09 pm
Posts: 13
Could you not create a table that fill the entire page, with the number of columns you require and a single row? You could then add multiple paragraphs into the single row under each different column.

Some quick sample code (not tested):

Code:
            Dim tbl As MigraDoc.DocumentObjectModel.Tables.Table = tf.AddTable()
            Dim col As MigraDoc.DocumentObjectModel.Tables.Column = Nothing
            Dim row As MigraDoc.DocumentObjectModel.Tables.Row = Nothing
            Dim para As MigraDoc.DocumentObjectModel.Paragraph = Nothing

            col = tbl.AddColumn
            col.Width = MigraDoc.DocumentObjectModel.Unit.FromInch(3)

            col = tbl.AddColumn
            col.Width = MigraDoc.DocumentObjectModel.Unit.FromInch(1)

            col = tbl.AddColumn
            col.Width = MigraDoc.DocumentObjectModel.Unit.FromInch(3)

            row = tbl.AddRow
            para = row.Cells(0).AddParagraph
            para.AddFormattedText("Title 1" + ControlChars.CrLf, MigraDoc.DocumentObjectModel.TextFormat.Bold)
            para.AddText("Article number one text.")

            para = row.Cells(0).AddParagraph
            para.AddFormattedText("Title 2" + ControlChars.CrLf, MigraDoc.DocumentObjectModel.TextFormat.Bold)
            para.AddText("Article number two text.")

            para = row.Cells(1).AddParagraph
            para.AddFormattedText("Title 3" + ControlChars.CrLf, MigraDoc.DocumentObjectModel.TextFormat.Bold)
            para.AddText("Article number three text.")


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 14, 2014 9:36 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 355
Hi!
curtis.watson wrote:
Could you not create a table that fill the entire page, with the number of columns you require and a single row?
Yes, can be done. And you can even add a second row to continue on the next page. But the general problem remains: if you want a single article to use all three columns, you still have to break the text somehow.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 238 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