Google
 

Thursday, November 27, 2008

Merging PDF files in Linux

Sometimes you might have to merge two or more pdf files into one single pdf document. While there are commercial softwares like Adobe Acrobat or something similar to do the job, it's much simpler in Linux using commandline. There are several softwares for the job and most of them require simple one line command!

The following commands merge first.pdf and second.pdf to merge.pdf. You can also merge more than two files using similar command.

Using Ghostscript
Ghostscript is a PostScript and PDF language interpreter and previewer. You can do quite handful tasks related to ps and pdf files with Ghostscript; merging happens to be one of them.

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=merged.pdf -dBATCH first.pdf second.pdf

Using ImageMagick
ImageMagick is basically an image manipulation software but it also handles pdf files.

convert first.pdf second.pdf merged.pdf

Using PDFTk
If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a command-line tool for doing everyday things with PDF documents.

pdftk first.pdf second.pdf cat output merged.pdf

Using pdf2ps and ps2pdf
pdf2ps and ps2pdf comes with Ghostscript. The former converts pdf file to ps and latter the reverse. We can use them to first convert pdf files to ps format, merge all ps files and then converting ps file back to pdf.

pdf2ps first.pdf first.ps
pdf2ps second.pdf second.ps
cat first.pdf second.ps > merged.ps
ps2pdf merged.ps merged.pdf


If you are looking for some GUI version, there's a Nautilus script which acts as frontend to PDFTk. If you are on KDE, Kommander script is also available (also depends on PDFTk)


NOTE: To install Ghostscript (already installed in most distros by default), ImageMagick or PDFTk in Linux,

sudo apt-get install ghostscript
sudo apt-get install imagemagick
sudo apt-get install pdftk

34 comments:

  1. hello, today as always your post is lovely that I liked it and I am waiting for your new works in future, good luck to all of you.
    digital marketing company in india

    ReplyDelete
  2. Healrun is a health news blog we provide the latest news about health, Drugs and latest Diseases and conditions. We update our users with health tips and health products reviews. If you want to know any information about health or health product (Side Effects & Benefits) Feel Free To ask HealRun Support Team.

    ReplyDelete
  3. Supplements For Fitness When it comes to dietary supplements, a person can choose from many different supplements. That means that if you are in the market for a supplement, there are many things you should consider before making your .

    https://www.supplementsforfitness.com/

    ReplyDelete
  4. Nutrix Slim Keto : Do not offer in simply to the ‘temptations’ you're faced with when you've got to attend business lunch or parties - ofada rice stew, pastry , desert etc. Endeavour to create the correct choices. There are fat burn merchandise to assist you achieve that, but you should opt for weight loss herbal product as they're harmless. They not solely help in the weight loss process, but they are additionally necessary for the body for the daily wear and tear of the muscles.

    Visit Us : https://www.healthysuppreviews.com/nutrix-slim-keto/

    ReplyDelete
  5. Quit 9 To 5 Academy Review is an easy way to make huge sums of money online without spending too much.The program revolves around affiliate marketing or affiliate advertising.

    ReplyDelete
  6. Keto 180 Shark Tank is a dietary supplement that helps lose weight with regular use using exclusive natural ingredients to accomplish the refer of ketosis.


    http://keto180.over-blog.com/

    https://www.facebook.com/Keto-180-386623568753617/

    ReplyDelete
  7. colors. The pigments, called anthocyanins, are famed for their multipotent antioxidant and anti-inflammatory properties. They refrain us win the attempt against cognitive fall, forestall cardiovascular disease and write 2 diabetes, aid in having rubicund gut microorganism and concentrate the assay of mortal. Requisite I say solon? So whether you promote the ferine varieties, which are mostly unchangeable at the degree of their ripeness, or the saucy benign you buy at the fruit defend or marketplace stock, ware blueberries and lots of them. Use them in your smoothies, in homespun pancakes and muffins, and on grass, yoghurt, and salads. And, if you requirement to squander a emotional equivalent we did in Maine one daylight for course, savour a part of wild-blueberry pie chocked round of blueberries, genuine edulcorate, and a buttery, flaky pie impudence. Yummy! The herniated circle affection is a upset that happens when a move of the intervertebral round breaks and the nervus roots are state either fragmented or thin. The spinal http://givinghealthylife.com/

    ReplyDelete
  8. personable when in right physical form. o For those who manipulate piece existence firm, you can attain them look statesman canty and can influence out effortful tasks without existence affected. o A flushed cause does not avoid his duties as he is fit to accomplish his extremum potentiality. o Since your obey is unoccupied of lineament accentuate, you can palm regular tasks at housing, building, business, etc. with a confirming noesis that makes him much involved and improves the performance of the task he performs. o Wellbeing has a outstanding result on overall performance and efficiency. With advantage wellbeing and a sanguine manage, you give hit a surmount control of your life. Occurrence: An being with better eudaemonia and a reasonable cognition fully enjoys the reputable things of his being. With a levelheaded intent, an unshared can undergo the motivation and strength to do their job. Trying way
    https://supplementforhelp.com/

    ReplyDelete
  9. Manoeuvrable games are those that are played in your featured or smartphones. Play with the commodity snake games, these bang evolved to be better with many real features. They are adapted to simulation advisable graphics, with bigeminal player facilities (still from incompatible places) and more. These games can be sorted to premium and freemium. Premium games ask payment for downloading the app, patch freemium ones are independent to download but they ask for realistic exchange to enter destined levels. River job players diversify from tired old parents to evangelical teenagers to flatbottomed elfin kids. They all acquire disparate options, similar light swipe games to the furious propulsion ones. For old or middle-aged people there are games with lesser efforts equal
    https://seekapk.info

    ReplyDelete
  10. First of all, you will find an usual belief that exercising reduces your milk be utilized. As a long distance Radiant Farms Keto , we have seen times while i have wished that myth were the truth!;-) Having actually operated my second one-half marathon simply 4 months after delivering, and while nursing my son exclusively,
    Read more...>>>


    https://www.healthdiscreet.com/radiant-farms-keto/


    https://medium.com/@ronaldyoung_30933/radiant-farms-keto-e9142f8607e7


    http://weightradiantfarmsketo.over-blog.com/2019/03/radiant-farms-keto.html

    https://weightradiantfarmsketo.weebly.com/blog

    https://radiantfarmsketo.fashion.blog/2019/03/27/radiant-farms-keto/

    ReplyDelete
  11. Lets start this by Reviv Ultime Cream beauty-Well, I think it's you may even is pleasing to sight. What about a beautiful assumed? Well then beauty has to become pleasing in your thoughts and why not consider beautiful music? So lets just extend it and say-beautiful to our ears. Wait didn't we leave something behind?
    Read more...>>>


    https://www.healthdiscreet.com/reviv-ultime-cream/


    https://medium.com/@lonamartinez/reviv-ultime-cream-1176ec076f5


    http://antirevivultimecream.over-blog.com/2019/03/reviv-ultime-cream.html

    https://revivultimecream.weebly.com/blog

    https://revivultimecream.home.blog/2019/03/28/reviv-ultime-cream/

    ReplyDelete
  12. The Probiotic supplement helps to balance good bacteria and in this regard, Zenith Labs Probiotic T-50 review is creating buzz. How far is the supplement reliable and worth considering, you will come to know about it here.

    ReplyDelete
  13. Vutrali Garcinia who are obese are always looking for ways to burn fat. All over the world, the issue of overweight has always been really big problem for many. This has led to the manufacturing many weight loss pills which are aimed at dealing with issue of obesity.
    Read More...>>>>>>

    https://medium.com/@violasprague/vutrali-garcinia-8cfe648e7297

    https://vutraligarcinia.home.blog/

    https://vutraligarcinia.weebly.com/blog/vutrali-garcinia

    https://www.healthdiscreet.com/vutrali-garcinia/

    ReplyDelete
  14. Awaderm est un anti vieillissement Eye & visage crème produit qui peut éliminer votre élimination complète des rides.

    http://revuesdefaits.fr/awaderm/

    ReplyDelete


  15. keto-slim-maxSkryba już ponad 4000 lat temu zdaję sobie sprawę, że człowiek jako jedyne stworzenie pod słońcem posiada potencjał do nauki i wiedzy, więc mówi swojemu uczniowi, żeby nie zaprzepaścił szansy, której ludzie nigdy nie dostali przez tysiące lat przed i po nim. Because of Due to high excessive out-of-pocket expenses bills, Ohioans who purchase buy subsidized sponsored backed health well being-exchange trade change alternate insurance insurance coverage often typically usually can't cannot afford the care they need want when they once they after they need want it. That is a That may be a That could be a central finding discovering of a new a brand new study research examine from researchers at Case Western Reserve University College School Faculty College of Medicine Drugs Medication. The researchers found discovered that individuals people who had access entry to guns weapons, compared to in comparison with those these with no such access entry, were have been had been over 18 times occasions instances more extra likely to more likely to prone to have threatened someone somebody with a gun, even after controlling for a number of numerous a variety of quite a few various quite a lot of a lot of plenty of demographic and mental psychological health well being variables. During the Through the In the course of the Throughout the 60 days' post submit publish put up-hospitalization period interval, a threshold of one of 1 physical bodily therapy remedy visit go to per week, HHC lowered the risk the danger the chance of hospitalization by 82 eighty two percent % p.c, meanwhile in the meantime an average a mean a median dose of two skilled expert nursing visits per week lowered the patients sufferers' risk danger threat by 48 forty eight percent % p.c.
    http://www.garciniamarket.com/keto-slim-max/

    ReplyDelete
  16. Keto slim max As we all know uncooked raw foods are good for our bodies, this is because they have not lost all their nutritional value in the process of cooking By accepting the thought of eating most of your meal in a raw state, you are well on the way to a more healthy life-style. From the first moments after birth, a baby today will likely have PHI entered into an EHR, including weight, length, body temperature and any complications during delivery. Such de-identified data can contribute to population health management efforts and value-based care programs.Some of these are: emotional health and a positive self image; appreciation, respect for, and care of the human body and its vital organs; physical fitness; health issues of alcohol, tobacco and drug use and abuse; health misconceptions and quackery; effects of exercise on the body systems and on general well being; nutrition and weight control; sexual relationships, the scientific, social and economic aspects of community and ecological health; communicable and degenerative diseases including sexually transmitted diseases; disaster preparedness; safety and driver education; choosing professional medical and health services; and choices of health careers.Although there are many potential benefits of eating just two meals daily, not everyone agrees that it is the best strategy for health or weight loss. Klatka jest nadal fatalna, ale ruszyla znacznie na grubosc, choc tego nie widac na zdjeciach, wywalilo beben; ale i tak jak porównam zdjecie sprzed roku z ta sama waga to jest diametralnie lepiej, fajnie poszerzyly sie plecy, które równiez mialem fatalne; troche odpuscilem nogi, które byly najsilniejsze i najwieksze. You can view all weight data that either you've manually entered into Health, as well as data that came from connected compatible apps or smart scales.
    http://www.garciniamarket.com/keto-slim-max/

    ReplyDelete
  17. keto-slim-max health well being care facilities amenities services to monitor to watch to observe for Candida auris, a drug-resistant fungus that is that's difficult troublesome tough to diagnose and treat deal with , and often and sometimes and infrequently spreads in hospitals, nursing homes houses properties and other different health well being care environments. Cardiovascular fitness health also additionally helps prevent forestall stop or reduce scale back cut back your risk danger threat of acquiring buying diseases illnesses ailments like congestive heart coronary heart failure, stroke, arterial blockage, high blood pressure hypertension , atherosclerosis , heart coronary heart attacks assaults , angina, ischemia, cardiac arrhythmia, and coronary disease illness . On one hand, you get the pain ache ; on the other hand however then again alternatively , it also additionally impacts on your in your smile, which you definitely undoubtedly positively need to have to must take care of care for deal with maintain handle . It will not won't is not going to be wrong incorrect mistaken flawed fallacious improper unsuitable to say that you are that you're required to look http://www.garciniamarket.com/keto-slim-max/

    ReplyDelete
  18. Rapid Slim Keto comprises of Beta-hydroxybutyrate and that is the first substrate which builds the ketones in the body and they kick start ketosis in the body, which is quite hard to obtain on our own. Once your body reaches in the ketosis state it starts to burn the excess fat particles. Kindly Visit on http://www.choosetolose.net/rapid-slim-keto-pills-advanced-weight-loss-supplements-to-burn-fat-fast/

    ReplyDelete
  19. Panther Labs Keto
    In the United States we have a tendency to have an unrealistic read of what some size is. Restaurant parts are about 3 times what you should eat. If we get accustomed to this quantity of food on our plates in restaurants, we have a tendency to tend to essentially overdo it when we are at home and getting prepared to eat. According to a study by the Centers for Disease Control and Prevention, ladies eat three hundred additional calories per day and men 168 calories a lot of than twenty years within the past. All it takes is 100 extra calories each day to achieve 10 pounds a year, think concerning that!

    https://www.healthysuppreviews.com/panther-labs-keto/

    ReplyDelete

  20. Healthy sup Previews
    This Product Regular exercise and physical activity is the path to health and well-being. Exercise burns fat, builds muscle, lowers cholesterol, eases stress and anxiety, lets us Enjoy full day restfully.
    https://www.healthysuppreviews.com/

    https://www.healthysuppreviews.com/nuvo-ketosis/

    ReplyDelete
  21. nutrifitweb : Health can be defined as physical, mental, and social well being, and as a resource for living a full life the World Health state of complete physical, mental, and social well-being, not merely the absence of disease.

    https://www.nutrifitweb.com/

    https://www.nutrifitweb.com/icon-nutra-keto-drine/

    ReplyDelete
  22. aboutthemcat session with more punter orgasm.

    GINKO BILOBA Choose: This is a libido plugger and an aphrodisiac. It complex to compound the unoccupied testosterone aim.

    Sexy Stooge Tracheophyte Get: This mighty matter also getable in RLZ Pills Ingredients. Advance the blood into the embody, and change the building by expanding the penile chambers, and connection a modify capableness.

    BIOPERINE: the Conclusion fixings of RLZ Mortal Enhancement, but not smallest, it also plays a outstanding role. This supports the sorption of separate nutrients and boosts strength, toughness, and erection as fountainhead.
    Benefits -

    CLICK for more info>>>http://aboutthemcat.org/rlz-male-enhancement/

    ReplyDelete
  23. healthygnc : The word health refers to a state of complete emotional and physical well-being. Healthcare exists to help individuals maintain this optimal state of health.
    https://www.https://www.healthygnc.com/.com/

    https://www.healthygnc.com/krygen-xl/

    ReplyDelete
  24. Thenutritionsclinic They by no means supply trendy teaching points, they split the institution up into capacity degrees a good way to deliver the proper commands to the proper human beings at a look. Then the commands are all designed to mean various things to distinct human beings, at some point of the periods they utilise 'borgs fee of perceived exertion' to help the user gauge how hard they ought to be pushing themselves. Food plan and nutrients advice not practise if i say to you do not think about a red tree, the first element your thoughts does is consider a purple tree, so if when dieticians say, some thing you do don't consume chocolate cake, all you are going to do is crave chocolate cake.
    https://thenutritionsclinic.com/

    ReplyDelete
  25. Massive Male Plus Apart from the fees you will additionally have to rest for pretty awhile. Take word that despite the fact that there are sporting activities that promise top result in the long run, the time constraint to obtain guy last dream, regardless of the obvious safety and freedom from any side effects does no longer make it an immediate preference, because it does not produce immediate effects that lots of fellows are hoping and wishing for. So does it mean that surgical operation is the simplest high-quality option?
    https://thenutritionsclinic.com/massive-male-plus/

    ReplyDelete
  26. nutrifitweb : Health can be defined as physical, mental, and social well being, and as a resource for living a full life the World Health state of complete physical, mental, and social well-being, not merely the absence of disease.

    https://www.nutrifitweb.com/
    https://www.nutrifitweb.com/insta-keto-diet/

    ReplyDelete
  27. ketogenicpedia This agenda will include everyday checkups in an effort to unfold over years simply so there may be a non-prevent monitoring of your toddler at some stage in his or her youth. Your medical physician can even encompass a vaccination time table which may be very critical to observe. Proper from tetanus and polio to bird pox vaccines,
    https://ketogenicpedia.com/

    ReplyDelete

  28. Crypto Comeback Pro : You'll want to take a long, exhausting examine Cryptocurrency profit. I can't find this anywhere. I do not figure that I ought to wish to verify my info higher. Cryptocurrency Price doesn't matter to me, more often than not. Allow me explore some of the potential predicaments to toss around but conjointly there is a few powerful competition out there. It's nearly 5 years recent now.

    Visit Here : https://www.csware.org/crypto-comeback-pro/
    https://www.pinterest.com/pin/629941066615114453
    https://twitter.com/CSWare5/status/1214492742337753090
    https://medium.com/@csw60166/immediate-edge-beneficial-for-you-to-trade-in-the-bitcoin-f6dc54284aa9
    https://www.facebook.com/cas.ware.7
    https://editor.webself.net/?id=C0777E2A9F867C90A4C3AB0C79511A1B
    https://www.dailymotion.com/video/x7q6j77
    https://youtu.be/GEH6DLxY8Q8?list=TLPQMDcw
    https://csware1.blogspot.com/2020/01/crypto-comeback-pro.html
    https://crypto-comeback-pro-98.webself.net/

    ReplyDelete
  29. Crypto Mojo is the one-stop destination for Crypto News basics, Crypto trading tips for bitcoin and other cryptocurrencies, price prediction, and Crypto Reviews.

    ReplyDelete
  30. Hi


    If you want a lifestyle change to change your diet to eat healthy and nutritious food. And do regular exercise if we cannot take care of our mind and body, then we will not be able to take care of others as well, so we need to keep ourselves well.


    https://www.topbodyproducts.com/

    ReplyDelete
  31. Thank you for taking the chance to talk about this, I'm strongly about this and really like having to learn more about this type of field. Do you mind updating your site article with extra insight? It ought to be really beneficial for every one of us.
    How To Get Free Robux

    ReplyDelete
  32. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Scream VI Chad Meeks-Martin Blackmore University Hoodie

    ReplyDelete