如何将两个PDF页面拼接成一个大页面? [英] How to stitch two PDF pages together as one big page?
问题描述
我有两个36英寸乘48英寸的海报(LaTeX),我想将它们附加到单个72英寸乘48英寸的海报中(垂直堆叠).
I have two 36" by 48" posters (LaTeX) that I want to append into a single 72" by 48" poster (stack vertically).
浏览SO和GS文档,我一无所知(我不是CLI向导).我该怎么办?
Browsing around SO and GS documentation, I have no clue (I'm not a CLI wizard). How can I do this?
(此外,该过程也不应有损地压缩光栅图像,因为它将以2400 * 1200 DPI的分辨率打印.)
(Also, the process should not compress the raster images lossily, because this will be printed 2400*1200 DPI.)
推荐答案
由于OP没有提供原始输入张贴者(指向其的链接),因此该回答将分三步进行:
Since the OP didn't provide (a link to) the original input posters, this answer will proceed in three steps:
- 创建2个虚拟海报作为第3步的输入
- 创建一个嵌入2个虚拟海报的LaTeX文档
- 运行
pdflatex
在步骤2中从LaTeX文档创建PDF
- Create 2 dummy posters as input for step 3
- Create a LaTeX document which embeds the 2 dummy posters
- Run
pdflatex
to create a PDF from the LaTeX document in step 2
步骤1:创建2个虚拟海报(大小为36in x 48in
)
我创建了两个不同的PDF虚拟海报,向您展示如何使用 LaTeX . (这意味着:您至少需要在系统上安装基本的LaTeX,包括pdflatex
实用程序.)
Step 1: Create 2 dummy posters (with size of 36in x 48in
)
I've created two different dummy posters as PDF to show you how to do it with LaTeX. (That implies: you need to have at least a basic LaTeX installation on your system, including the pdflatex
utility.)
这两个假人是我在Ghostscript的帮助下创建的.由于对于Ghostscript的pdfwrite
设备1in == 72pt == 720pixels
,命令是这样的(因为36in == 2592pt == 25920pixels
和48in == 3456pt == 34560pixels
):
These two dummies I created with the help of Ghostscript. Since for Ghostscript's pdfwrite
device 1in == 72pt == 720pixels
, the commands are like this (because 36in == 2592pt == 25920pixels
and 48in == 3456pt == 34560pixels
):
gs -o poster1.pdf \
-g25920x34560 \
-sDEVICE=pdfwrite \
-c " /Helvetica-Bold findfont" \
-c " 500 scalefont" \
-c " setfont" \
-c " 50 2000 moveto" \
-c " (POSTER 1) show" \
-c " 1 0 0 setrgbcolor" \
-c " 10 setlinewidth" \
-c " 20 20 2552 3416 rectstroke" \
-c " showpage"
gs -o poster2.pdf \
-g25920x34560 \
-sDEVICE=pdfwrite \
-c " /Helvetica-Bold findfont" \
-c " 600 scalefont" \
-c " setfont" \
-c " 50 2000 moveto" \
-c " (Poster 1) show" \
-c " 1 0 0 setrgbcolor" \
-c " 10 setlinewidth" \
-c " 20 20 2552 3416 rectstroke" \
-c " showpage"
以下是显示这些海报"的2个屏幕截图:
Here are 2 screenshots showing these "posters":
有一个名为'pdfpages'的LaTeX软件包,它可以将PDF页面插入LaTeX文档,但也可以从PDF页面创建"n-up"布局. (除了基本的LaTeX安装外,您还需要该软件包.)
There is a LaTeX package called 'pdfpages' which can insert PDF pages into LaTeX documents, but which also can create "n-up" layouts from PDF pages. (In addition to your basic LaTeX installation you need that package too.)
这是您可以使用的小型LaTeX程序.将其另存为2up-poster.tex
:
So here is a small LaTeX program you can use. Save it as 2up-poster.tex
:
\documentclass{article}
\usepackage{pdfpages}
\usepackage[paperwidth=72in, paperheight=48in]{geometry}
\pagestyle{plain} % Don't use page numbers
\begin{document}
\setlength\voffset{+0.0in} % adj. vert. offset as needed
\setlength\hoffset{+0.0in} % adj. horiz. offset as needed
\includepdfmerge[nup=2x1,
noautoscale=true, % set "false" if larger inputs
frame=false, % set "true" for frames
templatesize={36in}{48in}] % adjust as needed
{poster1.pdf,poster2.pdf} % modify for file names
\end{document}
步骤3:运行pdflatex
现在,您可以运行以下命令来创建撰写的海报:
Step 3: Run pdflatex
Now you can run the following command to create your composed poster:
pdflatex 2up-poster.tex
这将创建一个名为2up-poster.pdf
的PDF文件.
This will create a PDF file named 2up-poster.pdf
.
结果在这里是屏幕截图:
The result is here as a screenshot:
这篇关于如何将两个PDF页面拼接成一个大页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!