Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 21st, 2006, 06:49 AM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Merge PDF Documents

Hi there,

Does anyone know a way to merge 2 or more PDF documents into a single PDF file using ASP.NET?? This may potentially be used on a number of systems, so I would prefer it if I could achieve this in the ASP.NET code itself (so I don't have to install software or components on each machine the let me do it...)

Thanks!!
  #2 (permalink)  
Old June 6th, 2007, 04:26 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

PDF Merge and Split libraries from http://www.winnovative-software.com or http://www.dotnet-reporting.com are very reliable. The PDF merge tool allows you to merge PDF, HTML, texts and images.

  #3 (permalink)  
Old July 10th, 2007, 04:19 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can build your own PDF merge utility using the PDF Merge and split libraries for .NET from from http://www.dotnet-reporting.com or http://www.winnovative-software.com .
You can use it to merge PDF files, html files, text files and images,
set the page orientation, compression level and page size.

All this can be accomplished with only a few lines of code:

Code:
PdfDocumentOptions pdfDocumentOptions = new PdfDocumentOptions(); 
pdfDocumentOptions.PdfCompressionLevel = PDFCompressionLevel.Normal; 
pdfDocumentOptions.PdfPageSize = PdfPageSize.A4; pdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait; 
PDFMerge pdfMerge = new PDFMerge(pdfDocumentOptions); 
pdfMerge.AppendPDFFile(pdfFilePath); 
pdfMerge.AppendImageFile(imageFilePath); 
pdfMerge.AppendTextFile(textFilePath); 
pdfMerge.AppendEmptyPage(); 
pdfMerge.AppendHTMLFile(htmlFilePath); 
pdfMerge.SaveMergedPDFToFile(outFile);
You can find the full code sample on the PDF Merge Code Sample page

Regards,
Florin
  #4 (permalink)  
Old August 19th, 2013, 02:33 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please directly use the following code to achieve PDF merging :

using RasterEdge.Imaging.Basic;
using RasterEdge.Imaging.Basic.Core;
using RasterEdge.Imaging.Basic.Codec;
using RasterEdge.Imaging.PDF;


namespace RE__Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

public static string FolderName = "c:/";

private void button1_Click(object sender, EventArgs e)
{
string fileName1 = FolderName + "Sample1.pdf";
string fileName2 = FolderName + "Sample2.pdf";
string fileNameMerged = FolderName + "Merged.pdf";

REDocument doc1 = REFile.OpenDocumentFile(fileName1, new PDFDecoder());//use PDFDecoder open one pdf file

REDocument doc2 = REFile.OpenDocumentFile(fileName2, new PDFDecoder());//use PDFDecoder open another pdf file

BaseDocument docMerged = doc1.MergeDocument(doc2);//merge two pdf

REFile.SaveDocumentFile((REDocument)docMerged, fileNameMerged, new PDFEncoder());//save new pdf

}
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to merge two xml documents together? NewToXSL Pro VB.NET 2002/2003 2 August 22nd, 2008 05:28 AM
merge reporting services with pdf k2sarah Reporting Services 0 January 7th, 2007 09:43 PM
comparision of two documents anuradhad Access VBA 0 July 22nd, 2004 12:26 AM
merge 2 xml documents Beulah VS.NET 2002/2003 0 November 20th, 2003 09:33 PM



All times are GMT -4. The time now is 09:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.