How can I know if a PDF file was created via LaTeX or XeLaTeX?


For example, pdfinfo (part of poppler) can show you Creator and Producer. I get the following, for a PDF file created by XeTeX (with the xelatex command):

Creator:         XeTeX output 2019.06.27:0505
Producer:       xdvipdfmx (20180217)

Created by LuaTeX (with lualatex):

Creator:        TeX
Producer:       LuaTeX-1.07.0

Created by pdfTeX, with latex followed by dvipdfm:

Creator:         TeX output 2019.06.27:0505
Producer:       dvipdfmx (20180217)

For a file created by TextEdit on macOS with “Export as PDF”:

Creator:        TextEdit
Producer:       macOS Version 10.14.5 (Build 18F132) Quartz PDFContext

For a file created with my browser's Print as PDF:

Creator:        Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
Producer:       Skia/PDF m75


You don't have to use pdfinfo; other tools that show PDF properties should show the same data.

Also note that these are only the defaults; if someone wishes and knows how, they can set the properties to anything.

On the Mac, you can click on your pdf file in the Finder, and then do "Get Info" from the Finder menu (which is also the Command + "i" key).

You will see in the Get Info if it is created by pdfTeX. For instance, I just checked such a file, and it says:

Content Creator: TeX Encoding software: pdfTeX-1.40.20