I need to insert a blank page to an existing PDF using Itextsharp in the end of the PDF if it has odd number of pages. I could sucessfully get the. has a function of adding, removing the blank pages in C#. We have already shown you how to remove the blank page in a PDF file. This article will. The print-ready file I want needs to be duplex, so for the documents I have which are only 1 page, I need to add a blank page for the “back” of the document.
|Genre:||Health and Food|
|Published (Last):||18 January 2014|
|PDF File Size:||7.41 Mb|
|ePub File Size:||20.47 Mb|
|Price:||Free* [*Free Regsitration Required]|
Width, 0 ; break; default: Posted on StackOverflow on Jan 30, Post as a guest Name. Why would you ignore the official iText web site and give preference to examples from people who don’t know the first thing about iText??? Email Required, but paye shown. Sign up using Email and Password.
Sign up using Facebook. The document won’t actually create the page until you put something on it, so as soon as I added an empty table, bam! For an example on the official site, see How to add blank pages to an existing PDF in java?
c# – How to add a blank page to a pdf using iTextSharp? – Stack Overflow
I’ve read the answer to the question pate to add blank pages in exist PDF in java? Please stop using unofficial examples.
Well I was almost there. Sign up or log in Sign up using Google. They are so wrong?
Here is the basic code I have at the moment for merging all of the letters: AddTemplate page1, -1f, 0, 0, -1f, 0, 0 ; break; case NewPage ; at the end of the for loop for an odd number of pages without success. I am trying to do something I thought would be quite simple, however itextsyarp is not so straight forward and google has not helped. You changed your question saying that you need a C example because you don’t know how to change a c into a C and itexhsharp i into an I?
How to insert new page in PDF with itextSharp
Sign up using Facebook. This is elementary logic: Please don’t tell me that making such changes is difficult. Add fileRef ; document. So you probably need an instance of source PdfDocument and a few lines of code:. It’s easier do go in the reverse direction. GetImportedPage reader, importedPageNumber ; cb.
Adding a blank page
Here is the code that will add a blank page if the document I am merging has an odd number of pages:. The smart mode is setting adf setSmartMode true method in PdfWriter class.
Click this link if you want to see how to answer this question in iText 5.