[tex-live] Creating a document with same font in different resolutions (bitmap)?

Thomas Esser te at dbs.uni-hannover.de
Sun May 4 00:53:59 CEST 2003


> Someone with full Acrobat was so friendly as to concatenate them for me.

pdftex can concatenate pdf files as well. I have come up with the
following macro (comments welcome!), based on tex/pdftex primitives
(not even plain needs to be loaded):

% pdfmerge.tex
%
% borrowed from plain.tex
%
\catcode`\{=1 % left brace is begin-group character
\catcode`\}=2 % right brace is end-group character
\catcode`\$=3 % dollar sign is math shift
\catcode`\&=4 % ampersand is alignment tab
\catcode`\#=6 % hash mark is macro parameter character
\catcode`\^=7 \catcode`\^^K=7 % circumflex and uparrow are for superscripts
\catcode`\_=8 \catcode`\^^A=8 % underline and downarrow are for subscripts
\catcode`\^^I=10 % ascii tab is a blank space
\chardef\active=13 \catcode`\~=\active % tilde is active
\catcode`\^^L=\active \outer\def^^L{\par} % ascii form-feed is "\outer\par"
\catcode`@=11
\countdef\count@=255
%
% pdftex settings
%
\pdfoutput1
\pdfcompresslevel9
\pdfdecimaldigits3
\pdfhorigin0pt
\pdfvorigin0pt
\pdfpkresolution1200
\pdfoptionpdfminorversion4
%
% borrowed from latex.ltx
%
\long\def\@whilenum#1\do #2{\ifnum #1\relax #2\relax\@iwhilenum{#1\relax
     #2\relax}\fi}
\long\def\@iwhilenum#1{\ifnum #1\expandafter\@iwhilenum
         \else\expandafter\@gobble\fi{#1}}
\long\def \@gobble #1{}
%
% borrowed from some code posted by Heiko Oberdieck
%
\long\def\readfile#1{%
  \pdfximage{#1}%
  \pdfhorigin=0pt
  \pdfvorigin=0pt
  \count@=0 %
  \@whilenum\count@<\pdflastximagepages\do{%
    \advance\count@ by 1 %
    \pdfximage page \the\count@ {#1}%
    \setbox0=\hbox{\pdfrefximage\pdflastximage}%
    \pdfpagewidth=\wd0
    \pdfpageheight=\ht0
    \shipout\box0
  }%
}%
\endinput

To use this, just write a wrapper which says:
  \input pdfmerge
  \readfile{fileA.pdf}
  \readfile{fileB.pdf}
  \end

Or, create a format file:
  pdftex -ini pdfmerge\\dump
  pdftex \&pdfmerge '\readfile{fileA.pdf}\readfile{fileB.pdf}\end'

Thomas


More information about the tex-live mailing list