If you would like to convert an epub file to pdf in Linux, you can use calibre.
First install it using
sudo apt-get install calibre
and then you should be able to use it to convert the file like
ebook-convert file.epub file.pdf
If you would like to convert an epub file to pdf in Linux, you can use calibre.
First install it using
sudo apt-get install calibre
and then you should be able to use it to convert the file like
ebook-convert file.epub file.pdf
Problem
You have multiple pdf pages and you want to combine them into one file.
Solution
Use pdftk to combine them into one file like:
pdftk page1.pdf page2.pdf page3.pdf cat output combined_file.pdf
Problem
You have a pdf file with sensitive information and you want to protect it with a password.
Solution
Install the pdftk if you haven’t already in your system:
sudo apt-get install pdftk
And then run the following to prompt for a password before opening the file:
pdftk original.pdf output pswd_protected.pdf user_pw PROMPT
Problem
You have multiple scanned images as pnm files, and you would like to convert them to a single pdf file.
Solution
If you have imagemagick installed you should be able to use the convert as follows to combine the images to one pdf file:
convert image1.pnm image2.pnm image3.pnm output.pdf
Problem
You want to generate pdf documents in your Ruby on Rails app using .doc templates.
Solution
Open the .doc document in OpenOffice and save it as an Open Document Format (.odt).
Open the saved .odt document and export to pdf, making sure you use ‘Losless compression’ in the General Options section.
Use imagemagick’s convert to make the pdf file to an image (setting the density to your requirements – default is 72dpi):
convert -density 150 one.pdf one.png
Copy the image one.png to your rails image directory (public/images).
Use the image as a background to the pdf created by prawnto (install plugin if you don’t have it) with:
templ=”#{RAILS_ROOT}/public/images/one.png”
pdf.image(templ, {:position => :center, :vposition => :top, :scale => 0.215})
Put the database field(s) text on position (you’ll have to play around with the coordinates to get it right), like:
pdf.font “#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf”, :size => 9
pdf.text “#{@model_name.fielda_name}”, :at => [100,530]
pdf.text “#{@model_name.fieldb_name}”, :at => [100,510] …
Problem
You have a lot of ps files and you want to combine them into a single pdf file with multiple pages.
Solution
You can use Ghostscript:
gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.ps in2.ps in3.ps