Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Merge files into a single pdf

  1. #1
    Join Date
    Dec 2007
    Location
    Hyderabad, India
    Beans
    35
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question Merge files into a single pdf

    1. I have several image files accumulated as a result of taking screenshots. I want to merge all of them into a single pdf file. How can I do that?
    2. I save webpages in .mht format using UnMHT addon in firefox. Is there any way to merge several mht files into a single pdf?

  2. #2
    Join Date
    May 2008
    Beans
    40

    Re: Merge files into a single pdf

    One way to put several images into one PDF would be to put them in an Open Office document and export the PDF.
    I know that's probably not what you are looking for but it is an option.
    There are several PDF programs in the Ubuntu Software Center have you not had any luck with them?
    As for printing the .mht files:
    Install cups-pdf from Synaptic and you should be able to print them out as PDF's and combine them into 1 PDF in another PDF program. You could probably do this with the screenshots too.

  3. #3
    Join Date
    Dec 2007
    Location
    Hyderabad, India
    Beans
    35
    Distro
    Ubuntu 12.04 Precise Pangolin

    Talking Re: Merge files into a single pdf

    The option provided by you regarding printing mht files is quite ok but however if there is some option to print all mht files together which is accumulated as a result of few months of work it would be nice. Such a thing would be possible with Adobe Acrobat but I am looking for a solution in ubuntu exclusively.

  4. #4
    Join Date
    Nov 2006
    Beans
    89

    Re: Merge files into a single pdf

    You can do this with convert (ImageMagick) and pdftk (both of which have convenient ubuntu packages).

    # To convert an image to a pdf file suitable for building a pdf

    convert image.png image.pdf

    # To split a PDF file into individual pages (each as a PDF file)
    pdftk original.pdf burst output burst_%04d.pdf

    # To merge pages representing PDF files back together

    pdftk burst_0001.pdf burst_0002.pdf burst_0003.pdf output final.pdf

    Note: they don't have to be individual pages, and you can also stamp an overlay image on top of a PDF if you want to (I looked this stuff up so I could stamp semi-transparent highlighter mark images onto a PDF).

    ps. Sorry, didn't notice you were staring with mht files. convert can't handle them, but there seem to be plenty of ways to convert them to images:

    http://html-to-image.acasystems.com/...t-to-image.htm
    Last edited by kikazaru; September 19th, 2010 at 03:34 AM.

  5. #5
    Join Date
    Oct 2010
    Beans
    4
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Merge files into a single pdf

    I have the same problem. I need to merge pdf files. I generally use the code

    Code:
    gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf ...
    However, I have a lot of files, named as 0001_something.pdf, 0002_somethingelse.pdf,...,0900_somethingdifferent .pdf.

    Any thoughts?

    ps: Thanks for the pdftk tip. I found some examples in the pdftk page where I could some my problem.

    Cheers!
    Last edited by LeoBastos; October 4th, 2010 at 04:45 PM. Reason: I found a solution to my specific problem.

  6. #6
    Join Date
    Feb 2008
    Beans
    1

    Re: Merge files into a single pdf


  7. #7
    Join Date
    Aug 2008
    Beans
    89

    Re: Merge files into a single pdf

    Quote Originally Posted by babis79 View Post
    yeah! Definitely!

  8. #8
    Join Date
    Dec 2008
    Beans
    117

    Re: Merge files into a single pdf

    Hi,

    pdftk works really well turning many pdfs into one pdf. It works from the terminal, and you can install it like this:

    sudo apt-get install pdftk

    Now to combine multiple pdfs you do this from the terminal:

    pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf

    or every pdf in a directory like this:

    pdftk *.pdf cat output all.pdf

    You can check out pdftk here:
    http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

    Good luck, Ken
    Ubuntu 18.04 LTS
    Registered Linux User: #486660

  9. #9
    Join Date
    Dec 2009
    Location
    San Francisco
    Beans
    6
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Merge files into a single pdf

    question 1:
    cd (navigate within the terminal) your way to the folder holding the .pdf files

    use this command
    pdftk *.pdf cat output merged.pdf

    'merged.pdf' is where you name the file. You can write:

    pdftk *.pdf cat output book01.pdf

    or whatever.

    Two sources carry this info, and the TLD's (top-level domains) are useful for handy BASH commands:
    http://ubuntuhowtos.com/howtos/merge_pdf_files
    &&
    http://maketecheasier.com/combine-mu...ftk/2010/02/22

  10. #10
    Join Date
    Dec 2009
    Location
    San Francisco
    Beans
    6
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Merge files into a single pdf

    Question #2:
    Try--

    html2ps $mht; lpr $s -P PDF

    Navigate to the desired directory, and run the command.

    I've never tried this. I have not tested html2ps with .mht files, but try it.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •