惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
Jina AI
Jina AI
GbyAI
GbyAI
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
P
Proofpoint News Feed
The Cloudflare Blog
H
Help Net Security
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
量子位
博客园 - 聂微东
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
月光博客
月光博客

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
How to Replace A Page of PDF File with Another PDF
2018-06-04 · via jdhao's digital space

In this post, I want to write about how to replace one page of existing PDF files with a new PDF image.

Crop image and convert it to PDF file#

Because the page size of most PDF files is A4 size1. First we need to crop the image to have the same aspect ratio as an A4 paper. We can use FastStone Image Viewer to achieve this.

Open the image using FastStone Image Viewer, press x and we will be in the crop mode. We need to add a new aspect ratio for the A4 size.

In the pop-up window, click “Add” and set the width and height of the paper ratios (see image below).

Then go back to the crop board and choose the ratio we have just set up. Then choose the option “Lossless Crop to File”. In the pop-up save file window, choose the PDF format.

Embed PDF image to the existing PDF files#

Now we can embed the produced PDF image to the existing PDF files. We use the free tool pdftk to do this. Download, install it and set the PATH variable properly.

If we have a file Thesis.pdf and we want to replace the 5th page with another file sign_page.pdf. We can use the following command:

pdftk A=Thesis.pdf B=sign_page.pdf cat A1-4 B1 A6-end output signed_thesis.pdf

This command is pretty self-explanatory. We concatenate page 1 to 4 of Thesis.pdf, the sign_page.pdfand page 6 to end of Thesis.pdf to form a new PDF file. In effect, we have replaced the 5th page of Thesis.pdf. The produced file will be signed_thesis.pdf.

Another way to embed PDF files.#

If you have purchased Adobe Acrobat Pro, you can use Acrobat to replace a page in PDF files.

Reference#