<p>How can I combine multiple PDFs into one PDF without a 3rd party component?</p>

[{'answer_id': 73987, 'author': 'Jorge Ferreira', 'author_id': 6508, 'author_profile': 'https://Stackoverflow.com/users/6508', 'pm_score': 2, 'selected': False, 'text': '<p>AFAIK C# has no built-in support for handling PDF so what you are asking can not be done without using a 3rd party component or a COTS library.</p>\n\n<p>Regarding libraries there is a myriad of possibilities. Just to point a few:</p>\n\n<p><a href="http://csharp-source.net/open-source/pdf-libraries" rel="nofollow noreferrer">http://csharp-source.net/open-source/pdf-libraries</a></p>\n\n<p><a href="http://www.codeproject.com/KB/graphics/giospdfnetlibrary.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/graphics/giospdfnetlibrary.aspx</a></p>\n\n<p><a href="http://www.pdftron.com/net/index.html" rel="nofollow noreferrer">http://www.pdftron.com/net/index.html</a></p>\n'}, {'answer_id': 74031, 'author': 'vengafoo', 'author_id': 12834, 'author_profile': 'https://Stackoverflow.com/users/12834', 'pm_score': 3, 'selected': False, 'text': '<p>The .NET Framework does not contain the ability to modify/create PDFs. You need a 3rd party component to accomplish what you are looking for.</p>\n'}, {'answer_id': 74080, 'author': 'Sergey Volegov', 'author_id': 9024, 'author_profile': 'https://Stackoverflow.com/users/9024', 'pm_score': 4, 'selected': False, 'text': '<p>I don\'t think you can.\nOpensource component PDFSharp has that functionality, and a nice <a href="http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&amp;task=view&amp;id=24&amp;Itemid=35" rel="noreferrer" title="source sample">source code sample on file combining</a></p>\n'}, {'answer_id': 74122, 'author': 'Nathan Jones', 'author_id': 5848, 'author_profile': 'https://Stackoverflow.com/users/5848', 'pm_score': 2, 'selected': False, 'text': '<p>As others have said, there is nothing built in to do that task. Use <a href="http://itextsharp.sourceforge.net/" rel="nofollow noreferrer">iTextSharp</a> with this <a href="http://www.steedsoft.com/itextsharp/tutorial01/ap01Concat.cs.html" rel="nofollow noreferrer">example code</a>.</p>\n'}, {'answer_id': 74174, 'author': 'MagicKat', 'author_id': 8505, 'author_profile': 'https://Stackoverflow.com/users/8505', 'pm_score': -1, 'selected': False, 'text': '<p>Although it has already been said, you can\'t manipulate PDFs with the built-in libraries of the .NET Framework.  I can however recommend <a href="http://itextsharp.sourceforge.net/" rel="nofollow noreferrer">iTextSharp</a>, which is a .NET port of the Java iText.  I have played around with it, and found it to be a very easy tool to use.</p>\n'}, {'answer_id': 74276, 'author': 'Paul', 'author_id': 215086, 'author_profile': 'https://Stackoverflow.com/users/215086', 'pm_score': -1, 'selected': False, 'text': '<p><a href="http://itextsharp.sourceforge.net/" rel="nofollow noreferrer">ITextSharp</a> is the way to go</p>\n'}, {'answer_id': 22138935, 'author': 'Sajitha Rathnayake', 'author_id': 2345900, 'author_profile': 'https://Stackoverflow.com/users/2345900', 'pm_score': 2, 'selected': False, 'text': '<p>I don\'t think  .NET Framework contains such like libraries.  I used iTextsharp with c# to combine pdf files. I think iTextsharp is easyest way to do this. Here is  the code I used.</p>\n\n<pre><code>string[] lstFiles=new string[3];\n    lstFiles[0]=@"C:/pdf/1.pdf";\n    lstFiles[1]=@"C:/pdf/2.pdf";\n    lstFiles[2]=@"C:/pdf/3.pdf";\n\n    PdfReader reader = null;\n    Document sourceDocument = null;\n    PdfCopy pdfCopyProvider = null;\n    PdfImportedPage importedPage;\n    string outputPdfPath=@"C:/pdf/new.pdf";\n\n\n    sourceDocument = new Document();\n    pdfCopyProvider = new PdfCopy(sourceDocument, new System.IO.FileStream(outputPdfPath, System.IO.FileMode.Create));\n\n    //Open the output file\n    sourceDocument.Open();\n\n    try\n    {\n        //Loop through the files list\n        for (int f = 0; f &lt; lstFiles.Length-1; f++)\n        {\n            int pages =get_pageCcount(lstFiles[f]);\n\n            reader = new PdfReader(lstFiles[f]);\n            //Add pages of current file\n            for (int i = 1; i &lt;= pages; i++)\n            {\n                importedPage = pdfCopyProvider.GetImportedPage(reader, i);\n                pdfCopyProvider.AddPage(importedPage);\n            }\n\n            reader.Close();\n         }\n        //At the end save the output file\n        sourceDocument.Close();\n    }\n    catch (Exception ex)\n    {\n        throw ex;\n    }\n\n\nprivate int get_pageCcount(string file)\n{\n    using (StreamReader sr = new StreamReader(File.OpenRead(file)))\n    {\n        Regex regex = new Regex(@"/Type\\s*/Page[^s]");\n        MatchCollection matches = regex.Matches(sr.ReadToEnd());\n\n        return matches.Count;\n    }\n}\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/73950', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']