많은 PDF 파일을 3000 개 정도의 파일로 병합하려고합니다. 많은 시도 후에,이 스크립트는 트릭을하는 것처럼 보였습니다. 우리는 각각의 병합 목록에서 3000 PDF 파일이 있기 때문에Bash PDF 병합 파일이 누락 됨
문제가#!/bin/bash
basepath='/home/lemonidas/pdfstuff';
datename=`date "+%Y%m%d%H%M.%S"`;
start=`date "+%s"`;
echo "parsing pdf list to file..."
find $basepath/input/ -name "*.pdf" | xargs -I {} ls {} >> $basepath/tmp/biglist$datename.txt
split -l 3000 $basepath/tmp/biglist$datename.txt $basepath/tmp/splitfile
rm $basepath/tmp/biglist$datename.txt
echo "deleting big file..."
echo "done splitting!"
declare -i x
x=1
for f in $basepath/tmp/splitfile*
do
linenum=`cat $f | wc -l`;
echo "Processing $f ($linenum lines)..."
# merge to one big PDF
cat $f | xargs gs -q -sstdout=$basepath/error.log -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$basepath/output/$x.big.pdf 2>$basepath/error.log
echo "Completed PDF $x"
((x++))
# delete the list file
rm $f
echo "Deleted processed file $f"
done
end=`date "+%s"`;
echo "Started: $start"
echo "Finished: $end"
, 나는 ((마지막 제외) 각 출력 파일이 6000 페이지이어야한다 22000이 페이지의 PDF 파일을 가지고 (물론 내가 잘못했다) 파싱하기 전에 "wc -l"에 의해 검증 됨), 나는 단지 약 658 페이지 정도를 얻는다.
Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
This file had errors that were repaired or ignored.
The file was produced by: >>>> Powered By Crystal Please notify the author of the software that produced this file that it does not conform to Adobe's published PDF specification.
반복 (그러나 22000 번 생각이)
내가 300-400 파일을 시도, 그것은 원활하게 실행,하지만 때
오류는 GS하여이 제외보고되지 2.5 시간이 지난 후에 전체 파일을 실행 해 봅니다. 병합 된 파일의 절반보다 훨씬 적습니다.
내 다음 생각은 .pgm 파일의 각 2 페이지 PDF를 변환하는 것이지만 PDF로 다시 작성하는 방법을 모릅니다 (글꼴 포함 문제가 발생하지 않도록). 내가 빠진 것이 있습니까? (아마도)
+1 pdftk advice – mouviciel
GS 8.61을 사용하고 있습니다. 프로세스가 중단되면 적어도 오류를보고하기를 바랍니다. 나는 pdftk로 시도하고 다시보고 할 것이다. 감사! – lemonidas
8.61은 매우 오래되었습니다 (거의 5 세가되었습니다), 현재 버전은 9.06 – KenS