How do i change PDF version to 1.4 using iTextSharp
Hello all
I have a PDF file with version 1.5, I want to change its version to 1.4 using iTextSharp, I tried with following code but failed to change the version, How can I do it
Here is my code to change the version
Code:
string szFile = @"D:\\kk.pdf";
using (PdfReader reader = new PdfReader(@"C:\\OCR.pdf"))
{
using (PdfStamper stamper = new PdfStamper(reader, new FileStream(szFile, FileMode.Create)))
{
stamper.Writer.SetPdfVersion(PdfWriter.PDF_VERSION_1_4);
}
}
Code executed successfully but PDF version remain unchanged,
Thanks in advance
koolprasad2003
Re: How do i change PDF version to 1.4 using iTextSharp
koolprasad2003 I haven't used iTextSharp because I used another library called lead tools but one logical
option is by loading the PDF using iTextSharp changing the version and then saving it back.
I found the following link that I think can help:
http://stackoverflow.com/questions/2...ing-itextsharp
Re: How do i change PDF version to 1.4 using iTextSharp
Oddly, Kool replied to that very thread that had the solution in it...
-tg
Re: How do i change PDF version to 1.4 using iTextSharp
Good catch tg!
I actually didn't notice that koolprasad2003 asked the same question both here and on stackoverflow. I was more focused on the contents of the question.