Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:38:25+00:00 2026-06-11T22:38:25+00:00

My friend is asking this question, he is using Mac and cannot get PdfLatex

  • 0

My friend is asking this question, he is using Mac and cannot get PdfLatex working (having no dev CD, related here). Anyway my first idea:

  • $ pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf [only pdfs]
  • $ convert 1.png 2.png myfile.pdf [only images]

Now I don’t know without LaTex or iPad’s Notes Plus how to combine images and PDF -files. So how can I combine pdf -files and images in Unix?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:38:26+00:00Added an answer on June 11, 2026 at 10:38 pm

    You could run a loop, identifying PDF and images, and converting images to PDF with ImageMagick. When you’re done, you assemble it all with pdftk.

    This is a Bash-only script.

    #!/bin/bash
    
    # Convert arguments into list
    N=0
    for file in $*; do
            files[$N]=$file
            N=$[ $N + 1 ]
    done
    # Last element of list is our destination filename
    N=$[ $N - 1 ]
    LAST=$files[$N]
    unset files[$N]
    N=$[ $N - 1 ]
    # Check all files in the input array, converting image types
    T=0
    for i in $( seq 0 $N ); do
            file=${files[$i]}
            case ${file##*.} in
                    jpg|png|gif|tif)
                            temp="tmpfile.$T.pdf"
                            convert $file $temp
                            tmp[$T]=$temp
                            uses[$i]=$temp
                            T=$[ $T + 1 ]
                            # Or also: tmp=("${tmp[@]}" "$temp")
                    ;;
                    pdf)
                            uses[$i]=$file
                    ;;
            esac
    done
    # Now assemble PDF files
    pdftk ${uses[@]} cat output $LAST
    # Destroy all temporary file names. Disabled because you never know :-)
    echo "I would remove ${tmp[@]}"
    # rm ${tmp[@]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Asking this question for a friend of mine. My client had send me a
After asking this question, I started using Sinatra as a way to serve web
I have this code I been working on but I'm having a hard time
One of my friend was asked this question in an interview - You have
Sorry for asking such a general question but this has been bugging me for
I am asking this question because I am a beginner and I've read almost
Firstly apologies for the length of this question, and for asking about the Facebook
I'm using this to send an invitation from a user to his friend with
I am asking this question primarly to learn. Let's say I want to send
First, I know this question doesn't exactly belong here, but I'll explain later why

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.