PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Flow text across pages with different sizes
http://forum.pdfsharp.com/viewtopic.php?f=2&t=924
Page 1 of 1

Author:  karolek [ Mon Nov 02, 2009 11:40 am ]
Post subject:  Flow text across pages with different sizes

Is it possible in MigraDoc to define a few pages with different sizes and then automatically fill them up with a piece of text?

For instance:
1) I defined a priori a document with three pages with the following sizes A3, A4, A5
2) I've got a large, continous piece of text
3) I want to combine 1) and 2) so text flows naturally from the first page (A3) through the next page (A4) and to the last page (A5)

Is this possible? Any workarounds?

Many thanks,
Karol

Author:  Thomas Hoevel [ Mon Nov 02, 2009 1:03 pm ]
Post subject:  Re: Flow text across pages with different sizes

This is not possible with MigraDoc.

You have to start a new session to change the page size.
Text won't flow accross sessions.

Workarounds?
You can create three A3 pages (or three A4 pages) using MigraDoc and later use PDFsharp to create a document with A3, A4, A5. Font size on A4 will be 71% of the A3 font size, font size on A5 will be 50% of the A3 font size.

What do you need exactly?

Author:  karolek [ Mon Nov 02, 2009 1:43 pm ]
Post subject:  Re: Flow text across pages with different sizes

Ahh, thank you Thomas - good idea, I'll give it a try. The only problem is that my "page" heights are also different, so they do not have exactly the same shape which I could scale up or down.

I'm using MigraDoc to create reports with multiple columns (usually three). I created a small "pages" which are projected onto PDF page to form columns. And everything would be fine, but the problem is that my first page contains a map (first half page), and three columns (second half page) and consecutive pages don't have the map, hence they contains three columns which occupy the whole page height.

So I've got the following situation

First page

xxxxxxxxxxx
xx Map xxxx
xxxxxxxxxxx

1 2 3
1 2 3
1 2 3

Second page (and other pages)

1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3

As you can see all columns (i.e. MigraDoc pages) on a single page are the same (1=2=3) but they differ between pages.
Everything worked really well with the single page - but with multiple pages I'm having trouble to accomodate different column(page) heights.

The content is relatively simple I can try to manually split text using trial-and-error aproach (prepare document multiple times, see when particular block of text ends in relation to the page count, etc.). I'm not sure about the performance but this is my only idea atm.

Any more ideas, tips, comments or workarounds are much appreciated.

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