Solved

append pdf file

Posted on 2013-06-18
2
338 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
LINQ question 7 20
.Net Web Site Password specs 2 19
c# regex: extract & replace text between braces 6 28
Long URL in SMS 6 21
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now