2012-09-25 2 views
2

제 친구가이 질문을하고 있는데, 맥을 사용 중이며 PdfLatex가 작동하지 않습니다 (dev cd가 없으면, here). 어쨌든 내 첫번째 생각 :Unix : PDF 파일과 이미지를 PDF 파일로 결합 하시겠습니까?

  • $ pdftk 1.pdf 2.pdf의 3.pdf 고양이 출력 123.pdf [에만 PDF 파일]
  • $가 2.png의 myfile.pdf 을 1.png 심자 [이미지 만]

는 지금은 이미지와 PDF의 -files을 결합하는 방법을 라텍스 또는 iPad의 노트 플러스없이 모른다. 그렇다면 유닉스에서 pdf 파일과 이미지를 어떻게 결합 할 수 있습니까?

+0

감사합니다. 대답은 Apple 기본 명령 줄에 있습니다. http://stackoverflow.com/questions/4778635/merging-png-images-into-one-pdf-file-in-unix –

답변

1

PDFM과 이미지를 식별하고 ImageMagick을 사용하여 이미지를 PDF로 변환 할 수 있습니다. 작업을 마치면 pdftk로 모든 것을 조합합니다.

이것은 Bash 전용 스크립트입니다.

#!/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[@]} 
1

일부 정보를 수집 중입니다.

유닉스 명령 줄 Pdftk here에 대한

  1. 더. 맥

  2. Merging png images into one pdf file

  3. Combine all files in a folder as pdf

애플 SE의 중재자 "PDF 파일 및 이미지를 하나의 PDF로 병합 유용한 스레드를 제거하기 때문에 Mac에서 파일? " here - Mac 용 도움말을 수집합니다. 미안하지만 중재자는 초보자 용 자료 수집에 대해 매우 용납하지 않습니다.

  1. https://apple.stackexchange.com/questions/16226/what-software-is-available-preferably-free-to-create-and-edit-pdf-files-on-mac

  2. https://apple.stackexchange.com/questions/812/how-can-i-combine-two-pdfs-in-preview

  3. https://apple.stackexchange.com/questions/11163/how-do-i-combine-two-or-more-images-to-get-a-single-pdf-file

  4. https://apple.stackexchange.com/questions/69659/ipad-pdf-software-to-edit-merge-annotate-etc-well-pdf-documents-like-in-deskto

0,123,516
관련 문제