Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pdf to image issue #48

Closed
fabiencomte opened this issue Apr 25, 2018 · 10 comments
Closed

Pdf to image issue #48

fabiencomte opened this issue Apr 25, 2018 · 10 comments

Comments

@fabiencomte
Copy link

Hello,
When i render a pdf page containing text and schematics to an image, the text looks correct but the schematics have a black background (original is white).

Do you have an idea please ?

@evilduckz
Copy link

evilduckz commented Apr 30, 2018

I was able to replicate this as well. doing a pdf to tiff with the rasterizer. The pdf contained a signature (using fill and sign) and upon conversion the tiff had a black box where the signature should have been. I did some additional research and the problem lies within the viewer. Soon as i open the pdf with the viewer (no conversion) the signature appears with a infilled black rectangle. I downloaded ghostscript and fed the same commands through the cmd prompt and received back the correct image with no black box for the signature

@fabiencomte
Copy link
Author

Hello,
Could you give me your command please to do some tests ?

@evilduckz
Copy link

the easiest way to replicate this issue is to sign a pdf (using fill and sign) and then open it with the ghostscript.net viewer. The problem exists in the viewer anyways since that is the code the rasterizer uses. Please let me know if you need additional details.

@fabiencomte
Copy link
Author

For you, the bug is in the viewer, right ?

@fabiencomte
Copy link
Author

Hello,
With your command you use a different sDEVICE than the Library (that use display), right ?

@evilduckz
Copy link

evilduckz commented May 18, 2018

If you run the ghostscript.net viewer the bug will present it self by opening a pdf that has a signature in it via a fill and sign.

The bug also presents it self via the command line (becuase the cmd line uses the ghostscript.net view code)

@Cabecinha84
Copy link

Cabecinha84 commented Sep 11, 2018

Hello,

I have found the same problem you have reported. pdfs with signatures, look with black background and wrong colors on the sign box.
I have tried debbuging ghostscript.net viewer but couldn`t find the ghostscript parameter that is missing or wrong that is causing this.
Did you find a solution using ghostscript.net?

Thank you.

@fabiencomte
Copy link
Author

Hello,

No I have no solution, sorry…

@yuanshengyu
Copy link

Hello,
You can use DEVICE to avoid the problem.
GhostscriptJpegDevice dev = new GhostscriptJpegDevice(GhostscriptJpegDeviceType.Jpeg);
dev.GraphicsAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
dev.TextAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
dev.ResolutionXY = new GhostscriptImageDeviceResolution(dpi, dpi);
dev.InputFiles.Add(pdfPath);
dev.Pdf.FirstPage = startPage;
dev.Pdf.LastPage = endPage;
dev.CustomSwitches.Add("-dDOINTERPOLATE");
dev.OutputPath = string.Format("{0}\{1}_page-%03d.jpg", dstDir, name);
dev.Process(versionInfo, true, null);

@jhabjan
Copy link
Contributor

jhabjan commented Feb 4, 2021

Fixed in today's v.1.2.2. release.

@jhabjan jhabjan closed this as completed Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants