KTUGFaq
KTUG FAQ
Mind your own business, Spock. I'm sick of your halfbreed interference.
PDF그림포함하기&value=PDFѱå › LittleTree/ReadingTeXbook/2006-04 › KC2008/WhatsNew&value=ġϱ › hoze/HelpOnFormatting › 키&value=NonExistantHelpPage › PDFManipulation
1.1 n-up ¶
ֺ ؼ 迭ϴ , 1x2 up 츦 д.
PDF testin.pdf , testout.tex ۼѴ.
\documentclass[a4paper]{article} \usepackage{pdfpages} \begin{document} \includepdf[pages=-,nup=1x2,landscape,frame=false]{testin.pdf} \end{document}
PDFLaTeX Ѵ.
#> pdflatex testout
pdfpages.sty ϴ \includepdf ̿ϴµ, ʸ ̸ .
\includepdf[nup=1x2,landscape,pages=4-7]{foo.pdf} \includepdf[nup=1x2,landscape,pages=4-7,turn=false]{foo.pdf} \includepdf[nup=2x2,pages=1-4,column]{foo.pdf}
¦ʺ ϴ ϱ Ͽ ó
\includepdf[nup=2x2,pages={{},5-7}]{foo.pdf}
nup
\includepdf[nup=2x2,pages=1-4,frame]{foo.pdf}
Ϻθ trimν header footer ϰ ʹٸ
\includepdf[nup=2x2,pages=1-4, trim= 0 40mm 0 40mm, clip]{foo.pdf}
nup ȣ ̰ ʹٸ
\includepdf[nup=2x2,pages=1-4,pagecommand={\thispagestyle{plain}}]{foo.pdf}
1.3 PDF ʾ ġ ¶
˰ ִٰ Դϴ.
ؼ a.pdf b.pdf , PDF 10̶ ϰڽϴ.
total.tex ۼմϴ.
\documentclass{article} \usepackage{pdfpages} \makeatletter \def\for#1#2#3{\@ifnextchar[{\@for@{#1}{#2}{#3}}{\@for@{#1}{#2}{#3}[1]}} \long\def\@for@#1#2#3[#4]#5{\setcounter{#1}{#3}\addtocounter{#1}{1}% \edef\for@loopend{\arabic{#1}}% \setcounter{#1}{#2}% \loop \ifnum \expandafter\the\csname c@#1\endcsname < \for@loopend\relax #5\addtocounter{#1}{#4}\repeat} \newcounter{repeatcnt} \makeatother \begin{document} \for{repeatcnt}{1}{10}{% \includepdfmerge{a.pdf,\therepeatcnt,b.pdf,\therepeatcnt} } \end{document}
pdflatex total.tex ϸ total.pdf ֽϴ.
Ű澲ð, \includepdfmerge ȿ ڰ иǾ ִٴ Ͻø Դϴ. for Loop ϴ ϴ.
2.1 pdfcrop.pl ¶
Heiko Oberdiek ۼ Perl ũƮԴϴ.
pdfcrop.pl --help ȭԴϴ.
PDFCROP 1.2, 2002/11/04 - Copyright (c) 2002 by Heiko Oberdiek. Syntax: pdfcrop [options] <input[.pdf]> [output file] Function: Margins are calculated and removed for each page in the file. Options: (defaults:) --help print usage --(no)verbose verbose printing (false) --(no)debug debug informations (false) --gscmd _name_ call of ghostscript (gswin32c) --pdftexcmd _name_ call of pdfTeX (pdftex) --margins "left top right bottom" (0 0 0 0) add extra margins, unit is bp. If only one number is given, then it is used for all margins, in the case of two numbers they are also used for right and bottom. --(no)clip clipping support, if margins are set (false) --(no)hires using '%%HiResBoundingBox' (false) instead of '%%BoundingBox' Examples: pdfcrop.pl --margins 10 input.pdf output.pdf pdfcrop.pl --margins '5 10 5 20' --clip input.pdf output.pdf
windows TeX Live 2010 pdfcrop.pl pdfcrop ̶ θ ˴ϴ.
2.2 PDFTeX ۼϴ ¶
from 4284 (by ̰)
ƿƼ PDF ȯ , AdobeIllustrator ѱ Font Ͽ PDF Ϻΰ Ghostscript о ֽϴ. ̷ , .tex ۼϿ PDFTeX ϸ PDF ϴ ũ⸸ŭ ߶ ֽϴ.
ainput.pdf ,
aoutput.tex ϰ մϴ.
\def\pdffile{ainput.pdf} % <-- file ̸ \def\page #1 [#2 #3 #4 #5]{% \count0=#1\relax \setbox0=\hbox{% \pdfximage page #1{\pdffile}% \pdfrefximage\pdflastximage }% \pdfhorigin=-#2bp\relax \pdfvorigin=#3bp\relax \pdfpagewidth=#4bp\relax \advance\pdfpagewidth by -#2bp\relax \pdfpageheight=#5bp\relax \advance\pdfpageheight by -#3bp\relax \ht0=\pdfpageheight \shipout\box0\relax } \page 1 [40 290 552 552] % <-- ȣ BoundingBox \end
#> pdftex aoutput
2.3 ¶
DVIPDFMx ̿Ͽ PDF ϴ. ( pdfcroptestinput.pdf )
#> perl pdfcrop.pl --clip pdfcroptestinput.pdf pdfcroptestoutput.pdfPDF ϴ. pdfcroptestoutput.pdf
3.1.2 ϴ Shell ũƮ ¶
texexec ϴ Shell Script .(Claus Gerhardt )
#!/bin/sh ## # pdfsel.sh # pdfselect # # $1= selected pages either in form of a list x,y,z or in form of range x:y or as odd #resp. even #filenename without suffix pdf, the resulting file is named filename-ext.pdf # Claus Gerhardt ## # EXTENSIONS : "*" # OSTYPES : "****" for file; do location=$(dirname "$file") cd "${location}" && \ texexec --pdfselect --batch --silent --selection="$1" --result="${file}-ext.pdf" "${file}.pdf" \ && rm -f "${file}-ext.tui" && rm -f "${file}-ext.tmp" && rm -f "texexec.tex" \ && rm -f "texexec.tmp" && rm -f "texexec.tui" && rm -f "mprun.mp" rm -f "mpgraph.mp" \ && rm -f "${file}-ext.log" done
3.2.1 Ϻ ¶
7342 (by ̰)
1 10 ϴ .
#!/usr/bin/perl for(1..10) { open(OUT,">test$_.tex") or die "Cannot write 'test$_.tex'"; print OUT << "EOF"; \\documentclass[a4paper]{article} \\usepackage{pdfpages} \\begin{document} \\includepdf[pages=$_]{orig.pdf} \\end{document} EOF close OUT; system("pdflatex --interaction batchmode test$_"); unlink "test$_.tex","test$_.log","test$_.aux"; }
3.2.2 ϴ Shell Script ¶
pdfsel.sh
#!/bin/sh PAGENUM=$1 OUTFILE=$2-ext-$1.tex echo '\documentclass{article}' > $OUTFILE echo '\usepackage{pdfpages}' >> $OUTFILE echo '\begin{document}' >> $OUTFILE echo '\includepdf[pages='$PAGENUM']{'$2'.pdf}' >> $OUTFILE echo '\end{document}' >> $OUTFILE pdflatex --interaction=batchmode $OUTFILE
#> sh pdfsel.sh 13 test
(Է Ȯ .pdf . ù° ڴ Ϸ , ι° ڴ Է. test-ext-13.pdf .)
DOS Batchfile.
@echo off rem pdfsel.bat echo \documentclass{article} > %2-ext-%1.tex echo \usepackage[pdftex]{graphicx} >> %2-ext-%1.tex echo \usepackage{pdfpages} >> %2-ext-%1.tex echo \begin{document} >> %2-ext-%1.tex echo \includepdf[pages=%1]{%2.pdf} >> %2-ext-%1.tex echo \end{document} >> %2-ext-%1.tex pdflatex --interaction=batchmode %2-ext-%1 del %2-ext-%1.aux rem del %2-ext-%1.log del %2-ext-%1.tex
3.3.1 Ϻ ¶
Dz 1ʿ 12ʱ 14ʺ ϴ ̴.
pdftk A=in.pdf cat A1-12 A14-end output out.pdf/(ѱ ϳ?) ϴ.
pdftk A=in1.pdf B=in2.pdf cat B1 A1-7even A1-7odd output out1.pdf
3.3.3 PDF ϳ ¶
ɾ ϸ ȴ.
in1.pdf, in2.pdf out1.pdf
pdftk in1.pdf in2.pdf cat output out1.pdf or pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf*.pdf out1.pdf
pdftk *.pdf cat output out1.pdf
- ó : pdftk --help message
4 Booklet ¶
PDF Booklet̶ ʿ μϿ μ öϸ åڰ ǵ ϴ ̴. PDFPages Ű, \includepdf signature ɼ ̿Ѵ. , signature 4 ǵ ϴ ̴.
11 ¥ PDF ϳ ְ, ̰ åڸ 츦 غ. ̸ doc.pdf ϰ, aout.tex ۼѴ.
%%----------- \documentclass{article} \usepackage[pdftex]{graphicx} \usepackage{pdfpages} \begin{document} \pagestyle{empty} \includepdf[pages=-,signature=12,landscape]{doc.pdf} \end{document} %%------------
Ͽ Ͽ PDFLaTeX ϸ aout.pdf . PDF μϿ öغ.
5 PDF ¶
12845
PDF / Encryption
dvipdfmx.cfg ȳ ִ.
% Permission flag for PDF encryption: Revision will be 3 if the key size % is greater than 40 bits. % % 0x0004 (Revision 2) Print the document. % (Revision 3) Print the document (possibly not at the highest quality % level, depending on whether bit 12[0x0800] is also set). % 0x0008 Modify the contents of the document by operations other than those % controlled by bits 6[0x0020], 9[0x0100], and 11[0x0400]. % 0x0010 (Revision 2) Copy or otherwise extract text and graphics from the % document, including extracting text and graphics (in support of % accessibility to disabled users or for other purposes). % (Revision 3) Copy or otherwise extract text and grphics from the % document by operations other than that controlled by bit 10[0x0200]. % 0x0020 Add or modify text annotations, fill in interactive form fields, % and, if bit 4[0x0008] is also set, create or modify interactive % form fields (including signature fields). % % (Revision 3 only) % 0x0100 Fill in existing interactive form fields (including signature % fields), even if bit 6 is clear. % 0x0200 Extract text and graphics (in support of accessibility to disabled % users or for other purposes). % 0x0400 Assemble the document (insert, rotate, or delete pages and create % bookmarks or thumbnail images), even if bit 4 is clear. % 0x0800 Print the document to a representation from which a faithful digital % copy of the PDF content could be generated. When this bit is clear % (and bit 3 is set), printing is limited to a low-level representation % of the appearance, possibly of degraded quality.
⺻ P 0x003Cε, ̰ 40Ʈ ȼؿ شϴ ̴. 0x0010(Copy and Extract) ⺻ 0x003C 0x0010 ָ ȴ.
#> dvipdfmx -S -P 0x002C fooн带 µ, ι°( °) User Password н带 ʰ ִ.
128Ʈ Revesion 3 ɼ ̿Ϸ ȴ.
#> dvipdfmx -K 128 -S -P 0x0D00 fooƮ ϸ鼭 /⸸ Ϸ Ѵ.
#> dvipdfmx -K 128 -S -P 0x082C foo