RFE: empty page #196

Open
opened 2024-05-19 07:29:02 +00:00 by hpa · 3 comments

Sometimes it is desirable to have an empty page inserted into a PDF at certain points, e.g. when the PDF is to be printed two-sided.

Right now, the easiest way to do that in img2pdf seems to be able to insert a very small image (e.g. a 1x1 PNG with a single white pixel), but that is kind of unnecessary. It would seem logical that an empty input file (e.g. /dev/null or NUL:) could insert a completely blank page with no image object at all.

Sometimes it is desirable to have an empty page inserted into a PDF at certain points, e.g. when the PDF is to be printed two-sided. Right now, the easiest way to do that in img2pdf seems to be able to insert a very small image (e.g. a 1x1 PNG with a single white pixel), but that is kind of unnecessary. It would seem logical that an empty input file (e.g. /dev/null or NUL:) could insert a completely blank page with no image object at all.
Owner

I'm not a fan but lets try to spin this thought further. Maybe you manage to convince me. How would this work in practice? Lets say the user runs this:

img2pdf letter.png /dev/null dina4.png

What size would the empty page have?

I'm not a fan but lets try to spin this thought further. Maybe you manage to convince me. How would this work in practice? Lets say the user runs this: img2pdf letter.png /dev/null dina4.png What size would the empty page have?
Author

In my use case, I'm setting --pagesize explicitly, so it is not an issue. However, without a (minimum) page size I agree this could be confusing.

In my use case, I'm setting --pagesize explicitly, so it is not an issue. However, without a (minimum) page size I agree this could be confusing.
Owner

I slept of this and thought a bit more. I think what made me not like this feature is, that I think it should be other tools which are made for PDF manipulation like pdftk who should be responsible for creating empty pages in the right places. But then I learned that pdftk doesn't know how to create an empty page.

So maybe you are right and img2pdf should support this but throw an error if pagesize is not give explicitly.

I'd be open to reviewing patches that implement this.

I slept of this and thought a bit more. I think what made me not like this feature is, that I think it should be other tools which are made for PDF manipulation like pdftk who should be responsible for creating empty pages in the right places. But then I learned that pdftk doesn't know how to create an empty page. So maybe you are right and img2pdf should support this but throw an error if pagesize is not give explicitly. I'd be open to reviewing patches that implement this.
Sign in to join this conversation.
No milestone
No project
No assignees
2 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#196
No description provided.