Luis Sequeira1 wrote:
At the least in the case of the eps file that Matti posted, I can tell you that the pdf resulting from it is vectorial.
I wasn't able to catch the link before it was moderated away.
But this was interesting so I poked around a bit more. I think the problem stems from how Apple's default frameworks display PDF data. PDF is inherently a page-based format. Therefore, it is either always transparent, or never transparent, depending on how you look at it. But the idea is that a PDF is always rectangular and the page is always white, so that is how it is displayed.
Postscript clip art is almost never rectangular. When one views it in a rectangular window, it looks transparent. But this is just how it appears. This is fundamentally different from the transparency in a raster format PNG or GIF. Raster formats implement transparency with transparent pixels. In a PDF, in most cases, there simply isn't any object there. It might still be possible to have objects with transparent colour. You might see that in the form of a gradient perhaps.
There are several different ways to handle either a Postscript or PDF file internally. In my EPSView app, I use what is probably the simplest method. I just read an EPS URL into an NSImage and display that image using and NSImageView. It displays the EPS without any white background.
In my more recent PSOpen app for Ventura, I was trying to find a way to monetize it rather than just displaying the image. I was hoping to be able to convert PS/EPS into SVG, but that's way too difficult. But in this app, I used a PDFView instead. I think my idea was to be able to automatically convert these PS/EPS files into PDF. But the PDFView always draws with a white background.
It seems reasonable that any app using a PDFView is going to display the PDF with a white background. I can confirm that this does not apply a white background to the PDF. It just looks that way. But this means that most apps are going to display a PDF with a white background. However, it can be tricky to find an app that will open a PDF in such a way as to show you that that background isn't actually there.
If anyone wants to use it, I will re-do the PSOpen app to use NSImage in a way to show the transparency. Just e-mail me. I should still be able to save as PDF using a different technique. Converting from one vector format to another vector format like SVG is a whole different problem. What everyone is doing with PS/EPS/PDF is leveraging Apple's existing logic to render these three, very similar formats using macOS's built-in logic derived from NeXTSTEP's Display Postscript. Even Apple hasn't made its internal SVG frameworks available. I've found some good frameworks to read and display SVG, but converting is a whole different problem. Of course, it is technically possible. But the effort required is more than any potential return, unless someone could convince me otherwise.