wkhtmltopdf - Even number of pages as output - wkhtmltopdf
I'm looking for a way to make sure that the output from wkhtmltopdf always consists of an even number of pages, i.e. adding a blank page at the end of the pdf if the number of pages is uneven. If anyone has a good solutions for this I would be really happy
/J
A simple solution would be to create the pdf, then check the page count and add one empty page with for example itext / itextsharp if necessary. Guessing page counts or lengths is very difficult.
Related
Is there a way to PDF Page reorder according to any order of my choice?
Is there a way to PDF Page reorder according to text string of my choice? There are multiple sites that allow rearranging PDF pages by drag & drop. But, this process becomes to lengthy when I have a document of say 100 pages. In case I need to print a 100 page PDF in such a way that it can be bound like a book, I need to rearrange these as the following order. 100,1,98,3,2,99,4,97,96,5,94,7,6,95,8,93,92,9,90,11,10,91,12,89,88,13,86,15,14,87,16,85,84,17,82,19,18,83,20,81,80,21,78,23,22,79,24,77,76,25,74,27,26,75,28,73,72,29,70,31,30,71,32,69,68,33,66,35,34,67,36,65,64,37,62,39,38,63,40,61,60,41,58,43,42,59,44,57,56,45,54,47,46,55,48,53,52,49,50,51 Here, the order is logical to be printed as a book, but it is not easy to utilise drag & drop to achieve this. Is there any way to rearrange the PDF in the above order of pages? I have tried to use Microsoft Print to PDF and Chrome Print to do this, but this gives the output files as 1,2,3,.........,100 order.
cpdf in.pdf 100,1,98,3,2,99,4,97,96,5,94,7,6,95,8,93,92,9,90,11,10,91,12,89,88,13,86,15,14,87,16,85,84,17,82,19,18,83,20,81,80,21,78,23,22,79,24,77,76,25,74,27,26,75,28,73,72,29,70,31,30,71,32,69,68,33,66,35,34,67,36,65,64,37,62,39,38,63,40,61,60,41,58,43,42,59,44,57,56,45,54,47,46,55,48,53,52,49,50,51 -o out.pdf
Rotativa.AspNetCore page break half of line goes next page
I have a very big view which needs to be converted to PDF. I have used Rotativa but it is not properly page breaking, half of the line goes to next page and I don't know where needs to use page break because my view model generate dynamically.
Rotativa is built on top of wkhtmltopdf library, so this means that the same solutions from this post should also be a good for you: Wkhtmltopdf Characters in single line partially cut between pages
Calculating no. of pages before the pdf generation
I am using ActivePDF tool to convert few different file formats to PDF. Before this conversion, I need to find out how many pages of PDF I will end up with. So, say my word document is converted to 4 page pdf, I need to get that count of pages before the actual conversion. How can I best achieve this?
Set minimal pages count in pdf using flying saucer
Is there any way to set minimal count of pages to pdf? So my current need looks like: I have an header on second page that should be shown First page has content that can overflow to second page It is not acceptable to have 3 pages So I need 2 pages in both cases: First page fits to single page (so I should create second page manually) First page overflows (at create second page by its content) Single workaround that I found - overflow by empty (<br/>s) content. But I wanna do it with css. I've tried to use #page:first but it wouldn't work in common css manner (like #page:first .break-page{...}) I've tried to use #page:first {break-page-after:always} - it wouldn't work...
BIRT - How to List the Contents of Page Variable
I have a report with page variable implemented to display current/total page numbers for each customer. I have another requirement - Display a list of customer names and the respective page numbers contained in the report on the last page of the report(such as Company A - 3 pages, Company B - 4 pages). It has to be proper looking with border lines. I was able to implement the page variable by simply borrowing the code I've found on the Internet, but have no idea how to display the contents(customer names and page numbers) as a list at the end of the report. Would someone help me to accomplish this requirement?
I don't think this is possible with BIRT. In similar cases, and only for the special case of PDF output, we are using a post-processing approach, but it requires Java programming: First, we let BIRT generate Table-of-Content entries ("outline" in PDF speech) for the companies. The second-step is post-processing: we read the PDF using iText and examine the TOC. That way we get the information about which company starts at which page number. Together with the total page number it is easy to compute how many pages each company takes. Then iText can generate and add a visible TOC (as you described) to the PDF.