Last active
March 9, 2021 21:50
-
-
Save DuckHunter213/c0ee0255aa4074d1a2345de5227a68aa to your computer and use it in GitHub Desktop.
ghostscript add multiples images to pdf on windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# ghostscript to add multiple images to pdf #> | |
<# put gs.exe in the variable system #> | |
<#search path of the follow lib#> | |
$path_library = "C:\Program Files\gs\gs9.53.3\lib\viewjpeg.ps" | |
$filename = "Glosario.pdf" | |
$path_to_images = "F:\path_to_folder" | |
$filter = "*.jpg" | |
$all_images = "" | |
$images = Get-ChildItem -Path $path_to_images -Filter $filter | Select-Object -ExpandProperty Name | |
foreach ($image in $images) { | |
$all_images = $all_images + "(" + $image + ") viewJPEG showpage " | |
} | |
gs -dNOSAFER -sDEVICE=pdfwrite -o $filename $path_library -c $all_images |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment