0

I'm looking to do the exact opposite of what this person wanted to do: Replacing vector images in a PDF with raster images

In other words, I want to take pdfs with a mix of raster and vector images and output a pdf where all of the images are vectors. I realize that many detailed raster images like photographs will be significantly altered as part of the process to reduce complexity, and that's okay. It'll still be better than the current alternative.

If you're curious, the reason I want to do this is that the nonprofit I work for about to launch a customer portal using a Salesforce product called Digital Experience Cloud. In it, we will provide customers with confidential pdf reports specific to them. To do so, we need to use a salesforce file sharing widget that includes rendering previews of the pdfs. In their latest update, Salesforce released a version of this that is a little buggy - it specifically alters the colors of all images in their pdf previews that people look, well, blue. Vector images are untouched. We were originally going to launch this product today but are holding for a solution a the reports contain a lot of images of clients we serve - making them blue would be seen as disrespectful at best. Salesforce customer service recently told us that this bug will be fixed with their next major release in three months at the very earliest. So I'm looking for workarounds.

1 Answer 1

0

Whilst this is not the answer you asked for I suggest it may be the simplest which is to alter the colours of the files. GreyScale should work for most faces.

enter image description here

No need for ImageMagick as it will use GhostScript so cut to the chase. Biggest downside is whole file will be neutered colours, (that text should be blue) and there is no easy/simple way to exclude the different components.

enter image description here

Command Line

gs -sDEVICE=pdfwrite -sProcessColorModel=DeviceGray -sColorConversionStrategy=Gray -dOverrideICC -o out.pdf -f in.pdf

If convert whole file to grey is not a good "temporary workaround" as required. Then the more complex solution, is to export images and convert only those as grey, then import back to another copy without images. The outline of such a method is the most recent answer, in the opposing question i.e. https://stackoverflow.com/a/73740277/10802527

Not the answer you're looking for? Browse other questions tagged or ask your own question.