We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Check for the last element in page

Hello,

i wanted to know if i can check if my element (table, paragraph, … ) is the last element in the page ? i have title blocs that i want to put in a new page if they are last elements in page.

Thanks

Hi Zeid,


Thanks for your inquiry. I am afraid there is no such feature available in Aspsoe.Pdf to check whether an element is last element of the PDF page. We have logged an investigation ticket PDFNEWNET-37600 in our issue tracking system for further investigation and implementation of the feature. We will keep you updated about the issue resolution progress via this forum thread.

We are sorry for the inconvenience caused.

Best Regards,

Hi Zeid,


Adding more to Tilal’s comments, you may consider using Table object where you can place Titles in header row of table and once the table reaches page end, it will break to subsequent page and Titles will appear on top of the page. Besides this, you may consider using Header object which can be marked to repeat on subsequent pages. You may consider visiting following links for further information on

thank you for your response ! it’s a little bit complex to integrate the title in a table.

Many thanks
Zied

Hello again,

i have seen that it’s possible to tell if a table “IsBroken” or not, a workaround for my problem is to tell that the header of the table can’t be dissociated from the other rows, but the other rows can break into several pages, is it possible?

thank’s

Hi Zeid,


Thanks for your inquiry. Yes you can set RepeatingRowsCount property to repeat table header rows on new page with table data. Please check sample code as following.

Document pdf = new
Document();<o:p></o:p>

Page page = pdf.Pages.Add();

Aspose.Pdf.Table t = new Aspose.Pdf.Table();

t.ColumnWidths = "70 70";

t.RepeatingRowsCount = 1;

Aspose.Pdf.Row row = t.Rows.Add();

row.FixedRowHeight = 14;

row.BackgroundColor = Aspose.Pdf.Color.LightGray;

row.Cells.Add("Header 1");

row.Cells.Add("Header 2");

for (int i = 0; i < 150; i++)

{

row = t.Rows.Add();

row.Cells.Add("Data 1-" + i);

row.Cells.Add("Data 2-" + i);

}

page.Paragraphs.Add(t);

pdf.Save(filename);


Please feel free to contact us for any further assistance.


Best Regards,

Hello tital,

Thank you for your response but with this solution we can have a Header with 0 detail rows in the same page if the header begins in the bottom of the page, my client don’t accept this solution.


Regards

Hi Zied,

zied.nemili:
Thank you for your response but with this solution we can have a Header with 0 detail rows in the same page if the header begins in the bottom of the page, my client don't accept this solution.

Thanks for your feedback. I am afraid I am not clear about your above requirement. Can you please share a sample PDF document describing the requirements? So we will look into it and guide you accordingly.

Best Regards,