Solved

append pdf file

Posted on 2013-06-18
2
341 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to sort a list of objects using an item in an enclosed list 5 46
2 questions 10 25
VB.Net Tranfer data between to VB.Net apps 8 25
MailAddress in vb 4 15
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

773 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