Through lots of trial and error, I have found the best way to do that, and its working great, but I have one major problem:
While it works on text, imagemagick seems to ignore "images" such as eps and pdf files that are embedded into the pdf when converting the colors.
I am doing this through a VB script, here are the relevant lines:
Code: Select all
if (serial_flag = true) then
img_region = "1830x2418+114+0"
else
img_region = "1890x2550+114+0"
end if
img_fill = "cmyk(0%,0%,0%,0%)"
img_opaque = "cmyk(0%,0%,0%,100%)"
img_depth = "8"
img_density = "240"
img_pdf_crop = "pdf:use-cropbox=true"
img_fuzz = "190"
img_cs = "gray"
img_cmp = "lzw"
Code: Select all
msgs = img.Convert("-verbose","-region",img_region,"-fill",img_fill,"-opaque",img_opaque,"-depth",img_depth,"-density",img_density,"-fuzz",img_fuzz,"-define",img_pdf_crop,objDialog.fileName & "[" & i & "]",objDialog.fileName & "_" & i & ".tif")
Code: Select all
msgs2 = img.Mogrify("-colorspace",img_cs,"-compress",img_cmp,"-flatten",objDialog.fileName & "*.tif")