Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading hyperref incorrectly overrides PDF Producer #91

Closed
khaledhosny opened this issue Apr 26, 2019 · 8 comments
Closed

Loading hyperref incorrectly overrides PDF Producer #91

khaledhosny opened this issue Apr 26, 2019 · 8 comments

Comments

@khaledhosny
Copy link

Merely loading hyperref with no other changes, and processing the document with HarfTeX changes the PDF producer from HarfTeX-0.1.1 to LuaTeX-1.10.1.

\documentclass{article}
\usepackage{hyperref}
\begin{document}
Test
\end{document}

Without hyperef:

Creator:        TeX
Producer:       HarfTeX-0.1.1
CreationDate:   Fri Apr 26 19:56:50 2019 EET
ModDate:        Fri Apr 26 19:56:50 2019 EET
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:      2977 bytes
Optimized:      no
PDF version:    1.5

With hyperref:

Title:          
Subject:        
Keywords:       
Author:         
Creator:        LaTeX with hyperref
Producer:       LuaTeX-1.10.1
CreationDate:   Fri Apr 26 19:54:35 2019 EET
ModDate:        Fri Apr 26 19:54:35 2019 EET
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          1
Encrypted:      no
Page size:      612 x 792 pts (letter)
Page rot:       0
File size:      3176 bytes
Optimized:      no
PDF version:    1.5
@davidcarlisle
Copy link
Member

So it does, we could presumably detect harftex and change this, but given that luatex populates the /Producer field anyway it's not clear that hyperref over-writing it by default really helps. It's perhaps a bit different for the original latex/dvips/distiller|ps2pdf route where it is changing the default value.

Specifically I suspect this could be removed from hluatex.def

    \begingroup
      \count@=\luatexversion
      \divide\count@ by 100 %
      \edef\x{\the\count@}%
      \count@=-\x\relax
      \multiply\count@ by 100 %
      \advance\count@ by \luatexversion
      \edef\x{\endgroup
        \def\noexpand\@pdfproducer{%
          LuaTeX-\x.\two@digits\count@.\luatexrevision
        }%
      }%
    \x

@u-fischer ?

@u-fischer
Copy link
Member

Well that's certainly part of the "review pdf resources projekt". Looking at the default output and the one forced by hyperref, I would say that hyperref should at most change the producer for dvips and xetex. All other changes are either unneeded or worse than the default. Perhaps it would be even the best to remove all the settings and leave it to the user, if he wants to change something.

@davidcarlisle ?

/Producer(GPL Ghostscript 9.26) -> /Producer(dvips + GPL Ghostscript 9.26)
/Producer (pdfTeX-1.40.20) -> /Producer(pdfTeX-1.40.20)
/Producer (LuaTeX-1.10.0) ->Producer(LuaTeX-1.10.0)
/Producer (MiKTeX pdfTeX-1.40.20) -> Producer(pdfTeX-1.40.20)
/Producer(xdvipdfmx (20190225)) -> /Producer(XeTeX 0.999991) , /Producer(dvipdfm)

@josephwright
Copy link
Member

On the specific question: we should drop fiddling with /Producer unless requested. (Aside: I suspect we might also want to look at /Creator).

There's a general question here, which I've logged as latex3/latex3#567.

@khaledhosny
Copy link
Author

IMHO, hyperref (or any other package) shouldn’t be changing PDF metadata unless it has to or was explicitly asked to do so.

@josephwright
Copy link
Member

@khaledhosny Well /Creator is inconsistent between engines (compare XeTeX with pdfTeX, for example). I think arguably LaTeX itself should set this one: 'LaTeX2e YYYY-MM-DD' would be reasonable.

@khaledhosny
Copy link
Author

Yes, that would be reasonable for LaTeX code to do, not so much for individual packages.

@davidcarlisle
Copy link
Member

davidcarlisle commented Apr 26, 2019 via email

@u-fischer
Copy link
Member

I removed the setting of the producer field from the drivers. The next hyperref version will give
/Producer (HarfTeX-0.1.1) for your example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants