A simple Ghostscript command to merge two PDFs in a single file is shown below:
1
| gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf
|
combine all the files
1
| gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=ANDHealth_website_wireframes.pdf -dBATCH homepage.pdf programs_overview.pdf plus.pdf bootcamp.pdf bright_future.pdf investor.pdf alumni.pdf partners.pdf events_archive_custom_post_type.pdf events_single.pdf News_archive.pdf news_single.pdf Rescources_custom_post_type.pdf about.pdf
|
convert to v1.4 printer resolution pdf
1
2
3
4
| ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
## convert to v1.4 screen resolution pdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sPAPERSIZE=a5 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=antarctic.pdf Antarctica.pdf
|
1
2
3
| gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=22 -dLastPage=36 \
-sOutputFile=outfile_p22-p36.pdf 100p-inputfile.pdf
|
1
| gs -sDEVICE=pngalpha -o file-%03d.png -r144 antarctic.pdf
|
//https://stackoverflow.com/questions/653380/converting-a-pdf-to-png Out of all the available alternatives I found Inkscape to produce the most accurate results when converting PDFs to PNG. Especially when the source file had transparent layers, Inkscape succeeded where Imagemagick and other tools failed.
1
| inkscape "$pdf" -z --export-dpi=600 --export-area-drawing --export-png="$pngfile"
|
non transparent background // not increase resolution use -r1000
1
| gs -sDEVICE=png16m -o file-%03d.png -r144 antarctic.pdf
|
Install Ghostscript:
Type the command sudo apt-get install ghostscript
to download and install the ghostscript package and all of the packages it depends on.
Comments powered by Disqus.