Hello,
I have code that dynamically generates a RadDocument, and then exports it to word or pdf. It has worked fine for months. However recently I updated to Q1, 2012, and am having issues with page breaks when exporting.
Now a page break is inserted after each Section in the export, which is a major problem. To get around it, I could add all paragraphs/tables to 1 section, but then I lose the ability to insert page breaks where I do need them.
Here is a simple example of what I'm doing. When exported, "Test 1" and "Test 2" will be on separate pages. How do I get rid of these page breaks?
I have code that dynamically generates a RadDocument, and then exports it to word or pdf. It has worked fine for months. However recently I updated to Q1, 2012, and am having issues with page breaks when exporting.
Now a page break is inserted after each Section in the export, which is a major problem. To get around it, I could add all paragraphs/tables to 1 section, but then I lose the ability to insert page breaks where I do need them.
Here is a simple example of what I'm doing. When exported, "Test 1" and "Test 2" will be on separate pages. How do I get rid of these page breaks?
RadDocument document =
new
RadDocument();
Section section =
new
Section();
Paragraph paragraph =
new
Paragraph();
Span span =
new
Span();
span.Text =
"Test 1"
;
paragraph.Children.Add(span);
section.Blocks.Add(paragraph);
document.Sections.Add(section);
section =
new
Section();
paragraph =
new
Paragraph();
span =
new
Span();
span.Text =
"Test 2"
;
paragraph.Children.Add(span);
section.Blocks.Add(paragraph);
document.Sections.Add(section);
document.LayoutMode = DocumentLayoutMode.Paged;
document.Measure(RadDocument.MAX_DOCUMENT_SIZE);
document.Arrange(
new
RectangleF(PointF.Empty, document.DesiredSize));
using
(System.IO.Stream output = dialog.OpenFile())
{
PdfFormatProvider provider =
new
PdfFormatProvider();
provider.Export(document, output);
}