Changing the PDF version with iTextSharp is fairly easy, all you have to do is create a stamper and pass an extra parameter with the PDF version you want. Below is the code snippet to accomplish this in C# and VB.NET.
[topads][/topads]
C# Code
PdfReader reader = new PdfReader(fileBytes); MemoryStream ms = new MemoryStream(); PdfStamper stamper = new PdfStamper(reader, ms, "4"); //The number 4 changes the PDF version to 1.4 (or Acrobat 5) stamper.Close(); fileBytes = ms.ToArray(); ms.Flush(); reader.Close();
VB.Net Code
Dim reader As PdfReader = New PdfReader(fileBytes) Dim ms As MemoryStream = New MemoryStream() Dim stamper As PdfStamper = New PdfStamper(reader, ms, "4") 'The number 4 changes the PDF version to 1.4 (or Acrobat 5) stamper.Close() fileBytes = ms.ToArray() ms.Flush() reader.Close()
Here is a nice table showing the different versions
Acrobat Product Version | PDF Version | New Features Affecting Backwards Compatibility |
Acrobat 8 | PDF 1.7 |
|
Acrobat 7 | PDF 1.6 |
|
Acrobat 6 | PDF 1.5 |
|
Acrobat 5 | PDF 1.4 |
|
Table came from this Adobe blog.
[bottomads][/bottomads]
You can download and try this interesting high quality software on rasteredge page for c# accessible links in pdf http://www.rasteredge.com/how-to/csharp-imaging/pdf-edit-bookmark-outline/