unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.46k stars 250 forks source link

Render method produces poor quality images. #543

Closed danvergara closed 5 months ago

danvergara commented 5 months ago

Description

Render method from render package only produces poor quality images. The images sees blurry and seems the images' size is fixed to 612 × 792 pixels.

Expected Behavior

Higher quality images out pdf pages.

Actual Behavior

I've been consuming the unipdf package as a library, but the easiest way to reproduce this is running the cli.

unipdf render -o images.zip in_file.pdf I got the exact same result.

Attachments

I'm attaching the Bitcoin Whitepaper because that was the pdf file I was testing against and the first one that came to my mind that is free to download.

unipdf render -o bitcoin.zip bitcoin.pdf

bitcoin.pdf

github-actions[bot] commented 5 months ago

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

3ace commented 5 months ago

@danvergara you could set the image width by doing it like this:

device := render.NewImageDevice()
device.OutputWidth = 2048

The height will be calculated accordingly. This is the image output example of it

bitcoin_1

danvergara commented 5 months ago

@3ace That worked for met!

Thanks!