I'm using SelectPDF's HTML to PDF converter to generate a PDF based on an HTML document containing a wide table of data. I'd like this table to wrap onto a second page (or Nth) page if needed, but instead SelectPDF squeezes the table into the space available on the page size I've selected.
Related
I'm creating a PDFSharp document with an embedded table created using Migradoc.
This works just fine.
As the table has a variable number of rows, I need to know the actual height after rendering it into the main PDFsharp document. I need this to continue drawing other sections just after the table created using Migradoc.
This is the code that actually prepares and renders the table:
DocumentRenderer docRenderer = new DocumentRenderer(doc);
docRenderer.PrepareDocument();
docRenderer.RenderObject(gfx, XUnit.FromPoint(x), XUnit.FromPoint(y), XUnit.FromPoint(width), populatedTable);
In the docRenderer.PrepareDocument().FormatedDocument I can get the number of pages (in my case will always be one) and the size of the actual page (A4, for example) but not the height of the actual object.
How can I achieve this?
Well, I just found out how to do it.
After you call PrepareDocument(), you can access the RenderInfo array and check its content:
RenderInfo[] info = docRenderer.GetRenderInfoFromPage(1);
double yTableHeight = info[info.Length - 1].LayoutInfo.ContentArea.Height.Point;
In my case I'm rendering directly the table to a PDFsharp document, the whole ContentArea height is for the table. On a normal page, you will have also margins to add to this number.
I am using EVO Pdf to generate PDF,ie URL to PDF conversion is used.I have many dynamic sections in HTML to show student details .I have a table which contains entry for each student.I need to add page number in this table to identify student.ie in which page of PDF Student details will come?
I am merging multiple PDF files using iTextSharp, but I need to re-number the pages by section. For example, I am merging a PDF file that corresponds to the cover of a book, with a PDF file that has the actual content of the book. I want to use I,II,III numbering system for the cover, then use 1,2,3 numbering for the content, so that when the user enters page number 9 in the navigation box, it'll take him/her to the corresponding page in the content.
In Adobe Acrobat, this can be done by selecting the pages and clicking on Number Pages. I would like to do the same but using c# code. Thanks!
This is a short snippet with the relevant lines you'll need:
var labels = new PdfPageLabels();
labels.AddPageLabel(sectionPageNumber, pageNumberingStyle, customText, startingNumber);
.
.
.
pdfWriter.PageLabels = labels;
In this snippet:
sectionPageNumber is the page number where the section starts,
pageNumberingStyle is a value such as PdfPageLabels.UPPERCASE_ROMAN_NUMERALS, PdfPageLabels.DECIMAL_ARABIC_NUMERALS, etc.
customText is any text that needs to go with the page number, and
startingNumber is the page number that this numbering style would start.
I have a table report which will be exported as a word document. I can print out the header in the first page only. It doesn't seem to carry over to the next page. Can anyone tell me how I can show the header data on all the pages of the word document?
The solution to this was a lot easier than I expected. All I had to do was put the header data I wanted in the header of the Word Ddocument Template that I wanted to use. Also in order to have the header of a table to apear repeatedly when there are multiple pages, again we go to the Word Document Template, select the rows you want to use as headers then right click and go to Properties -> Rows tab -> enable(check) "Reapeat as header row at the top of each page" -> click OK and save. That should do the trick!! Then use syncfusion as you usually use it to populate the table. When the data exceed to more than one page the header will be repeated on the following pages.
I am building a table that spans multiple pages of my PDF. I would like the column header of the table to appear as the first row on each page. Is there some way that I can detect when the page is breaking and insert the column headers rather than the next data row?
Check the iTextSharp tutorial on SourceForge, chapter 5, section "Large Tables," example 10.
You basically call EndHeaders() on your Table.