1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Powershell】フォルダ内のpdfを連結させる方法

Last updated at Posted at 2022-11-10

フォルダ内のpdfを連結させる方法

複数のpdfファイルをすぐにマージしたいとき、以下の1行で名前順に結合することができる。
フォルダ内のファイルを全て、pdftkの引数に渡しています。
※pdftkをinstallする必要があります。

user/
 └ document/
           ├ 1.pdf
           ├ 2.pdf
           ├ 3.pdf
           ├ 4.pdf
           ├ 5.pdf 
powershell
$string=''; Get-ChildItem -File *.pdf| ForEach-Object { $string +=  $_.name + ' ' } | Invoke-Expression "pdftk $string output output.pdf"

※実行後、連結されない場合は、以下のコマンドを実行すると連結されるかも

powershell
Invoke-Expression "pdftk $string output output.pdf"

まとめ

このような作業を時間をかけずサクッとできれば、業務効率改善につながると思う。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?