ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Reproducible PDF output
@ 2017-11-11  7:39 N. Raghavendra
  2017-11-11 13:37 ` Pablo Rodriguez
  0 siblings, 1 reply; 7+ messages in thread
From: N. Raghavendra @ 2017-11-11  7:39 UTC (permalink / raw)
  To: ntg-context

I would like to have reproducible PDF output from ConTeXt documents.  I
tried the suggestions at https://tex.stackexchange.com/a/313605/146025
but they did not work.  The PDF output has information like
"ConTeXt.Time", "CreateDate", etc., which depend on the time the source
was processed at.  How do I suppress such temporal information, that is
not supplied by the author, from the PDF output?

Here are my two attempts:

----------------------------------------------------------------------
$ cat example.tex

\pdfinfoomitdate=1
\pdftrailerid{}

\starttext

Hello, world!

\stoptext

$ ( context example.tex && cp example.pdf a && sleep 1 && \
    context example.tex && cp example.pdf b ) > /dev/null && \
    md5sum a b

6a4ac7122bb502062e7ea87be52df166  a
cac1ab3160003526e49da135d77e4eda  b
----------------------------------------------------------------------

----------------------------------------------------------------------
$ cat example.tex

\pdfvariable suppressoptionalinfo \numexpr
        0
    +   1   % PTEX.FullBanner
    +   2   % PTEX.FileName
    +   4   % PTEX.PageNumber
    +   8   % PTEX.InfoDict
    +  16   % Creator
    +  32   % CreationDate
    +  64   % ModDate
    + 128   % Producer
    + 256   % Trapped
    + 512   % ID
\relax

\starttext

Hello, world!

\stoptext

$ ( context example.tex && cp example.pdf a && sleep 1 && \
    context example.tex && cp example.pdf b ) > /dev/null && \
    md5sum a b

2116aeec2b5bed2bfd02d16332700758  a
3204a1a127f139da8d960037a8ba0690  b
----------------------------------------------------------------------

Here is the reason I want reproducible builds.  I keep the source of my
ConTeXt documents under version control.  I also keep their PDF output
under version control because I often find, several years after a
document was written, that I don't have the supporting files needed to
process it; in such a case, until I get the missing supporting files, I
can at least view the PDF output.  Now, even when the source has not
changed, if I run context on it, the PDF output changes, and the version
control system reports the PDF file as modified.  In such a situation, I
have to register the change in the version control system, or revert the
PDF file to its version.  I would like to avoid this extra work.

Thanks and regards,
Raghu.

--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reproducible PDF output
  2017-11-11  7:39 Reproducible PDF output N. Raghavendra
@ 2017-11-11 13:37 ` Pablo Rodriguez
  2017-11-11 19:08   ` N. Raghavendra
  0 siblings, 1 reply; 7+ messages in thread
From: Pablo Rodriguez @ 2017-11-11 13:37 UTC (permalink / raw)
  To: ntg-context

On 11/11/2017 08:39 AM, N. Raghavendra wrote:
> I would like to have reproducible PDF output from ConTeXt documents.  I
> tried the suggestions at https://tex.stackexchange.com/a/313605/146025
> but they did not work.  The PDF output has information like
> "ConTeXt.Time", "CreateDate", etc., which depend on the time the source
> was processed at.  How do I suppress such temporal information, that is
> not supplied by the author, from the PDF output?

Hi Raghu,

"contextjit  --nodates" is your friend here.

No \pdf* commands are required.

I hope it helps,

Pablo


> Here are my two attempts:
> 
> ----------------------------------------------------------------------
> $ cat example.tex
> 
> \pdfinfoomitdate=1
> \pdftrailerid{}
> 
> \starttext
> 
> Hello, world!
> 
> \stoptext
> 
> $ ( context example.tex && cp example.pdf a && sleep 1 && \
>     context example.tex && cp example.pdf b ) > /dev/null && \
>     md5sum a b
> 
> 6a4ac7122bb502062e7ea87be52df166  a
> cac1ab3160003526e49da135d77e4eda  b
> ----------------------------------------------------------------------
> 
> ----------------------------------------------------------------------
> $ cat example.tex
> 
> \pdfvariable suppressoptionalinfo \numexpr
>         0
>     +   1   % PTEX.FullBanner
>     +   2   % PTEX.FileName
>     +   4   % PTEX.PageNumber
>     +   8   % PTEX.InfoDict
>     +  16   % Creator
>     +  32   % CreationDate
>     +  64   % ModDate
>     + 128   % Producer
>     + 256   % Trapped
>     + 512   % ID
> \relax
> 
> \starttext
> 
> Hello, world!
> 
> \stoptext
> 
> $ ( context example.tex && cp example.pdf a && sleep 1 && \
>     context example.tex && cp example.pdf b ) > /dev/null && \
>     md5sum a b
> 
> 2116aeec2b5bed2bfd02d16332700758  a
> 3204a1a127f139da8d960037a8ba0690  b
> ----------------------------------------------------------------------
> 
> Here is the reason I want reproducible builds.  I keep the source of my
> ConTeXt documents under version control.  I also keep their PDF output
> under version control because I often find, several years after a
> document was written, that I don't have the supporting files needed to
> process it; in such a case, until I get the missing supporting files, I
> can at least view the PDF output.  Now, even when the source has not
> changed, if I run context on it, the PDF output changes, and the version
> control system reports the PDF file as modified.  In such a situation, I
> have to register the change in the version control system, or revert the
> PDF file to its version.  I would like to avoid this extra work.
> 
> Thanks and regards,
> Raghu.
> 
> --
> N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
> Harish-Chandra Research Institute, http://www.hri.res.in/
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 


-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reproducible PDF output
  2017-11-11 13:37 ` Pablo Rodriguez
@ 2017-11-11 19:08   ` N. Raghavendra
  2017-11-11 20:06     ` Pablo Rodriguez
  0 siblings, 1 reply; 7+ messages in thread
From: N. Raghavendra @ 2017-11-11 19:08 UTC (permalink / raw)
  To: ntg-context

At 2017-11-11T14:37:33+01:00, Pablo Rodriguez wrote:

> "contextjit  --nodates" is your friend here.
>
> No \pdf* commands are required.
>
> I hope it helps,

Dear Pablo,

Thanks for the answer.  It works.

----------------------------------------------------------------------
$ cat example.tex

\starttext

Hello, world!

\stoptext

$ ( context --nodates example.tex && cp example.pdf a && sleep 1 && \
    context --nodates example.tex && cp example.pdf b ) > /dev/null && \
    md5sum a b

74497066154ebb4df7978719127f1a93  a
74497066154ebb4df7978719127f1a93  b
----------------------------------------------------------------------

Incidentally, is it common to use the contextjit command instead of
context?  The only hint I found at the Wiki is at
http://wiki.contextgarden.net/Running_Mark_IV#Experimental_speedup which
says that the jit flag leads to quicker processing of the source.

Regards,
Raghu.

--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reproducible PDF output
  2017-11-11 19:08   ` N. Raghavendra
@ 2017-11-11 20:06     ` Pablo Rodriguez
  2017-11-12  3:00       ` N. Raghavendra
  2017-11-12  8:37       ` Henning Hraban Ramm
  0 siblings, 2 replies; 7+ messages in thread
From: Pablo Rodriguez @ 2017-11-11 20:06 UTC (permalink / raw)
  To: ntg-context

On 11/11/2017 08:08 PM, N. Raghavendra wrote:
[...]
> $ ( context --nodates example.tex && cp example.pdf a && sleep 1 && \
>     context --nodates example.tex && cp example.pdf b ) > /dev/null && \
>     md5sum a b

I checked it with sha256sum ;-).

> Incidentally, is it common to use the contextjit command instead of
> context?  The only hint I found at the Wiki is at
> http://wiki.contextgarden.net/Running_Mark_IV#Experimental_speedup which
> says that the jit flag leads to quicker processing of the source.

I always use contextjit instead of context, because it’s faster.

Other than speed, I think there is no other difference.

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reproducible PDF output
  2017-11-11 20:06     ` Pablo Rodriguez
@ 2017-11-12  3:00       ` N. Raghavendra
  2017-11-12  8:37       ` Henning Hraban Ramm
  1 sibling, 0 replies; 7+ messages in thread
From: N. Raghavendra @ 2017-11-12  3:00 UTC (permalink / raw)
  To: ntg-context

At 2017-11-11T21:06:22+01:00, Pablo Rodriguez wrote:

> I checked it with sha256sum ;-).

And, why not!

> I always use contextjit instead of context, because it’s faster.
>
> Other than speed, I think there is no other difference.

That's good to know.  I'll try it out.

Regards,
Raghu.

-- 
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reproducible PDF output
  2017-11-11 20:06     ` Pablo Rodriguez
  2017-11-12  3:00       ` N. Raghavendra
@ 2017-11-12  8:37       ` Henning Hraban Ramm
  2017-11-12 16:11         ` Alan Braslau
  1 sibling, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2017-11-12  8:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2017-11-11 um 21:06 schrieb Pablo Rodriguez <oinos@gmx.es>:

> I always use contextjit instead of context, because it’s faster.
> 
> Other than speed, I think there is no other difference.

Sometimes it has its own bugs, like at the moment (at least in last week’s beta) with Lua code.
Sometimes ConTeXtJIT couldn’t find my fonts, where ConTeXt could (maybe an old, solved problem).

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reproducible PDF output
  2017-11-12  8:37       ` Henning Hraban Ramm
@ 2017-11-12 16:11         ` Alan Braslau
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Braslau @ 2017-11-12 16:11 UTC (permalink / raw)
  To: Henning Hraban Ramm; +Cc: mailing list for ConTeXt users

On Sun, 12 Nov 2017 09:37:33 +0100
Henning Hraban Ramm <texml@fiee.net> wrote:

> Am 2017-11-11 um 21:06 schrieb Pablo Rodriguez <oinos@gmx.es>:
> 
> > I always use contextjit instead of context, because it’s faster.
> > 
> > Other than speed, I think there is no other difference.  
> 
> Sometimes it has its own bugs, like at the moment (at least in last
> week’s beta) with Lua code. Sometimes ConTeXtJIT couldn’t find my
> fonts, where ConTeXt could (maybe an old, solved problem).

And luajittex is not *always* faster, as Hans has shown us many times
at meetings, although it is usually faster, I believe. It all depends
on what type of operations one is processing.

Note, as well, that luajittex is not available on all platforms for
now. Luajit cannot be compiled for certain processors (one example is
powerpc).

Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-12 16:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-11  7:39 Reproducible PDF output N. Raghavendra
2017-11-11 13:37 ` Pablo Rodriguez
2017-11-11 19:08   ` N. Raghavendra
2017-11-11 20:06     ` Pablo Rodriguez
2017-11-12  3:00       ` N. Raghavendra
2017-11-12  8:37       ` Henning Hraban Ramm
2017-11-12 16:11         ` Alan Braslau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).