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

How to improve the resolution of the image? #2

Open
davinchi7 opened this issue Apr 22, 2018 · 8 comments
Open

How to improve the resolution of the image? #2

davinchi7 opened this issue Apr 22, 2018 · 8 comments

Comments

@davinchi7
Copy link

Hi!
I have tested the library and it works very well. I would like to know if you can improve the resolution of the image.
Thank you very much.

@indradeepc
Copy link

Did you find any solution for this?

@chen0040
Copy link
Owner

Sorry pretty busy recently with my works, did not have a chance to look at how to resolve this. One way that you may try is to change the Pdf2Image.PrintQuality = 100. If not working, I will look into this issue during weekend.

@davinchi7
Copy link
Author

Hello Friend,
Thank you very much for your answer. Is it possible that the lack of quality is due to the type of font used in the PDF? Can I send you my PDF for you to try it on?
Thank you very much

demo.pdf

@chen0040
Copy link
Owner

@davinchi7 thanks for the demo.pdf, i think you are right about the font. i was tuning the fonts for the pdf convert, still working on it. below are some of the config i was experimenting:

`/*

        cs_pdf_to_image.Pdf2Image.Config.DisablePrecompiledFonts = true;
        cs_pdf_to_image.Pdf2Image.Config.DisablePlatformFonts = true;
        cs_pdf_to_image.Pdf2Image.Config.DisableFontMap = true;*/

        cs_pdf_to_image.Pdf2Image.Config.FontPath.Add(cs_pdf_to_image.Pdf2Image.GetProgramFilePath("arial.ttf"));
        cs_pdf_to_image.Pdf2Image.Config.SubstitutionFont = "arial";

`

The result is still not good. I will do more test and tuning to see if can get this fixed. if you have some suggestion, pls also share :)

@nicksuslov
Copy link

In Pdf2Image need set ResolutionX and ResolutionY for PDFConvert. This will increase resolution of the image. I think need to provide additional properties for this in Pdf2Image.

@ghost
Copy link

ghost commented Nov 22, 2019

Yes I know my reply is just toooooo late but it works for me like this so I said to my self why mot posting.

In the Pdf2Image file you should find those lines.

converter.FitPage = true;
converter.JPEGQuality = mPrintQuality; //80
converter.OutputFormat = "tifflzw";
// here you add for a rez of 1700x2200
converter.ResolutionX = 200;
converter.ResolutionY = 200;

That it. hope it helps someone.

@GHNJ
Copy link

GHNJ commented May 20, 2020

Yes I know my reply is just toooooo late but it works for me like this so I said to my self why mot posting.

In the Pdf2Image file you should find those lines.

converter.FitPage = true;
converter.JPEGQuality = mPrintQuality; //80
converter.OutputFormat = "tifflzw";
// here you add for a rez of 1700x2200
converter.ResolutionX = 200;
converter.ResolutionY = 200;

That it. hope it helps someone.

Where do you see these options?

@Up-Yedou
Copy link

Up-Yedou commented Jan 6, 2022

According to my experiment, the following codes helps:
// dpi
converter.ResolutionX = 200;
converter.ResolutionY = 200;
// bit depths - 32bits
converter.OutputFormat = "pngalpha";
// poor effect to modify this
converter.TextAlphaBit = 4;
converter.GraphicsAlphaBit = 4;
// correct location of image
converter.FitPage = false;

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

6 participants