Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In my Ubuntu Server 12.04, I am converting all .docx files under a directory to .pdf files with this command:

libreoffice -headless -convert-to pdf:writer_pdf_Export *.docx

Can I merge multiple documents and convert them to single .pdf file like this?

For example:

file1.docx
file2.docx
file3.docx  

And the output should be one .pdf file like merged_result.pdf. I have to do it from Terminal because I'm using it in PHP.

Furthermore, can I add picture like front image? Any kind of source I can get the Terminal functions for LibreOffice is appreciated, too; I was unable to find what I'm looking for.

Thanks in advance.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Maybe you could use an additional tool, like pdftk for instance, to do the merging part. You could then chain the two commands; the first one with Libreoffice, the second one with pdftk.

share|improve this answer
    
I just was wondering if I could solve it with only one comment/plugin. Thanks, I tried pdftk and it's working good(I tried .docx, .xlsx and .jpg so far). One more question, do you know a way to add line numbers? Neither using LibreOffice nor pdftk. –  kubilay Jun 23 '12 at 20:54
    
No I don't. Please consider opening new question. By the way, I think I should say this to you: don't forget to upvote good answers, eventually in addition to marking as accepted. I see that here on Stack Overflow you barely do it. It gives points to the answerer, which is an indicator for community trust and a mean to get more privileges on a Stack Exchange website. Do you see what I mean ? –  Agmenor Jun 23 '12 at 21:12
    
sure, thanks for your help. –  kubilay Jun 23 '12 at 21:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.