Dynamic page break in a PDF report

66 views
Skip to first unread message

Batel Shoval

unread,
Jul 30, 2014, 4:41:22 AM7/30/14
to dot-net-...@googlegroups.com
Hi guys,

We are working with Siberix API and we encountered a few issues we are not sure how to address - 
In our PDF report structure, we have all kins of element and in the end we have signature part that contain 3 different elements (text, text and an image) that the customer want to present together. 
These elements appear in the end of the report - meaning there are elements before them as well.

We would like the Signature part to be presented in whole, with all three elements on the same page. 
If there is enough space on the existing page that's ok, but if there is not enough space for all of them we want them to appear on a new one.
At the moment, sometimes the first one or two text elements are presented on the existing page and only the image moves down to a new page. we want all of them to move as a group.  

We know the page break option, but in our case, sometimes the first part of the report is very short and the signature part has enough space to be presented on the same page, we want an option to set a page break only if there is not enough space for the three elements together.

Thanks in advanced and kind regards,
Batel

siberix

unread,
Jul 30, 2014, 3:09:02 PM7/30/14
to
Hi Batel,

You may use one of the following options:

1. You can add your signature elements (text, text and image) inside a Group and set KeepSolid property of that group to "True". In your case this is a preferred option.

Siberix.Report.IGroup group = section.AddGroup();
group.KeepSolid = true;

Siberix.Report.Text.IText signatureText1 = group.AddText();
signatureText1.Style = style1;
signatureText1.AddContent("First signature block");

Siberix.Report.Text.IText signatureText2 = group.AddText();
signatureText2.Style = style2;
signatureText2.AddContent("Second signature block");

Siberix.Report.IImage signatureImage = group.AddImage(new Siberix.Graphics.Image("signatureImage.jpg"));

2. The other option is to use text.KeepWithNext property. This property joins the text element with the following one.

Siberix.Report.Text.IText signatureText1 = section.AddText();
signatureText1.Style = style1;
signatureText1.AddContent("First signature block");
signatureText1.KeepWithNext = true;

Siberix.Report.Text.IText signatureText2 = section.AddText();
signatureText2.Style = style2;
signatureText2.AddContent("Second signature block");
signatureText2.KeepWithNext = true;

Siberix.Report.IImage signatureImage = section.AddImage(new Siberix.Graphics.Image("signatureImage.jpg"));


Thank You,
Victor

Batel Shoval

unread,
Aug 11, 2014, 8:50:06 AM8/11/14
to dot-net-...@googlegroups.com
Hi Victor
Thank you very much!

Batel

Reply all
Reply to author
Forward
0 new messages