Andrew
Andrew

Reputation: 6394

Ghostscript: Pdf page converted to png is missing the text

I am struggling with a problem and I have no idea how to fix it. I use Ghostscript to extract a png from the pdf page but the thing is the resulting png has only the table borders from the original pdf, the text from the table cells is missing.

The result: The result

The code I use:

gs -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 
'-sDEVICE=png16m' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dBackgroundColor=16#ffffff '-r300x300' 
-sOutputFile=/tmp/testpdf/res1.png /tmp/testpdf/1.pdf

The output:

GPL Ghostscript 9.56.1 (2022-04-04)
Page 1
Loading CIDFont TimesNewRoman substitute from /usr/share/ghostscript/Resource/CIDFSubst/DroidSansFallback.ttf
Loading CIDFont TimesNewRoman,Bold substitute from /usr/share/ghostscript/Resource/CIDFSubst/DroidSansFallback.ttf
Loading font Times-Roman (or substitute) from /usr/share/ghostscript/Resource/Font/NimbusRoman-Regular

I run this on an Amazon Linux 2023 machine.

Any idea what is going on here?

Upvotes: 0

Views: 21

Answers (0)

Related Questions