Page 1 of 1

Drawing lines on a pdf without converting

Posted: 2015-10-24T02:01:00-07:00
by Manofwax
Hello,
I've an high resolution pdf file containing a raster image, I need to add two lines on it. I'm using this command:

Code: Select all

convert in.pdf -draw "line 35,0 35,1000" -draw "line 216,0 216,1000" out.pdf
My issue is out.pdf comes out in super shitty quality, the image is all blurry and the file size is an half of the original (6MiB instead of 11.7MiB). I tried using -quality or -density but it seems they are ignored, for example using -quality 100 or -quality 1 doesn't change the output.

Is it possible to keep the original image exactly the same without converting it in any way?

Re: Drawing lines on a pdf without converting

Posted: 2015-10-24T02:06:01-07:00
by snibgo
If in.pdf contains a single raster image, the best extraction tool I know of is pdfimages, not ImageMagick. When it is extracted, use IM to draw lines and put it in a pdf.

If you really want to use IM to extract the image, use "-density X" before "in.pdf", where X is a suitable number for dpi, maybe 300.

Re: Drawing lines on a pdf without converting

Posted: 2015-10-24T02:11:53-07:00
by Manofwax
Thanks, with -density before in.pdf it works perfectly!