[BUG] in 3.03 --keepinfo option fails to keep pdfinfo (title, subject, keywords, author)
Closed this issue · 14 comments
The option --keepinfo
fails to keep pdfinfo (title, subject, keywords, author)
Rewritten to clarify the points :)
Expected
- pdfinfo (title, subject, keywords, author) should be kept.
Problems
- Title will be lost.
- Subject, Keywords, and Author will get extra strings.
- Some symbols like
き[#$%^&_{}~]
will be lost or broken.
How to reproduce
- Prepare
pdfjam
at 9664dd9 andsample.pdf
- Running
produces
pdfjam --keepinfo sample.pdf
sample-pdfjam.pdf
.
Note that an errorpdfjam: sed s/^Title:\\\s\*//: not found
occurs. - Checking these PDFs by pdfinfo results in:
$ pdfinfo sample.pdf Title: X1き[#$%^&_{}~] Sample Title [#$%^&_{}~]1X Subject: X2え[#$%^&_{}~] Test Subject [#$%^&_{}~]2X Keywords: X3る[#$%^&_{}~] Smugged Keywords [#$%^&_{}~]3X Author: X4よ[#$%^&_{}~] Kitchen Author [#$%^&_{}~]4X Creator: Alternative Creator Producer: dvipdfmx (20170318) CreationDate: Mon May 18 17:26:09 2020 JST Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 1 Encrypted: no Page size: 419.53 x 595.28 pts Page rot: 0 File size: 4009 bytes Optimized: no PDF version: 1.5 $ pdfinfo sample-pdfjam.pdf Title: Subject: Subject: X2[&&&&&&&&&] Test Subject [&&&&&&&&&]2X Keywords: Keywords: X3[&&&&&&&&&] Smugged Keywords [&&&&&&&&&]3X Author: Author: X4[&&&&&&&&&] Kitchen Author [&&&&&&&&&]4X Creator: LaTeX with hyperref package Producer: pdfTeX-1.40.18 CreationDate: Mon May 18 17:26:18 2020 JST ModDate: Mon May 18 17:26:18 2020 JST Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 1 Encrypted: no Page size: 595.276 x 841.89 pts (A4) Page rot: 0 File size: 28088 bytes Optimized: no PDF version: 1.5 $
Many thanks @lemniscati for this. I will review it as soon as I can (which might not be for a while, due to other commitments).
@DavidFirth
I believe the PR #33 fixes the pb.
Hope it will be merge soon.
@lemniscati I was talking about the pdfjam: sed s/^Title:\\\s\*//: not found.
issue (which you reported in the first place) which can be fixed by the PR #33.
You're theoretical example should be reported in another issue because the error doesn't occur for "normal" titles (titles not containing the backslash character).
Why would you need to initialize PDF information with a backslash, anyway ?
Thank you @sebma for your patch.
Sorry for my ambiguous description of this issue.
The point is:
The option --keepinfo
fails to keep pdfinfo (title, subject, keywords, author)
Expected
- pdfinfo (title, subject, keywords, author) should be kept.
Problems
- Title will be lost.
- Subject, Keywords, and Author will get extra strings.
- Some symbols like
き[#$%^&_{}~]
will be lost or broken.
How to reproduce
- Prepare
pdfjam
at 9664dd9 andsample.pdf
- Running
produces
pdfjam --keepinfo sample.pdf
sample-pdfjam.pdf
.
Note that an errorpdfjam: sed s/^Title:\\\s\*//: not found
occurs. - Checking these PDFs by pdfinfo results in:
$ pdfinfo sample.pdf Title: X1き[#$%^&_{}~] Sample Title [#$%^&_{}~]1X Subject: X2え[#$%^&_{}~] Test Subject [#$%^&_{}~]2X Keywords: X3る[#$%^&_{}~] Smugged Keywords [#$%^&_{}~]3X Author: X4よ[#$%^&_{}~] Kitchen Author [#$%^&_{}~]4X Creator: Alternative Creator Producer: dvipdfmx (20170318) CreationDate: Mon May 18 17:26:09 2020 JST Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 1 Encrypted: no Page size: 419.53 x 595.28 pts Page rot: 0 File size: 4009 bytes Optimized: no PDF version: 1.5 $ pdfinfo sample-pdfjam.pdf Title: Subject: Subject: X2[&&&&&&&&&] Test Subject [&&&&&&&&&]2X Keywords: Keywords: X3[&&&&&&&&&] Smugged Keywords [&&&&&&&&&]3X Author: Author: X4[&&&&&&&&&] Kitchen Author [&&&&&&&&&]4X Creator: LaTeX with hyperref package Producer: pdfTeX-1.40.18 CreationDate: Mon May 18 17:26:18 2020 JST ModDate: Mon May 18 17:26:18 2020 JST Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 1 Encrypted: no Page size: 595.276 x 841.89 pts (A4) Page rot: 0 File size: 28088 bytes Optimized: no PDF version: 1.5 $
I guess that PR #33 is included by PR #23 , and that PR #24 would be better than #23 (cf. #25 (comment)).
@lemniscati Why not fix one pb. at a time ?
First, the sed quoting pb. according to issue #35 with a merge with PR #33
And then merge PR #24, is that ok ?
@sebma I have no reason to refuse dividing these problems and changes. Thank you.
My description of this issue was bad, so I've rewritten it.
@lemniscati Cool 😄 Thanks 👍
#24 fixes the issue.
"--keepinfo" stop working
@JohnRobson
Please, try the latest version.
And describe the situation and how to reproduce it.