How to create identical PDF files with xelatex?How to create identical PDF files?prevent xelatex from...

ssTTsSTtRrriinInnnnNNNIiinngg

Short story with a alien planet, government officials must wear exploding medallions

Detention in 1997

How do I gain back my faith in my PhD degree?

Should I cover my bicycle overnight while bikepacking?

What about the virus in 12 Monkeys?

Is this a hacking script in function.php?

Valid term from quadratic sequence?

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

Why didn't Boeing produce its own regional jet?

Assassin's bullet with mercury

Extract rows of a table, that include less than x NULLs

Can I run a new neutral wire to repair a broken circuit?

Is there a hemisphere-neutral way of specifying a season?

How do conventional missiles fly?

What do you call someone who asks many questions?

How to prevent "they're falling in love" trope

Probability that a draw from a normal distribution is some number greater than another draw from the same distribution

What does “the session was packed” mean in this context?

Method Does Not Exist error message

How do I deal with an unproductive colleague in a small company?

How to show a landlord what we have in savings?

Is there an expression that means doing something right before you will need it rather than doing it in case you might need it?

Forgetting the musical notes while performing in concert



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













9















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}
}
begin{document}
foo
end{document}


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.










share|improve this question

























  • 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


















9















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}
}
begin{document}
foo
end{document}


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.










share|improve this question

























  • 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
















9












9








9








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}
}
begin{document}
foo
end{document}


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.










share|improve this question
















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}
}
begin{document}
foo
end{document}


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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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





















  • 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












1 Answer
1






active

oldest

votes


















9














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.






share|improve this answer





















  • 1





    I think SOURCE_DATE_EPOCH_TEX_PRIMITIVES has been renamed to FORCE_SOURCE_DATE.

    – Ulrike Fischer
    1 hour ago












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
});


}
});














draft saved

draft discarded


















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









9














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.






share|improve this answer





















  • 1





    I think SOURCE_DATE_EPOCH_TEX_PRIMITIVES has been renamed to FORCE_SOURCE_DATE.

    – Ulrike Fischer
    1 hour ago
















9














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.






share|improve this answer





















  • 1





    I think SOURCE_DATE_EPOCH_TEX_PRIMITIVES has been renamed to FORCE_SOURCE_DATE.

    – Ulrike Fischer
    1 hour ago














9












9








9







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.






share|improve this answer















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.







share|improve this answer














share|improve this answer



share|improve this answer








edited just now









user49915

736122




736122










answered Sep 15 '17 at 13:41









David CarlisleDavid Carlisle

497k4111441891




497k4111441891








  • 1





    I think SOURCE_DATE_EPOCH_TEX_PRIMITIVES has been renamed to FORCE_SOURCE_DATE.

    – Ulrike Fischer
    1 hour ago














  • 1





    I think SOURCE_DATE_EPOCH_TEX_PRIMITIVES has been renamed to FORCE_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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

IEEEtran - How to include ORCID in TeX/PDF with PdfLatexIs there a standard way to include ORCID in TeX /...

Cicindela nigrior Przypisy | Menu nawigacyjneCicindela varians unicolorManual for the Identification of the...

Glossaries-extra: Adding glossaries package to “Clas­sicTh­e­sis” template by Dr. André Miede v. 4.6 ...