<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kumaran KM</title>
    <description>The latest articles on DEV Community by Kumaran KM (@kumarankm4).</description>
    <link>https://dev.to/kumarankm4</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F674958%2F2cef0f7f-70b4-4d8a-ab07-a262e115a3b6.jpg</url>
      <title>DEV Community: Kumaran KM</title>
      <link>https://dev.to/kumarankm4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kumarankm4"/>
    <language>en</language>
    <item>
      <title>Merging a pdf using Javascript</title>
      <dc:creator>Kumaran KM</dc:creator>
      <pubDate>Tue, 27 Jul 2021 10:43:40 +0000</pubDate>
      <link>https://dev.to/kumarankm4/merging-a-pdf-using-javascript-48c9</link>
      <guid>https://dev.to/kumarankm4/merging-a-pdf-using-javascript-48c9</guid>
      <description>&lt;p&gt;Have you heard about pdflib library, you didn't so here is the documentation page for you.&lt;/p&gt;

&lt;h3&gt;Pdflib package&lt;/h3&gt;

&lt;p&gt;Pdflib Package&lt;/p&gt;

&lt;p&gt;So here what I have done, First I have installed the package and Add this package to json file as usual. Then I have imported that package on code, Then I have used catch syntax to check for errors.&lt;/p&gt;

&lt;p&gt;Then we need to load the pdf that we need to merge with the help of the load method inside the asynchronous function. If you want to get pdf as a user input then you can try multer package, but for now, I don't need it. I will provide a documentation link for multer package below.&lt;/p&gt;

&lt;p&gt;Multer package&lt;/p&gt;

&lt;p&gt;Then, then with create() method, I have created a new empty document. And then I have added the first pdf file into that document with the help of copyPages() method. Once I have copied the first pdf, then I will concatenate the second pdf with the same copypage method. Then the pdf will get merged into that new document, and now it's time for naming a file. With the help of writeFileSync() I have synced the file and named it with .pdf extension. So here what the output looks like.&lt;/p&gt;

&lt;p&gt;After merging&lt;br&gt;
Alt Text&lt;/p&gt;

&lt;p&gt;Thanks for taking the time to read my blog.&lt;br&gt;
Happy coding :)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>npm</category>
    </item>
  </channel>
</rss>
