利用tex合并和拆分pdf文件

介绍

在插入pdf的时候我们可以使用命令\includegraphics{}, 这时会把pdf当作图片插入文档中,会接收到关于尺寸的warnings. 如果想将pdf当作页面加入新的文档可以使用命令\includepdf{}. 使用该命令需要添加宏包pdfpages.

\includepdf{}用法介绍

\includepdf[⟨key=val⟩]{⟨filename⟩}
  • ⟨key=val⟩ { A comma separated list of options using the
    ⟨key⟩=⟨value⟩ syntax.
  • ⟨filename⟩ { Filename of the PDF document. (The filename must not contain any blanks!)

key的可用参数有如下:

  • pages Selects pages to insert. The argument is a comma separated list, containing page numbers (pages={3,5,6,8}), ranges of page numbers (pages={4-9}) or any combination. To insert empty pages use {}.
    E.g.: pages={3,{},8-11,15} will insert page 3, an empty page, and
    pages 8, 9, 10, 11, and 15.
  • nup Puts multiple logical pages onto each sheet of paper. The syntax of this option is: nup=⟨xnup⟩x⟨ynup⟩. Where ⟨xnup⟩ and ⟨ynup⟩ specify the number of logical pages in horizontal and vertical direction, which are arranged on each sheet of paper. (Default: nup=1x1).
  • landscape Specifies the format of the sheet of paper, which is rotated by 90 degrees. This does not affect the logical pages, which will not be rotated by the ‘landscape’ option. To rotate the logical pages use the ‘angle’ option (e.g. ‘angle=90’). Either ‘true’ or ‘false’ (or no value, which is equivalent to ‘true’). (Default: landscape=false)

\includepdfmerge{}用法介绍

该命令可以同时插入多个pdf文件。

\includepdfmerge[⟨key=val⟩]{⟨file-page-list⟩}
  • ⟨key=val⟩ – A comma separated list of options using the
    ⟨key⟩=⟨value⟩ syntax.
  • ⟨file-page-list⟩ – ** ⟨filename⟩[,⟨page spec⟩][,⟨file-page-list⟩] ** A comma separated list of filenames and optional
    ⟨page spec⟩ specifiers. A ⟨page spec⟩ can be everything
    the option pages accepts. Leading and trailing spaces
    of items in the list is stripped.

注意这里如果不给赋值就只会插入pdf的第一页,且page不在[]的参数中了。其他参数和\includepdf{}一样。
用例如下:
在这里插入图片描述

更多可参考pdfpages的说明文档.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值