How does Ghostscript handle vector objects that have no color

123 Views Asked by At

I have CMYK vector logo PDF files that need to be converted into EPS files on the fly using Ghostscript on Linux. They all have a colorless vector outline around the page area to mark the safety zone (empty space necessary around the logo) which most graphic programs maintain when the file is opened or placed on a page document. Unfortunately Ghostscript does not seem to convert these outlines in the EPS conversion but drops them out.

Is there any way to get these outlines (or any colorless vector objects for that matter) to carry over into the converted EPS file and still keep them colorless? Maybe using something else than Ghostscript?

Follow up question: is there any way of also maintaining the boundingbox and page size in the conversion as well?

E.g. Adobe Illustrator or other graphic programs do not have these problems when saving EPS files.

1

There are 1 best solutions below

0
On

Without seeing an example, there's no possible way to help. There is no such thing as a 'colourless' vector outline in PDF. You can describe a path, but that path must then either be stroked, filled or used as a clip, if it makes marks then its not 'colourless'. (Actually that's not quite true, you can use a /Separation colour with the specific ink name of /None, but that does seem rather pointless)

The MediaBox will be converted into a /PageSize setpagedevice when converted to a PostScript program. Note that EPS programs are not permitted to emit a PageSize request, so no, you cannot preserve the MediaBox from a PDF file into an EPS program.

Since the BoundingBox is derived from the marks on the media, and PDF files don't have a BoundingBox (elements of PDF files do have BoundingBox entries, but the PDF file or individual pages, don't). So no, you cannot preserve what isn't there to begin with.

The BoundingBox is defined as the smallest area which encloses all the marks on the media. If you want the BoundingBox to be larger than that (your so-called 'safety zone' then you need to leave space around the EPS when you place it in the document. Frankly anything else is just wrong.

It 'sounds like' you are expecting that some white space in the PDF file will be converted to white space in the EPS (there is no 'colourless vector outline', its just unmarked area). From the EPS specification:

For an EPS file, the bounding box is the smallest rectangle that encloses all the marks painted on the single page of the EPS file.

If you post a (simple) example file somewhere then I can look at it, but it seems you have answered your own question anyway:

"Is there any way to get these outlines (or any colorless vector objects for that matter) to carry over into the converted EPS file and still keep them colorless? Maybe using something else than Ghostscript?" ... ... "E.g. Adobe Illustrator or other graphic programs do not have these problems when saving EPS files."

So, yes, you can use one of these other programs.