Results 1 to 4 of 4

Thread: How do i change PDF version to 1.4 using iTextSharp

  1. #1

    Thread Starter
    Hyperactive Member koolprasad2003's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    443

    Question 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
    MCP, MCTS, Microsoft MVP [Asp.Net/IIS]

    For more .NET development tips visit .NET Tips

    If the post is useful then please Rate it

  2. #2
    New Member
    Join Date
    Nov 2014
    Posts
    2

    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

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    New Member
    Join Date
    Nov 2014
    Posts
    2

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width