suttacentral / publications

SuttaCentral books: make HTML, EPUB, PDF
Creative Commons Zero v1.0 Universal
2 stars 1 forks source link

bugs in cover uploaded to Lulu #138

Closed sujato closed 1 year ago

sujato commented 2 years ago

Attempting to print via Lulu, I discovered two bugs in the cover templates.

Here is the "print-ready" file from Lulu with these bugs visible.

y2zdpz_DRAFT_print_cover.pdf

sujato commented 2 years ago

I have tried to fix the problem with the cover image. Not as easy as I thought!

It seems to be to do with flattening the transparency in the image. There are a few suggestions here:

https://unix.stackexchange.com/questions/162922/is-there-a-way-to-flatten-a-pdf-image-from-the-command-line

The only methods that I can get to solve the problem involve rasterizing the image, which has the side effect of meaning there are no fonts embedded. This is probably the best way so far:

pdf2ps orig.pdf - | ps2pdf - flattened.pdf

Which results in:

dhp-cover-pdf2ps.pdf

It's a good image quality. I can, however, see the image artifacts in the text at a high zoom level. I am not sure if this will affect the perceived cover quality.

You can get a similar result using GIMP.

The pdftk and gs options did not flatten the image.

I feel like we should be able to say "flatten images, not fonts". But so far I have not found anything to do this.


I also tried manually adding the background color to the imported png image, then creating the pdf. But strangely, this ended up with the imported image having a different background color, even though it uses the same HTML color code.