Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set PDF Version using iTextSharp

Tags:

pdf

itextsharp

Anyone know how to save a PDF as a lower PDF version programmatically using iTextSharp so that you can use certain iTextSharp features that require the PDF to be version 5 or lower?

I'm trying to merge two PDF version 7 documents together and it insists that they be version 5 or lower.

like image 331
RichC Avatar asked Jun 08 '11 02:06

RichC


1 Answers

///for itextSharp 5.4.4
PdfReader reader = new PdfReader(pdfPath);
PdfStamper stamper = new PdfStamper(reader, outputStream); 
stamper.Writer.setPdfVersion(PdfWriter.PDF_VERSION_1_4); 
stamper.close(); 
like image 185
user2831210 Avatar answered Sep 17 '22 00:09

user2831210