0

So a ITextSharp created 1 page PDF is printing to two pages using ITextSharp and I don't know why.

This is how I declare my document using ITextSharp: var document = new Document(PageSize.A4, 0, 0, 0, 0);

Whether there is content added or not, if you go to print the PDF it prints two pages but whether you view in Adobe Acrobat, Adobe Reader or Chrome PDF viewer it is a one page document.

Brian Ogden
  • 18,439
  • 10
  • 97
  • 176
  • is the 2nd page blank? – Rachel Gallen Jun 08 '14 at 20:24
  • yes the second page is blank – Brian Ogden Jun 08 '14 at 20:29
  • check http://stackoverflow.com/questions/8784012/itextsharp-dll-4-1-2-0-issue-causing-blank-pages-in-a-merged-pdf and see if that helps you – Rachel Gallen Jun 08 '14 at 20:34
  • also see http://stackoverflow.com/questions/18202660/how-to-get-pdf-page-width-and-height?lq=1 – Rachel Gallen Jun 08 '14 at 20:35
  • Thanks, I am not merging documents, or using an older version of iTextSharp though – Brian Ogden Jun 08 '14 at 20:36
  • suggest http://www.codeproject.com/Articles/686994/Create-Read-Advance-PDF-Report-using-iTextSharp-in – Rachel Gallen Jun 08 '14 at 20:42
  • Thanks Rachel, this revealed that A4 is standard size throughout the world but not in the United States. Letter size paper refers to paper 8.5 inches wide and 11 inches tall Read more: http://www.ehow.com/facts_6828247_a4-paper-size-vs_-letter.html#ixzz345Bs2Yf4 This but letter size to the US post means different measures. Switching my ITextSharp document instance creation from A4 to letter gets the document all on one page but now my logo is no longer in color and the header is messed up. Looks like A4 to Letter is the solution and now I just need to adapt my content. – Brian Ogden Jun 08 '14 at 20:51
  • Glad you've made a breakthrough. Good luck with the rearranging! – Rachel Gallen Jun 08 '14 at 20:54
  • I did thanks for the brain power Rachel ;) – Brian Ogden Jun 08 '14 at 21:34
  • I'm the original author of iText (and by extension iTextSharp). I have seen thousands of PDFs, but never a PDF that shows a single page when viewed in Adobe Reader but shows two pages when printed. I would like to see that PDF. – Bruno Lowagie Jun 09 '14 at 07:45
  • Hi Bruno, it was simply because I had my PageSize set to A4 and I am using a United States printer standard, so I just switched my PageSize to be Letter. I believe the height of A4 forced the printer to print 2 pages. – Brian Ogden Jun 09 '14 at 18:40

0 Answers0