Showing posts with label imagemagick. Show all posts
Showing posts with label imagemagick. Show all posts

Friday, August 10, 2018

how to convert text file into png using imagemagick

# disable policy "path" at /etc/ImageMagick-6/policy.xml

then

convert -trim +repage -font FreeMono -size 1200x1200 -border 2 \
-pointsize 18 label:@trip_itinerary trip_itinerary.png

You may want to adjust the number 1200x1200 to be something bigger as needed which depends on the size of your input text file (trip_itinerary in this example).

Friday, January 23, 2015

how to convert pdf to jpg or png with high quality result with imagemagick

If the pdf file contains only images:

 

convert -density 150 -trim input.pdf -quality 100 -sharpen 0xx1.0
output.jpg

 

But, if the pdf file contains both images and text:

 

convert  -density 288 model-of-the-standing-desk.pdf -background white -flatten -resize 80% model-of-the-standing-desk.png

 

You may also need to add this line:

 

 <policy domain="coder" rights="read | write" pattern="PDF" />

 

inside the file /etc/ImageMagick-7/policy.xml

just before the line:

 

 </policymap>


too.

Saturday, June 8, 2013

split multi pages pdf into mutiple jpeg files

convert -quality 100 -density 300x300 multi_pages.pdf single%d.jpg