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













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 11 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

How should I use the fbox command correctly to avoid producing a Bad Box message?How to put a long piece of text in a box?How to specify height and width of fboxIs there an arrayrulecolor-like command to change the rule color of fbox?What is the command to highlight bad boxes in pdf?Why does fbox sometimes place the box *over* the graphic image?how to put the text in the boxHow to create command for a box where text inside the box can automatically adjust?how can I make an fbox like command with certain color, shape and width of border?how to use fbox in align modeFbox increase the spacing between the box and it content (inner margin)how to change the box height of an equationWhat is the use of the hbox in a newcommand command?

Doxepinum Nexus interni Notae | Tabula navigationis3158DB01142WHOa682390"Structural Analysis of the Histamine H1 Receptor""Transdermal and Topical Drug Administration in the Treatment of Pain""Antidepressants as antipruritic agents: A review"

inputenc: Unicode character … not set up for use with LaTeX The Next CEO of Stack OverflowEntering Unicode characters in LaTeXHow to solve the `Package inputenc Error: Unicode char not set up for use with LaTeX` problem?solve “Unicode char is not set up for use with LaTeX” without special handling of every new interesting UTF-8 characterPackage inputenc Error: Unicode character ² (U+B2)(inputenc) not set up for use with LaTeX. acroI2C[I²C]package inputenc error unicode char (u + 190) not set up for use with latexPackage inputenc Error: Unicode char u8:′ not set up for use with LaTeX. 3′inputenc Error: Unicode char u8: not set up for use with LaTeX with G-BriefPackage Inputenc Error: Unicode char u8: not set up for use with LaTeXPackage inputenc Error: Unicode char ́ (U+301)(inputenc) not set up for use with LaTeX. includePackage inputenc Error: Unicode char ̂ (U+302)(inputenc) not set up for use with LaTeX. … $widehatleft (OA,AA' right )$Package inputenc Error: Unicode char â„¡ (U+2121)(inputenc) not set up for use with LaTeX. printbibliography[heading=bibintoc]Package inputenc Error: Unicode char − (U+2212)(inputenc) not set up for use with LaTeXPackage inputenc Error: Unicode character α (U+3B1) not set up for use with LaTeXPackage inputenc Error: Unicode characterError: ! Package inputenc Error: Unicode char ⊘ (U+2298)(inputenc) not set up for use with LaTeX