Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As explained many times before (<a href="https://stackoverflow.com/questions/15218126/itextsharp-include-all-pages-from-the-input-file/15218677#15218677">ITextSharp include all pages from the input file</a>, <a href="https://stackoverflow.com/questions/14770942/itext-pdf-merge-document-overflow-outside-pdf-text-truncated-page-and-not-di/14771651#14771651">Itext pdf Merge : Document overflow outside pdf (Text truncated) page and not displaying</a>, and so on), you should read <a href="http://www.manning.com/lowagie2/samplechapter6.pdf" rel="nofollow noreferrer">chapter 6</a> of my book <a href="http://itextpdf.com/book" rel="nofollow noreferrer">iText in Action</a> (you can find the C# version of the examples <a href="http://tinyurl.com/itextsharpIIA2C06" rel="nofollow noreferrer">here</a>).</p> <p>You are using a combination of <code>Document</code>, <code>PdfWriter</code> and <code>PdfImportedPage</code> to split a PDF. Please tell me who made you do it this way, so that I can curse the person who inspired you (because I've answered this question hundreds of times before, and I'm getting tired of repeating myself). These classes aren't a good choice for that job:</p> <ul> <li>you lose all interactivity,</li> <li>you need to rotate the content yourself if the page is in landscape,</li> <li>you need to take the original page size into account,</li> <li>...</li> </ul> <p>Your problem is similar to this one <a href="https://stackoverflow.com/questions/15309651/itextsharp-unexpected-elements-on-copied-pages">itextsharp: unexpected elements on copied pages</a>. Is there any reason why you didn't read the documentation? If you say: <em>"I didn't have the time"</em>, please believe me if I say that I have almost 20 years of experience as a developer, and I've never seen "reading documentation" as a waste of time.</p> <p>Long story short: read the documentation, replace <code>PdfWriter</code> with <code>PdfCopy</code>, replace <code>AddTemplate()</code> with <code>AddPage()</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload