1

I'm trying to downres a PDF with text effects over high-res graphics to ebook resolution. In Acrobat or when printing this on an inkjet I have to use "Simulate Overprinting" to get the text effects to appear correctly. (Outer glow around text, generated from InDesign.)

I saw these articles:

How to simulate overprinting for a pdf device using ghostscript

and

Ghostscript - don't show objects with overprint set

I assumed I would want to try -dSimulateOverprint=true.

When I tried that, ghostscript said the following:

**** -dSimulateOverprint={true|false} is no longer supported.    ****
**** It has been replaced by -dOverprint={enable|disable|simulate} ****

GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Processing pages 1 through 261.
Page 1
^C

I tried to change that to -dOverprint=simulate, but it said:

Invalid value for option -dOverprint=simulate, use -sNAME= to define string constants

I tried -dOverprint=true, but it said:

GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Unrecoverable error: typecheck in .putdeviceprops

My full command is:

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite  \
    -dOverprint=true                    \
    -dCompatibilityLevel=1.4            \
    -dPDFSETTINGS=/ebook                \
    -sOutputFile=$outfile               \
    $file

This: original screenshot

becomes this: blocky text effects screenshot

I tried running the result through pdftocairo -level3 -antialias none -pdf, which has fixed the same kind of display problem after joining files with pdfjam, but that didn't work. Instead, it removed the text effect entirely: pdftocairo result screenshot

I can still select the text with the mouse, so I know it has not rasterized the fonts.

I guess I will go back to InDesign and export it with compressed downscaling. It would be nice if this worked though. That process takes a long time.

Any ideas how I can prepare a downscaled version of this file? Thanks.

Ken White
  • 123,280
  • 14
  • 225
  • 444
  • Ghostscript command line options are either strings (-s) or names/integers/boolean (-d). Names in PostScript (because Ghostscript is a PostScript interpreter) are introduced with the '/' character. So if you look at your 'full commend' you can see -dPDFSETTINGS=/ebook. So if you want -dOverprint to be set to 'simulate' you need to say -dOverprint=/simulate. However since the Overprint option relates to **rendering** it has no effect on the pdfwrite device which does not render the output. Don't use it. – KenS Mar 18 '22 at 09:28
  • Ah, it just occurred to me that using PDFSETTINGS=/ebook will change the colour model of the content to RGB, which will destroy any overprint in the original (SimulateOverprint won't help as the content isn't rendered). So instead of using the canned settings I would suggest (as I always so) that you set the specific parameters you think will do what you want. Or post the actual PDF file instead of pictures of it. – KenS Mar 18 '22 at 12:14
  • As noted, see my response below. You really quite much right now simply have to run the PDF though Adobe's PDF printer. Post a link to any ugly or poor pdf, and in my answer below I'll post a screen cap side by side - my bets? You not tell the difference. so, no, you simple cannot use gs for this type of pdf conversion. Try using Adobe with simulate overprint on. In fact, you can even print to a free pdf printer and the results are quite good, but if you really want a good job, and to just build a easy to display PDF for preview in a web browser? Just run it though the adobe pdf printer. – Albert D. Kallal Mar 18 '22 at 21:30
  • Thank you for the extended Adobe advert and the dissertation, if you want to come up with some examples, then I may look at them. I'd also point out that Ghostscript can do 'print to PDF' as well, and many of the free 'print to PDF' applications do in fact use Ghostscript to do so. And if that's what you want (image wrapped up in a PDF file) then GS can provide that for you too. – KenS Mar 19 '22 at 08:55
  • If you'd like to discuss this reasonably, I'm more than willing to look at an example of an input file, the result from 'Adobe print to PDF' and see what can be done to produce a similar effect. I'd need an example file though, which hasn't been provided anywhere. – KenS Mar 19 '22 at 09:08
  • Thanks @KenS . My first problem was corrected by putting the / into the -dOverprint setting. Then I tried exporting CMYK from InDesign as you suggested. However, that did not help. I get the same results with -dOverprint=/enable or -dOverprint=/simulate. To clarify, these are type effects. (Outer/inner glow FX.) I think that printing the scaled-down files may actually work. But that's not what I need. I need to scale down the files for online preview to publishers. Here are the files: – Mark Hedges Sep 28 '22 at 17:31
  • [>Here are the files.>>](https://drive.google.com/drive/folders/1tJjmz3sh26GHCQ7rf3AhMu2IDSV7ou7P) EOB_02.pdf is the original. EOB_02.ebook.op=simulate.pdf and EOB_02.ebook.op=enable.pdf were produced with: `gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dOverprint=/simulate -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -sOutputFile=$outfile $file` and /enable, respectively. The others were attempts to clean the file first with mutool and pdftocairo. No help there. – Mark Hedges Sep 28 '22 at 17:38

1 Answers1

-1

From what I can tell, there is no practical way in ghostscript to convert the print overlays simulation to a correct rendering and having them removed into another PDF>

The only practical and simple way is to get your hands on the paid version of adobe acrobat, and run the pdf through their print driver with the simulate over print check box. The result is a pdf that looks quite much the same, and as a result say viewing the PDF in a web browser or a smart phone looks quite much like the original. Easy as pie to do this with Adobe.

To be fair, Artifex has "attempted" (with beyond terrible results) to add overprint support.

In fact, Artifex has re-done the gs rendering engine in gs, but I find the results even worse then the previous 10 year old versions of gs.

However, Artifex has owned gs and hopefully with some more love and care?

And their approach is very "print" industry orientated with their approaches here. If they could get a few more features correctly working then gs will become a potent force in the print industry.

Hopefully, and eventually they may well fix and address this over print simulation issue. I don't see why output to a pgn, or tiff is required. Other tools exist that do a perfect job of outputting a pdf, and all done with a min of hassle.

A LOT of people need/want this feature, since if you attempt to display + render a PDF in a web browser? Well, you need that overprint simulation feature. So, right now, easy way? Use Adobe PDF viewer, and check box the simulate over print, and then print to their PAID driver. However, using that viewer is not a option nor practical for most web based applications these days.

In a strange way, the 10 year older gs was able to do a better job. However, we do see this now on Artifex site:

enter image description here

However, since for about the last 10 years, now outputting to pdf with their newer "re-write" of the gs engine actually does a WORSE job then it did before.

But, it is 100% junk, garbage, and no support of outputting as pdf.

But, OTHER vendors? Sure, no problem - walk the park. They provide overprint simulation, and ALSO output as another PDF.

However, since they are now showing "new" as a feature, it is possible in a future release, you will be able to get gs to produce a reasonable "overprint" simulation and conversion, and output a workable and useable PDF for web display.

So, until this "cruel joke" issue is addressed?

You have to get your hands on Adobe acrobat - paid version, and run the PDF though their printer driver. When you do this, in 99% of cases, you can't see nor tell the difference when viewing either pdf in a browser - and that's GOOD enough and what 99% of what people need.

You don't even need to setup any fancy color profiles or anything for this to work rather well. As noted, just use Adobes overprint simulation, and you off to the races - and this simple concept and feature is what EVERYONE been looking for to do in gs for a long time now.

I repeat, this issue been asked over and over on SO here.

As noted, like everyone else, the goal here is being able to display that pdf in a web browser, and the only practical way to do that is of course to have the overprint layers and separations removed, or at the very least use the "same" over print simulartion that 99% of people use with their desktop version of Adobe to view the PDF.

However, there is this new invention called the web!! (duh!!!).

There are also 3rd party companies that also have addressed this issue such as:

https://www.pdftron.com/products/web/

Their PDF web viewer (I can confirm) is able to handle the overprint layers and still correctly render a PDF in "any" browser. However, they are expensive, and they don't ONLY sell you a pdf viewer, but want to to pay and buy a whole site of applications - with a high monthly cost. I would have gone with them, but they don't bundle or offer ONLY the pdf viewer which is what everyone needs - not a huge full PDF suite of tools.

So, right now? You can't use gs to do this, but now that the above "overprint" simulation is being touted, then we might see this ability added to gs in the future, and the situation is now not 100% hopeless but maybe only 60% hopeless!

However, as it stands now? You quite much have to use the paid edition of Adobe acrobat and their print driver to "covert" the PDF and have a resulting PDF that looks quite much the same in any web browser, or even any smartphone, or in fact any pdf viewer to make this work

Don't need a room full of print consulatnts, nor a room full of people yaking on for hours and hours about you can't do this, yet one check box in Adobe destop, and it renders just fine. And sending it though their PDF printer outputs quite much what you were looking at on your monitor, and the reuslting output as a pdf without the overprints? Gee, more then aduquote reuslts for 99% of the world tying to preview that pdf document.

For specialied print previews? Well, EVEN in those cases, customers just preview in the browser (with our PDF run though the Adobe PDF printer), but we also provide a download link and recommend to the customer to download the actual PDF if "careful color" rendering is required. (and thus and we provide a link).

Want me to put out the stats for how many just view in the web browser vs want to download and open with PDF? Really??? Not even close!!! Customer looks at the proof - yup - that's good to go in 99% of the use cases we have.

Albert D. Kallal
  • 42,205
  • 3
  • 34
  • 51
  • I think you are being unreasonable here. The overprint simulation refers to rendering devices, not the high level devices like pdfwrite. For those, the overprint is left in the file, just as it was in the original input. As I explained above, if you further change the colour model to RGB then that overprint information is wasted, because it only applies to CMYK spaces. If you want the overprint simulation in a web browser then you need to render to an image format (eg PNG) **not** to another PDF file, which is what the question is about. – KenS Mar 18 '22 at 20:11
  • Your charcterisation of Ghostscript's overprint support is puzzling, it has worked reliably and correctly (as per the specification) for years to the best of my knowledge. No it doesn't work if you render to RGB because overprint doesn't work with RGB, that's what the spec says. You've managed to completely confuse the ownership of Ghostscript, which has belonged to Artifex (which you've mis-spelled above twice) since the 1980's. Yes it's print oriented, Ghostscript has always been print oriented, because it's a PostScript interpreter. – KenS Mar 18 '22 at 20:14
  • Sorry, I don't accept your position one bit. This question is asked 100's of times here over the past 10 years. I mean, if you want to flat out state that you can't use GS to do this type of conversion, then why not just flat out and be 100% clear on this matter then The simple matter is other tools and other means exists to get the desired results the poster wants. A simple run though Adobes pdf printer fixes this issue with great ease, and a min of fuss. If GS is not designed to do this, then so be it. Beyond gut busting howls of laughable you suggest converting to PNG. I'll correct spelling – Albert D. Kallal Mar 18 '22 at 20:42
  • The simple question remains: any simple way to cover the PDF to a PDF without the overprints that every dog, pony and person needs for the web? – Albert D. Kallal Mar 18 '22 at 20:43
  • OK I'm not going to get dragged into an argument. The overprint in Ghostscript works as per the spec, you haven't shown me a case where it doesn't and this is the first time I've seen this question in my time on SO. You can only have overprint work if you render to CMYK (more complex with /Separation and /DeviceN spaces). So if you render to anything else then you won't get overprint. That's the way the spec is written. Web is RGB so the only way to get that to work is to render to CMYK then convert to RGB. GS doesn't do that. – KenS Mar 19 '22 at 08:48
  • If you want a PDF which looks the same but has no overprint then you need to convert it to an image. No there's no choice. You can have a PDF which contains only an image, and Ghostscript will make one of those for you, but frankly that's pretty much the same as a PNG IMO. I suspect that this is precisely what your 'simple run through Adobe printer' does. As I said, the overprint simulation won't do anything with the pdfwrite device, since it only affects rendering. And as far as I understand the original poster's question, this isn't what they're trying to do. – KenS Mar 19 '22 at 08:52
  • YES there is a choice! - and boatloads of people do this all the time. Beyond laughable to suggest the ONLY solution to to convert to image. How on earth then do web sites provide PDF viewers, and provide PDF's that render 100% fine on a smartphone. Please don't be a fool in public. We do this conversion all the time, and so do boatloads of web sites. The SIMPLE goal is a the desire to have PDF's that can be consumed and viewed in things like say a smartphone or web browser. You REALLLY have to get out of mom's basement to suggest that the only solution is a image? Really? Please! – Albert D. Kallal Mar 19 '22 at 15:01
  • OK so you aren't prepared to discuss this reasonably. Fine. – KenS Mar 19 '22 at 17:26
  • NO! - You are the one ignoring the HUGE MASSIVE elephant in the room. Lets try this again: the wide spread goal, the wide spread desire, the wide spread want is to display and render the PDF in a browser. Tons of sites do this. If you going to stand here and ignore this elephant in the room and the simple question? Then you are ignoring this thing called the internet, but are flat out suggesting that the goal of viewing that PDF in a browser or smartphone does not exist and this goal does not widespread exist. It is beyond laughable and narrow minded for you to stand here and ignore this goal – Albert D. Kallal Mar 19 '22 at 18:07
  • I have the paid version of Adobe Acrobat, but I have no idea what you mean by "run it through the print driver." There is no way to export a PDF to a PDF. If I go to print, then to the system print dialog and try to save as a PDF, it says that is not allowed. Perhaps it would be more constructive to provide specific instructions to try before engaging in argument with other people who are doing their best to help. – Mark Hedges Sep 28 '22 at 17:27
  • You can while viewing the pdf, choose print. And then choose the Adobe PDF printer. If you have overprint simulation turned on, then the resulting output PDF can now be viewed correctly in any browser, and the overprint simulation option is not required anymore. So, you don't export a PDF to a PDF, you send it though the PDF printer driver again. The simple goal that EVERYONE was asking here for? To simple produce a pdf document without the color layers and without the need for overprint simulation button having be checked when viewing that PPF. Once done, then even any browser can display pdf – Albert D. Kallal Sep 28 '22 at 20:41