Solved

append pdf file

Posted on 2013-06-18
2
343 Views
Last Modified: 2013-07-11
I am trying to use  Itextsharp http://itextpdf.com/ to append a pdf file to existing file. It works fine. How can I insert the file that I want to append to a specific page.

Sample

Existing pdf  has 5 pages. I want to append a file to page 3.

Public Sub AppendPDFexisting(ByVal sourceFile As String, ByVal filetoAppend As String, ByVal nuFile As String)
        Dim OriginalDoc As New Doc
        OriginalDoc.Read(sourceFile)
        Dim AppendingPDF As New Doc
        AppendingPDF.Read(filetoAppend)
        OriginalDoc.Append(AppendingPDF)
        AppendingPDF.Dispose()
        OriginalDoc.Save(nuFile)
        OriginalDoc.Dispose()
 
    End Sub
0
Comment
Question by:VBdotnet2005
2 Comments
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 500 total points
ID: 39260293
Hi,

I think you may have to extract the existing PDF and recreate with the order you wish to have! I mean you may have to append the file where you need etc.,

http://stackoverflow.com/questions/6657899/insert-page-into-existing-pdf-using-itextsharp

Hope it helps u...
0
 
LVL 13

Expert Comment

by:jonnidip
ID: 39264532
Please give a try to PsdSharp.
I have worked with it and I think it is better than iTextSharp (from which derives). It is easier to use and it implements the disposing of objects.
You may find a sample of how to combine 2 documents here.

Regards.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question