Posts

Showing posts with the label imagemagick

ghostscript

When concatenating PDFs into a single file, I tried imagemagick: convert first.pdf second.pdf third.pdf output.pdf but the resolution suffered. This forum suggests that Imagemagick makes use of ghostscript in this action and provides a command that cuts out the middleman: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=temp.pdf pdf1.pdf pdf2.pdf This worked like a charm, and fast, but I'm not massively happy copypasting commands I'll never remember. 1) record it here for future use 2) alias it, or write a super simple bash script? 3) look into ghostscript and see if I can simplify the command, learn the syntax

ghostscript

When concatenating PDFs into a single file, I tried imagemagick: convert first.pdf second.pdf third.pdf output.pdf but the resolution suffered. This forum suggests that Imagemagick makes use of ghostscript in this action and provides a command that cuts out the middleman: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=temp.pdf pdf1.pdf pdf2.pdf This worked like a charm, and fast, but I'm not massively happy copypasting commands I'll never remember. 1) record it here for future use 2) alias it, or write a super simple bash script? 3) look into ghostscript and see if I can simplify the command, learn the syntax

pdf to png/jpg/etc

Not often I learn something at work that I need to put on here. Anyway, imagemagick: convert -density 600 input_file.pdf output_file.png Gives me a lovely hi-def version of the image. Too hi, probs, but at least it's relatively easy to resize (down) once it's in the appropriate image format.

ImageMagick

I'd scanned 16 pages of a mortgage application form using xsane and I wanted to whack them all together in a single pdf. Googling revealed a consensus that the solution involved using ImageMagick . Lazily I just tried sudo apt-get install imagemagick , which did something , but I'm not sure what. Maybe provided some sort of infrastructure for imagemagick, if the description of the packages I checked on synaptic later are anything to go by. Anyway, I fucked about a bit and ended up compiling it and I was missing dependencies which I eventually got from following this advice : sudo apt-get install imagemagick libmagick++-dev And suddenly the starting instructions I was following worked: convert mortgage *. png mortgage_application . pdf Gave me the single document I needed. Pages all in the wrong order of course.  [EDIT] The files needed leading numbers in the name to order properly in the folder. I tried to use a for loop to rename each in turn ( f or v in mortgag...