How to create identical PDF files with xelatex?How to create identical PDF files?prevent xelatex from compressing the output“pdf_open: Not a PDF 1.[1-5] file.” when typesetting TeX file in TextMateInkscape → PDF → includegraphics → XeLaTeX → changed colorsHow to create PDF outlineHow to make LaTeX-PDF as 'machine readable' as Word-PDFDifferences between XeLaTeX and LuaLaTeX embedding fonts (with optical sizes) in PDFHow to create Tagged PDF using XeLaTeXQuestions regarding the distinction between XeTeX and XeLaTeX and how they relate to TeX and LaTeX?Processing multiple files effectively XeLaTeXWhy has my output PDF file pages with heavy/thick font?How to get pdftex to have same PDF output for each run on the same input
Why didn't Miles's spider sense work before?
One verb to replace 'be a member of' a club
Which is the best way to check return result?
Are there any examples of a variable being normally distributed that is *not* due to the Central Limit Theorem?
Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?
Why do bosons tend to occupy the same state?
Do scales need to be in alphabetical order?
Method Does Not Exist error message
Mathematica command that allows it to read my intentions
Can compressed videos be decoded back to their uncompresed original format?
What is a romance in Latin?
Should I cover my bicycle overnight while bikepacking?
How could indestructible materials be used in power generation?
I would say: "You are another teacher", but she is a woman and I am a man
What killed these X2 caps?
What about the virus in 12 Monkeys?
What type of content (depth/breadth) is expected for a short presentation for Asst Professor interview in the UK?
How do I handle a potential work/personal life conflict as the manager of one of my friends?
How do I gain back my faith in my PhD degree?
Can my sorcerer use a spellbook only to collect spells and scribe scrolls, not cast?
What do you call someone who asks many questions?
When (not how or why) to calculate Big O of an algorithm
Bullying boss launched a smear campaign and made me unemployable
How would I stat a creature to be immune to everything but the Magic Missile spell? (just for fun)
How to create identical PDF files with xelatex?
How to create identical PDF files?prevent xelatex from compressing the output“pdf_open: Not a PDF 1.[1-5] file.” when typesetting TeX file in TextMateInkscape → PDF → includegraphics → XeLaTeX → changed colorsHow to create PDF outlineHow to make LaTeX-PDF as 'machine readable' as Word-PDFDifferences between XeLaTeX and LuaLaTeX embedding fonts (with optical sizes) in PDFHow to create Tagged PDF using XeLaTeXQuestions regarding the distinction between XeTeX and XeLaTeX and how they relate to TeX and LaTeX?Processing multiple files effectively XeLaTeXWhy has my output PDF file pages with heavy/thick font?How to get pdftex to have same PDF output for each run on the same input
The question how to create identical PDF files with pdflatex was basically answered in this question already:
How to create identical PDF files?
The catch was to filter out the entry /ID
in the trailer dictionary after the PDF file was created.
I am now forced to use xelatex and there this trick does not work any more, because there are many more changes in the resulting PDF files.
Here is the minimal working example again:
documentclass[11pt,a4paper]article
usepackage[]hyperref
hypersetup
pdfauthor=None,
pdfcreationdate=D:20131010120000,
pdfmoddate=D:20131010120000
begindocument
foo
enddocument
If I now create 2 PDF files, convert them to a hex dump and view the differences...
xelatex mwe.tex; mv mwe.pdf a.pdf; xxd a.pdf > a.bin
xelatex mwe.tex; mv mwe.pdf b.pdf; xxd b.pdf > b.bin
diff -u a.bin b.bin
... then you can see that there are many differences in the resulting PDF files unfortunately.
Is there any way to produce bitwise identical PDF files with xelatex?
The reason I need this is that I'd like to create PDF files for a software release package. Of course the software release package should be identical when the underlaying software and documentation has not been changed.
xetex pdf
add a comment |
The question how to create identical PDF files with pdflatex was basically answered in this question already:
How to create identical PDF files?
The catch was to filter out the entry /ID
in the trailer dictionary after the PDF file was created.
I am now forced to use xelatex and there this trick does not work any more, because there are many more changes in the resulting PDF files.
Here is the minimal working example again:
documentclass[11pt,a4paper]article
usepackage[]hyperref
hypersetup
pdfauthor=None,
pdfcreationdate=D:20131010120000,
pdfmoddate=D:20131010120000
begindocument
foo
enddocument
If I now create 2 PDF files, convert them to a hex dump and view the differences...
xelatex mwe.tex; mv mwe.pdf a.pdf; xxd a.pdf > a.bin
xelatex mwe.tex; mv mwe.pdf b.pdf; xxd b.pdf > b.bin
diff -u a.bin b.bin
... then you can see that there are many differences in the resulting PDF files unfortunately.
Is there any way to produce bitwise identical PDF files with xelatex?
The reason I need this is that I'd like to create PDF files for a software release package. Of course the software release package should be identical when the underlaying software and documentation has not been changed.
xetex pdf
For which use case do you need that?
– buhtz
Oct 3 '16 at 7:39
1
I use a script to create a release from a software: it gets the software from a GIT server, then creates the documentation using xelatex, then puts all this together in a ZIP. If nothing has changed, the result should be bitwise identical. If the PDF documentation is handled under version control as well, then running the script changes the PDFs every time. GIT will then think that the PDF has changed, but they haven't. It's annoying.
– VerTeX
Oct 5 '16 at 10:06
add a comment |
The question how to create identical PDF files with pdflatex was basically answered in this question already:
How to create identical PDF files?
The catch was to filter out the entry /ID
in the trailer dictionary after the PDF file was created.
I am now forced to use xelatex and there this trick does not work any more, because there are many more changes in the resulting PDF files.
Here is the minimal working example again:
documentclass[11pt,a4paper]article
usepackage[]hyperref
hypersetup
pdfauthor=None,
pdfcreationdate=D:20131010120000,
pdfmoddate=D:20131010120000
begindocument
foo
enddocument
If I now create 2 PDF files, convert them to a hex dump and view the differences...
xelatex mwe.tex; mv mwe.pdf a.pdf; xxd a.pdf > a.bin
xelatex mwe.tex; mv mwe.pdf b.pdf; xxd b.pdf > b.bin
diff -u a.bin b.bin
... then you can see that there are many differences in the resulting PDF files unfortunately.
Is there any way to produce bitwise identical PDF files with xelatex?
The reason I need this is that I'd like to create PDF files for a software release package. Of course the software release package should be identical when the underlaying software and documentation has not been changed.
xetex pdf
The question how to create identical PDF files with pdflatex was basically answered in this question already:
How to create identical PDF files?
The catch was to filter out the entry /ID
in the trailer dictionary after the PDF file was created.
I am now forced to use xelatex and there this trick does not work any more, because there are many more changes in the resulting PDF files.
Here is the minimal working example again:
documentclass[11pt,a4paper]article
usepackage[]hyperref
hypersetup
pdfauthor=None,
pdfcreationdate=D:20131010120000,
pdfmoddate=D:20131010120000
begindocument
foo
enddocument
If I now create 2 PDF files, convert them to a hex dump and view the differences...
xelatex mwe.tex; mv mwe.pdf a.pdf; xxd a.pdf > a.bin
xelatex mwe.tex; mv mwe.pdf b.pdf; xxd b.pdf > b.bin
diff -u a.bin b.bin
... then you can see that there are many differences in the resulting PDF files unfortunately.
Is there any way to produce bitwise identical PDF files with xelatex?
The reason I need this is that I'd like to create PDF files for a software release package. Of course the software release package should be identical when the underlaying software and documentation has not been changed.
xetex pdf
xetex pdf
edited Apr 13 '17 at 12:35
Community♦
1
1
asked Apr 17 '15 at 7:20
VerTeXVerTeX
461
461
For which use case do you need that?
– buhtz
Oct 3 '16 at 7:39
1
I use a script to create a release from a software: it gets the software from a GIT server, then creates the documentation using xelatex, then puts all this together in a ZIP. If nothing has changed, the result should be bitwise identical. If the PDF documentation is handled under version control as well, then running the script changes the PDFs every time. GIT will then think that the PDF has changed, but they haven't. It's annoying.
– VerTeX
Oct 5 '16 at 10:06
add a comment |
For which use case do you need that?
– buhtz
Oct 3 '16 at 7:39
1
I use a script to create a release from a software: it gets the software from a GIT server, then creates the documentation using xelatex, then puts all this together in a ZIP. If nothing has changed, the result should be bitwise identical. If the PDF documentation is handled under version control as well, then running the script changes the PDFs every time. GIT will then think that the PDF has changed, but they haven't. It's annoying.
– VerTeX
Oct 5 '16 at 10:06
For which use case do you need that?
– buhtz
Oct 3 '16 at 7:39
For which use case do you need that?
– buhtz
Oct 3 '16 at 7:39
1
1
I use a script to create a release from a software: it gets the software from a GIT server, then creates the documentation using xelatex, then puts all this together in a ZIP. If nothing has changed, the result should be bitwise identical. If the PDF documentation is handled under version control as well, then running the script changes the PDFs every time. GIT will then think that the PDF has changed, but they haven't. It's annoying.
– VerTeX
Oct 5 '16 at 10:06
I use a script to create a release from a software: it gets the software from a GIT server, then creates the documentation using xelatex, then puts all this together in a ZIP. If nothing has changed, the result should be bitwise identical. If the PDF documentation is handled under version control as well, then running the script changes the PDFs every time. GIT will then think that the PDF has changed, but they haven't. It's annoying.
– VerTeX
Oct 5 '16 at 10:06
add a comment |
1 Answer
1
active
oldest
votes
with recent Texlive releases you can use
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
You may also want to set
SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1
the first setting is the epoch setting. That is, the number of seconds since 1970.
E.g., for today (rather than 0 which is the 1st Jan 1970) you could use 1505482364
as found by:
$ date +%s
1505482364
The second if set to 1 (or anything) causes tex commands such as year
to use the specified epoch date rather than the system clock.
The combination of two of them produces reproducible results (after the second run) in texlive2017 using the supplied test file.
First run:
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
Package hyperref Warning: Rerun to get /PageLabels entry.
second run
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
...
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
save pdf
cp pp407.pdf pp407-a.pdf
run again
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
compare
cmp pp407.pdf pp407-a.pdf
No output from cmp
confirming that the files are identical.
1
I thinkSOURCE_DATE_EPOCH_TEX_PRIMITIVES
has been renamed toFORCE_SOURCE_DATE
.
– Ulrike Fischer
1 hour ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f239059%2fhow-to-create-identical-pdf-files-with-xelatex%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
with recent Texlive releases you can use
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
You may also want to set
SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1
the first setting is the epoch setting. That is, the number of seconds since 1970.
E.g., for today (rather than 0 which is the 1st Jan 1970) you could use 1505482364
as found by:
$ date +%s
1505482364
The second if set to 1 (or anything) causes tex commands such as year
to use the specified epoch date rather than the system clock.
The combination of two of them produces reproducible results (after the second run) in texlive2017 using the supplied test file.
First run:
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
Package hyperref Warning: Rerun to get /PageLabels entry.
second run
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
...
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
save pdf
cp pp407.pdf pp407-a.pdf
run again
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
compare
cmp pp407.pdf pp407-a.pdf
No output from cmp
confirming that the files are identical.
1
I thinkSOURCE_DATE_EPOCH_TEX_PRIMITIVES
has been renamed toFORCE_SOURCE_DATE
.
– Ulrike Fischer
1 hour ago
add a comment |
with recent Texlive releases you can use
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
You may also want to set
SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1
the first setting is the epoch setting. That is, the number of seconds since 1970.
E.g., for today (rather than 0 which is the 1st Jan 1970) you could use 1505482364
as found by:
$ date +%s
1505482364
The second if set to 1 (or anything) causes tex commands such as year
to use the specified epoch date rather than the system clock.
The combination of two of them produces reproducible results (after the second run) in texlive2017 using the supplied test file.
First run:
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
Package hyperref Warning: Rerun to get /PageLabels entry.
second run
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
...
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
save pdf
cp pp407.pdf pp407-a.pdf
run again
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
compare
cmp pp407.pdf pp407-a.pdf
No output from cmp
confirming that the files are identical.
1
I thinkSOURCE_DATE_EPOCH_TEX_PRIMITIVES
has been renamed toFORCE_SOURCE_DATE
.
– Ulrike Fischer
1 hour ago
add a comment |
with recent Texlive releases you can use
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
You may also want to set
SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1
the first setting is the epoch setting. That is, the number of seconds since 1970.
E.g., for today (rather than 0 which is the 1st Jan 1970) you could use 1505482364
as found by:
$ date +%s
1505482364
The second if set to 1 (or anything) causes tex commands such as year
to use the specified epoch date rather than the system clock.
The combination of two of them produces reproducible results (after the second run) in texlive2017 using the supplied test file.
First run:
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
Package hyperref Warning: Rerun to get /PageLabels entry.
second run
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
...
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
save pdf
cp pp407.pdf pp407-a.pdf
run again
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
compare
cmp pp407.pdf pp407-a.pdf
No output from cmp
confirming that the files are identical.
with recent Texlive releases you can use
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
You may also want to set
SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1
the first setting is the epoch setting. That is, the number of seconds since 1970.
E.g., for today (rather than 0 which is the 1st Jan 1970) you could use 1505482364
as found by:
$ date +%s
1505482364
The second if set to 1 (or anything) causes tex commands such as year
to use the specified epoch date rather than the system clock.
The combination of two of them produces reproducible results (after the second run) in texlive2017 using the supplied test file.
First run:
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
Package hyperref Warning: Rerun to get /PageLabels entry.
second run
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1 xelatex pp407
produces:
...
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
save pdf
cp pp407.pdf pp407-a.pdf
run again
Output written on pp407.pdf (1 page).
Transcript written on pp407.log.
compare
cmp pp407.pdf pp407-a.pdf
No output from cmp
confirming that the files are identical.
edited 11 mins ago
user49915
736122
736122
answered Sep 15 '17 at 13:41
David CarlisleDavid Carlisle
497k4111441891
497k4111441891
1
I thinkSOURCE_DATE_EPOCH_TEX_PRIMITIVES
has been renamed toFORCE_SOURCE_DATE
.
– Ulrike Fischer
1 hour ago
add a comment |
1
I thinkSOURCE_DATE_EPOCH_TEX_PRIMITIVES
has been renamed toFORCE_SOURCE_DATE
.
– Ulrike Fischer
1 hour ago
1
1
I think
SOURCE_DATE_EPOCH_TEX_PRIMITIVES
has been renamed to FORCE_SOURCE_DATE
.– Ulrike Fischer
1 hour ago
I think
SOURCE_DATE_EPOCH_TEX_PRIMITIVES
has been renamed to FORCE_SOURCE_DATE
.– Ulrike Fischer
1 hour ago
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f239059%2fhow-to-create-identical-pdf-files-with-xelatex%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
For which use case do you need that?
– buhtz
Oct 3 '16 at 7:39
1
I use a script to create a release from a software: it gets the software from a GIT server, then creates the documentation using xelatex, then puts all this together in a ZIP. If nothing has changed, the result should be bitwise identical. If the PDF documentation is handled under version control as well, then running the script changes the PDFs every time. GIT will then think that the PDF has changed, but they haven't. It's annoying.
– VerTeX
Oct 5 '16 at 10:06