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

Detention in 1997

Bullying boss launched a smear campaign and made me unemployable

Mathematica command that allows it to read my intentions

How dangerous is XSS?

What method can I use to design a dungeon difficult enough that the PCs can't make it through without killing them?

Why can't we play rap on piano?

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

Would Slavery Reparations be considered Bills of Attainder and hence Illegal?

How seriously should I take size and weight limits of hand luggage?

GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?

Arrow those variables!

Can a virus destroy the BIOS of a modern computer?

Can compressed videos be decoded back to their uncompresed original format?

In 'Revenger,' what does 'cove' come from?

Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?

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

Do UK voters know if their MP will be the Speaker of the House?

Expand and Contract

Which is the best way to check return result?

What is the most common color to indicate the input-field is disabled?

How can saying a song's name be a copyright violation?

How do conventional missiles fly?

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

Plagiarism or not?



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

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.










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

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.










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

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.










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

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






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 26 mins ago









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

Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

Join wedge with single bond in chemfigHow to make only one part of double bond bold with chemfig?Crossing bonds in chemfigjoining atoms in chemfig. Two adjacent molculesHow do I selectively change bond length in chemfig?Ugly bond joints in chemfigchemfig: reaction above arrowUsing the mhchem and chemfig packages in conjunctionBonding to specific element letter using chemfigResonance hybrids in chemfigScale chemfig molecule in beamer with tikzWhy does this chemfig bond with a hook start in the middle of the atom?

Are small insurances worth itIs insurance worth it if you can afford to replace the item? If not, when is it?Is accident insurance worth it for my kids who play sportsIs insuring property for more than it is worth allowed?At what point does it become worth it to file an insurance claim?Are wage loss insurance programs worth the cost compared to having an emergency fund?When is an event worth insuring against?Is insurance worth it if you can afford to replace the item? If not, when is it?FHA loan just commenced : Any way to get any of the up-front mortgage insurance back?Which types of insurances do I need to buy?Should I carry less renter's insurance if I can self-insure?Mortgage Adviser Signed Me Up For Multiple Home and Life Insurances (UK)Why many travel insurances don't cover country of nationality?