For some reason, this is way harder than it should be. I thought I would be able to find a simple ‘pdf stitcher’ software in the Software Centre and just put them in there, arrange them and then export to PDF – with a password. I think this used to be possible with PDF Sam but anyway. This tutorial will hopefully be a long term and reliable way that we can do this in a pinch from any machine.
This is all terminal based so get ready to pump up your terminal skills.
1. Stick PDFs in a Dedicated Folder
Assemble into one directory all the PDFs you plan to stitch together and wrap up with a password. I think the command will only work if they are in one place so this step is important.
2. Install PDFTK
sudo apt install pdftk… I think… but you might need some other package these days… remind me in comments if this is wrong 🙂
3. Go to your PDF directory
Using the CD (change directory) command, navigate to the directory you made in step 1.
4. Run the Command for One Page Only.
This is the basic format for PDFTk showing one file being output with a new name and a password
pdftk [mydoc_old].pdf output [mydoc_new].pdf user_pw [awesomepasswd]
In this case you”ll swap out the filenames accordingly.
*Special note! do not put the square brackets in there. those are just to show you what needs to be swapped out. I actually did this and wasted a lot of time (lol)
Also, take note of this, you ‘might’ get a warning that the PDF has a user password and you can’t do these tasks because you don’t know the owner password. It seems banks do this on their bank statements, which is funny, because they don’t supply a secure way to send banking documents to them and ask me to email…
Error will look like this if you need to work around it:
has set an owner password (which is not required to handle this PDF).
You did not supply this password. Please respect any copyright.
I found a nice work around to stick it to these bankers which is to use the Ubuntu ‘print’ (ie. printing to your printer) and then change from your printer to ‘print to file’. Side note: If you didn’t know about this built in and super easy PDF feature and you only need to do one PDF at a time and no encryption, this is the way to do it.
The output PDF from this method seems to strip away any of the ‘owner password’ annyoyances. Hint: this is also a good time to rename your individual pdfs to a number in the order you want them to appear in the final merged PDF. I do 001, 002, 003 during this phase making the next section way, way easier.
5. Run the Command for Merging Multiple PDFs
The process is the same as above, but now that you have your folder full of 001, 002, 003 numbered files, here is what you do:
pdftk .pdf .pdf [003.pdf] output [mydoc_new].pdf user_pw [awesomepasswd]
Once you hit ‘enter’ a new file will appear in the same directory with name ‘mydoc_new.pdf’ and will have 001, 002, 003 in it and be locked behind the password ‘awesomepasswd’.
Pretty handy especially when you have to deal with ‘owner passwords’ in the PDF.
Hope this helps!
Ubuntu is by far the best operating system in existence. One of the things that hasn’t been broadcast around much is how Ubuntu is also awesome for business.
If you run a business (or work in one) you will know that PDF files are one of the most standard documents that you work with, or would like to work with. Here is a bullet proof list of things that I’m always dealing with and that Ubuntu solves:
- people sending .jpg or .tiff or .png files instead of PDFs (unprofessional but a reality)
- PDF files being way too big which is unfair to bandwidth, especially if someone will be downloading on a mobile (good percentage chance)
- I need to split a bunch of pages, do something, and then glue them back together again and I don’t want to print it all and scan it
- I need to watermark or stamp a PDF with something
- I need to create a PDF from a word processing document or spreadsheet
These are just some of my regular issues, but great news! All of them will be solved for you in this post, once and for all, and for free.
How to Compress a Big PDF File Without Killing the Quality
This one took me a while, but all you have to do is:
- open a terminal (if you don’t know how, click here)
- Navigate with the terminal to where your over-sized PDF file is (If you don’t know how, go to the section on “File & Directory Commands” on this page.)
- In the gobbly-gook that is sitting in step #4 below, change the ‘OUTPUTFILENAME’ to the name you want the resulting file to be named and the INPUTFILENAME to the name of the file that is too big and is sitting in the directory you just navigated to.
- copy this gobbly gook into your computer clipboard AFTER doing step #3 to it. I would recommend pasting it to a separate text editor (like body of an email) first, do your changes, and then re-pasting it to the terminal) : gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=OUTPUTFILENAME.pdf INPUTFILENAME.pdf
- Copy your updated version of the gobbly-gook to the computer’s clipboard
- Paste it to the terminal with this *different* version of control V. If you use the normal paste, it won’t work. Do this: control + Shift (same time) then press ‘v’ and it will paste to the terminal.
- press the enter key and the process will run
You should now have a smaller PDF file that didn’t lose too much quality. There are other versions of this command above which I found killed the quality too much. This one was great for me.
How to Convert a .jpg or a .tiff or a .png File to a PDF File
- Open a terminal (if you don’t know how, click here)
- Navigate with your terminal to where your .jpg or a .tiff or a .png files are (If you don’t know how, go to the section on “File & Directory Commands” on this page.)
- type ‘convert’ and then start typing the name of the file you want to convert. *TIP: after you start typing the file name, you can press ‘tab’ and it will auto fill. If it doesn’t completely auto fill it means there is another file name there similar so you have to type a few more letters and then ‘tab’ again. This saves much time and errors.
- start typing the name of the file you want the newly created PDF to be named. Likely it will be the same as the photo name which is great and convenient because you can use the same TIP above with the tab button and it will auto-fill it quickly. Caution: if you use auto-fill make sure you change the last three letters to ‘.pdf’ so that it will actually open as a pdf!
- Here is what an example command will look like before you press enter: convert photo_document.png photo_document.pdf
- Press enter
If you know how to do basic terminal navigation, this is truly a lightening fast process and super useful. That said, there is probably a light conversion app out there that does this on Ubuntu and I’d like not to use the terminal if possible so please share
How to Take a Multi-Page PDF File and Split Them into Individual Files
- go to the Ubuntu software center search and get “PDF Sam”
- Use the ‘split’ feature
- Mess around with all the options (I don’t have time to do a full tutorial here)
How to Take a Multi-Page PDF File and Split Them at a Certain Point in the File
- go to the Ubuntu software center search and get “PDF Sam”
- Use the ‘split’ feature
- Make sure you choose the ‘split after these pages’ and the file will ‘cut’ right there. I haven’t tried it but I bet you could put a comma in there after each page number you want to split at and split a whole series of pages….
How to Watermark or Stamp or Batch Adjust Multiple Pages on a PDF in 10 Easy Steps
How to Rotate All Pages in a Multi Page PDF File
I wrote this tutorial earlier for this one here.
How to Turn Anything You Can Print into a PDF Document (ie. Emails, web pages, etc)
I wrote this tutorial earlier for this one here.
So you have a Microsoft Windows computer. You finally realize that the reason you have no hair on your head is because you pulled it all out at your computer. It is full of viruses, malware, and a host of other programs attempting in vain to stop these from making their home on your machine. Also, you heard the news that Windows is fully compromised and that none of your data is safe so long as you are using a Windows machine.
You are ready for a change, but you don’t know what to do, or the person who suggested this to you is far away from you and unable to drop by your place to make it happen.
Don’t worry. That’s what this blog post is about.
Since you may need to be completely offline, or without a second computer to read this tutorial on, you may want to print this guide. The only part not available currently is the video in step 6.
>>PRINTABLE PDF VERSION OF THIS GUIDE-UPDATED-150117<<
1. Back up the files you don’t want to lose on an external drive
Before you begin, you will need to back up all your photos and other documents from the machine you are about to wipe. This process takes time so it is a good idea to start right away. It is strongly recommended that you purchase a USB drive of however many gigabytes you need to save all your documents. You will be surprised at how small your files are unless you have a lot of videos. For the average ‘simple user’ you can probably survive with an 8 gigabyte drive, but for people with a bunch of videos you will probably need to consider buying a huge external drive of a Terabyte or so. This is a great tool to have regardless because you will use it in the future to do back ups of your computer on. Also, the amount of money you are going to save on virus software when you switch to Ubuntu will pay for your drive many times over over the years! A quick checklist of files you might want to keep:
- emails (if you use an email client like Outlook or Thunderbird): if you have a scary webmail account like hotmail your emails will be sitting unsafely there so you won’t need to back them up
- word processing documents (resumes, letters, legal docs, etc)
- PDFs (ie. invoices, e-bills, etc)
- videos (ie. videos from your phone you dumped there, movies, etc)
2. Obtain a 2 gig+ usb drive
Great! All your files are saved safely on your external drive. Now you need a *second* and *dedicated* drive which will be used for the installation of Ubuntu. Yes, it’s possible also to use a DVD or CD rom but since you may need to adjust things after installing, we have found the USB drive to be the cheapest and most flexible tool over the long term. Plus, you end up with a second USB drive which you can use for transporting files around (one for you, one for the spouse, for example). So, stick with our suggestion ok? The great news is that as of today’s date, you can do this with a 2gig USB drive or less which is either free or *extremely* cheap. In fact, most people you know will have one lying around on their desk they will lend you. Advise them to wipe sensitive data off the drive before giving it to you, of course!
3. Download and install the program called Unetbootin
Go to this website (http://unetbootin.sourceforge.net) and download the appropriate (in the case of this tutorial Windows) version of the software. This software will be used to change your dedicated install drive into one that will boot when you turn your computer on (like a bootable CD rom). Here are two screenshots to make it more simple:
4. Install Unetbootin
Go find that file you just downloaded to your computer. Double click it. Follow all the instructions and give it all the power it needs to get installed. Windows may fight. You fight back!
5. Download the latest Ubuntu from the official Ubuntu.com website
Here is an illustrated step-by-step. Of course if you have money, I encourage you to give some money but it is not mandatory whatsoever. In this example I’m showing skipping straight to the download.
6. Create the Bootable USB Drive Using Unetbootin
So you have your 2gigabyte (or bigger) dedicated USB drive as described in step 2.
You’ve downloaded and installed Unetbootin in step 3 and 4
You’ve now got the ISO file on your harddrive from steps 5
Now you need to make your USB drive think that it is a bootable CD ROM (essentially). Instead of me sending you a bunch of screenshots, just watch this video that Lecture Snippets created because the flow is still exactly the same even though the numbers have changed. Just follow his instructions as he puts his own downloaded ISO image onto his USB drive.
NOTE! Make sure that ALL USB DRIVES EXCEPT YOUR DEDICATED UBUNTU 2GIG+ DRIVE ARE REMOVED FROM YOUR MACHINE. Just check. Trust us.
7. Reboot and make sure your computer BIOS is set to boot first from the USB drive
When Unetbootin is finished, it will give you the option of rebooting now. Likely you did it and didn’t know that you had to go in and change some BIOS settings. No problem. All you have to do is reboot your computer (again) and press the correct keyboard key for your particular computer. In many cases its F12 or F10, etc. Usually you can find this key displayed on the black screen right before your computer boots into your operating system. It only shows up for a few seconds so it may take you several reboots to read the keyboard key you need. What you are looking for is ‘Bios settings’ or ‘Change boot order’ or something like that. It might take you a few tries but you’ll get it. Online search engines will also likely have it if you know your computer mother board model number.
8. Choose the ‘Install Ubuntu’ option when you see the Unetbootin blue screen.
When you end up on the Unetbootin blue screen, this means ‘success’! This means you are so close to finished you can taste it. Great work so far! In this case we are going to wipe away that pesky Windows operating system forever so choose the ‘install Ubuntu’ option. It will start the installation process which is amazingly easy and clean. Just answer all the questions and make sure you have a hard-wired internet connection. If you don’t, you may have to find one. At some point you are going to need to update the operating system so you might as well do it at the same time as your install so you are starting on the right foot.
9. Watch this quick familiarization video
This is a nice quick familiarization tour of your new found joy. Give it a quick watch so you know some basic stuff to get around.
10. Get connected to a local Ubuntu Community!
In the Vancouver area here, there is a big Ubuntu Vancouver meetup group as well as an Ubuntu Delta group. This connection will help you greatly realize the full potential of the Ubuntu Project which is, please note, much more than just an operating system.
Want to read an article later and not use your data plan? Going somewhere and want to look at a website page without worrying about an internet connection? Can’t seem to find the time to read an article in the near future but worry the article might be gone when you get around to reading it? If you are using Ubuntu, you’re already set up for an ultra simple solution to grab ‘n’ go websites.
In my case, I just wanted to take a bunch of articles and read them on my tablet or netbook up at my parents cabin where the internet is either spotty or notty. At first I started downloading Firefox add-ons and this and that but it turns out the most simple and effective solution was sitting there ready to go: the ‘print to file’ option when you print *anything* in Ubuntu. Ubuntu, because it’s just plain awesome out of the box, comes with the ability to print anything to PDF. So, the solution is this simple:
1. Go to the website you want to have as a PDF
2. Choose to print the page (I use the control + P buttons because it’s rocket fast)
3. Choose ‘print to file’ option
4. KEY STEP!! Rename the file now. It defaults to some ‘mozilla’ file name and will remember your last file name so every time you save a new article/page you have to remember to change the name or they will all end up in your last folder with the same name. Makes for an annoying time. NOTE: When you rename the file, do *not* erase the final .pdf tag or the file might have issues.