How do convert an image to pdf so it opens in viewable zoom level? #165

Open
opened 11 months ago by Ghost · 6 comments

I've experimented a bit with img2pdf on macos, I can't find a parameter to run it to convert a high res jpg file to a pdf that creates a pdf that doesn't open super zoomed in without any additional changes.

Running img2pdf with --pagesize A4 --fit works, the output pdf is viewable from the start - but it also has a layer of white background on it (the part that doesn't fill the A4 format).

In my experience, neither --viewer-magnification or --viewer-fit-window have any effect on how the output pdf is opened in Preview.

Any solution?

I've experimented a bit with img2pdf on macos, I can't find a parameter to run it to convert a high res jpg file to a pdf that creates a pdf that doesn't open super zoomed in without any additional changes. Running img2pdf with --pagesize A4 --fit works, the output pdf is viewable from the start - but it also has a layer of white background on it (the part that doesn't fill the A4 format). In my experience, neither --viewer-magnification or --viewer-fit-window have any effect on how the output pdf is opened in Preview. Any solution?
Owner

This seems to be a duplicate of #40.

When I implemented the --viewer-magnification option I only duplicated what libre office does when exporting to PDF. In that export dialog, libre office offers to set a viewer magnification. I've done the same in img2pdf such that it produces PDFs with the same metadata as libre office does when this option is used.

But I was never able to find a PDF viewer that respects this option.

This seems to be a duplicate of #40. When I implemented the `--viewer-magnification` option I only duplicated what libre office does when exporting to PDF. In that export dialog, libre office offers to set a viewer magnification. I've done the same in img2pdf such that it produces PDFs with the same metadata as libre office does when this option is used. But I was never able to find a PDF viewer that respects this option.

But I was never able to find a PDF viewer that respects this option.

Just open-source PDF viewers, or also Adobe / Foxit / Master PDF Editor ?

> But I was never able to find a PDF viewer that respects this option. Just open-source PDF viewers, or also Adobe / Foxit / Master PDF Editor ?
Owner

Only the free software viewers. I don't think you can even install Adobe Acrobat on Linux these days (I know it was possible in the past).

Only the free software viewers. I don't think you can even install Adobe Acrobat on Linux these days (I know it was possible in the past).
josch added the
help wanted
label 11 months ago
plagi commented 2 months ago

pdf that doesn't open super zoomed in without any additional changes
--viewer-page-layout single

> pdf that doesn't open super zoomed in without any additional changes `--viewer-page-layout single`
josch commented 2 months ago
Owner

Hi @plagi I'm not sure what you wanted to say with your last message. Can you rephrase? Thank you! :)

Hi @plagi I'm not sure what you wanted to say with your last message. Can you rephrase? Thank you! :)
plagi commented 2 months ago

A question was asked:
How to create a pdf file that does not open in enlarged (super zoomed) form without any additional changes.
My answer:
You need to use the pdf file display setting in the viewer.
--viewer-page-layout single

A question was asked: How to create a pdf file that does not open in enlarged (super zoomed) form without any additional changes. My answer: You need to use the pdf file display setting in the viewer. `--viewer-page-layout single`
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
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: josch/img2pdf#165
Loading…
There is no content yet.