Page 1 of 1

Removing Embedded Graphics from a PDF?

Posted: 2010-06-03T08:48:30-07:00
by sdg
Ok, so I need to strip out the black plate for a portion of the page in a pdf, then convert it to TIFF.
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")
For my purposes, I would be fine with it just removing the embedded stuff, rather than trying to convert colors - any ideas?