Solved

API for merging PDFs

Posted on 2012-04-02
3
503 Views
Last Modified: 2012-04-04
I need to create a single PDF and merge in other child-PDFs.   I will also be using bookmarks, and I need a bookmark to the page(s) where the child-PDFs are inserted.   I need a product with an API.  I will be using .NET (VB.NET)

I need a clean, straight forward of creating a single PDF, which will include text and other PDF's, and I need the ability to add a bookmark whose target is anywhere in the PDF, including the child PDFs that are inserted.

Any suggestions?
0
Comment
Question by:HLRosenberger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
binaryevo earned 250 total points
ID: 37797077
Try iTextSharp its open source and adopted from the java library.
0
 
LVL 9

Assisted Solution

by:wasiftoor
wasiftoor earned 250 total points
ID: 37797155
PDFSharp www.pdfsharp.net is one of the most widely used PDF processing libararies for .NET.

It has both the merging and bookmarking features that you are looking for.

For Bookmarking, the following sample code can be helpful:

----------------------------------------------------------------------------------------------------

// Create a new PDF document
PdfDocument document = new PdfDocument();
 
// Create a font
XFont font = new XFont("Verdana", 16);
 
// Create first page
PdfPage page = document.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
gfx.DrawString("Page 1", font, XBrushes.Black, 20, 50, XStringFormats.Default);
 
// Create the root <B class=searchkeyword>bookmark</B>. You can set the style and the color.
PdfOutline outline = document.Outlines.Add("Root", page, true, PdfOutlineStyle.Bold, XColors.Red);
 
// Create some more pages
for (int idx = 2; idx <= 5; idx++)
{
  page = document.AddPage();
  gfx = XGraphics.FromPdfPage(page);
 
  string text = "Page " + idx;
  gfx.DrawString(text, font, XBrushes.Black, 20, 50, XStringFormats.Default);
 
  // Create a sub <B class=searchkeyword>bookmark</B>
  outline.Outlines.Add(text, page, true);
}
 
// Save the document...
const string filename = "<B class=searchkeyword>Bookmark</B>s_tempfile.pdf";
document.Save(filename);
// ...and start a viewer.
Process.Start(filename);


----------------------------------------------------------------------------------------------------

Good Luck.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 37809379
Thanks
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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.
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
Progress

726 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