[GH-ISSUE #303] PDF resolution option #132

Closed
opened 2026-02-25 22:34:25 +03:00 by kerem · 9 comments
Owner

Originally created by @v1o on GitHub (Mar 2, 2021).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/303

Hi, is there a way to specify the PDF render resolution?
Thank you.

Originally created by @v1o on GitHub (Mar 2, 2021). Original GitHub issue: https://github.com/flyimg/flyimg/issues/303 Hi, is there a way to specify the PDF render resolution? Thank you.
kerem closed this issue 2026-02-25 22:34:25 +03:00
Author
Owner

@sadok-f commented on GitHub (Mar 3, 2021):

Hi @v1o ,
Thank you for your issue, unfortunately, such an option doesn't exist

<!-- gh-comment-id:789797935 --> @sadok-f commented on GitHub (Mar 3, 2021): Hi @v1o , Thank you for your issue, unfortunately, such an option doesn't exist
Author
Owner

@v1o commented on GitHub (Mar 3, 2021):

Would you be able to point me in the right direction? We could build a custom image with some modified ghostscript params, I'm not really sure where this hook would happen.

<!-- gh-comment-id:789799560 --> @v1o commented on GitHub (Mar 3, 2021): Would you be able to point me in the right direction? We could build a custom image with some modified ghostscript params, I'm not really sure where this hook would happen.
Author
Owner

@v1o commented on GitHub (Mar 3, 2021):

I saw ghostscript being installed in this image and not the base one, but I couldn't find any reference to it in the code.

<!-- gh-comment-id:789802168 --> @v1o commented on GitHub (Mar 3, 2021): I saw ghostscript being installed in this image and not the base one, but I couldn't find any reference to it in the code.
Author
Owner

@sadok-f commented on GitHub (Mar 3, 2021):

The thing is this feature was added by another contributor, I thought also it is using ghostscript but it seems no isn't used.

If you add rf_1 to refresh the image, in the response headers there's one called im-command which shows the full command used to generate the final image.

For the PDF case, it uses imagemagick (it could be imagemagick needs ghostscript to read from the PDF but I'm not sure and I need to debug more).

Since it is a imagemagick cmd, you can increase the quality (default 90) to 100 by adding q_100 option, also you can try to generate a different format such PNG with o_png option.

<!-- gh-comment-id:789815190 --> @sadok-f commented on GitHub (Mar 3, 2021): The thing is this feature was added by another contributor, I thought also it is using `ghostscript ` but it seems no isn't used. If you add `rf_1` to refresh the image, in the response headers there's one called ` im-command` which shows the full command used to generate the final image. For the PDF case, it uses imagemagick (it could be imagemagick needs ghostscript to read from the PDF but I'm not sure and I need to debug more). Since it is a imagemagick cmd, you can increase the quality (default 90) to 100 by adding `q_100` option, also you can try to generate a different format such PNG with `o_png` option.
Author
Owner

@louisl commented on GitHub (Mar 11, 2021):

Was just looking around and saw this. It's been a while since I made that feature. Ghostscript was/is? indeed a requirement for imagemagick to handle PDF's and not used directly as mentioned.

<!-- gh-comment-id:796794690 --> @louisl commented on GitHub (Mar 11, 2021): Was just looking around and saw this. It's been a while since I made that feature. Ghostscript was/is? indeed a requirement for imagemagick to handle PDF's and not used directly as mentioned.
Author
Owner

@sadok-f commented on GitHub (Mar 12, 2021):

Thank you @louisl for clarifying this, maybe we should add it to README file.

<!-- gh-comment-id:797383798 --> @sadok-f commented on GitHub (Mar 12, 2021): Thank you @louisl for clarifying this, maybe we should add it to README file.
Author
Owner

@v1o commented on GitHub (Mar 12, 2021):

Thank you @sadok-f, the rf_1 flag really helped.

I was unable to use quality option for my purpose since ImageMagick uses it in the post-process part of the convert operation.

In the end I've used the -density option which does the trick when used correctly (before the input file).

I've pushed the changes here and updated the documentation as well. If it matches your coding standards I can send over a pull-request.

Again, thank you for your help.

<!-- gh-comment-id:797467141 --> @v1o commented on GitHub (Mar 12, 2021): Thank you @sadok-f, the `rf_1` flag really helped. I was unable to use `quality` option for my purpose since ImageMagick uses it in the post-process part of the convert operation. In the end I've used the [`-density`](https://imagemagick.org/script/command-line-options.php#density) option which does the trick when used correctly (before the input file). I've pushed the changes [here](https://github.com/flyimg/flyimg/compare/main...v1o:pdf-density?expand=1) and updated the documentation as well. If it matches your coding standards I can send over a pull-request. Again, thank you for your help.
Author
Owner

@sadok-f commented on GitHub (Mar 12, 2021):

Thank you @v1o !
Glad to hear you're able to fix that, would be great if you can send the pull request.

<!-- gh-comment-id:797571092 --> @sadok-f commented on GitHub (Mar 12, 2021): Thank you @v1o ! Glad to hear you're able to fix that, would be great if you can send the pull request.
Author
Owner

@v1o commented on GitHub (Mar 12, 2021):

Just sent the pull request.

<!-- gh-comment-id:797674281 --> @v1o commented on GitHub (Mar 12, 2021): Just sent the pull request.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#132
No description provided.