Org-Mode Documents Can Generate PDFs Which Include Any Data Including Themselves

This Org-Mode document

#+LATEX_HEADER: \usepackage{attachfile}
Jon this is an Org-Mode file which generated a PDF which contains itself.
@@latex:\attachfile{orginorg.org}@@

Generates this pdf that contains itself. Open it with Adobe Acrobat (or some other tool that can handle embedded files).

You can include any data you want inside a PDF using attachfile and it is easy to extract that data.

It is a toy example but you can script everything to work with embedded data in PDF.

Here is the generated LaTeX

% Created 2017-07-24 Mon 21:00
% Intended LaTeX compiler: pdflatex
\documentclass[paper=letter, fontsize=12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{lettrine}
\usepackage{parskip}
\usepackage[margin=1.5in]{geometry}
\usepackage{mathptmx}
\usepackage[english]{babel}
\usepackage{attachfile}
\author{Grant Rettke}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={Grant Rettke},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 25.2.1 (Org mode 9.0.9)},
 pdflang={English}}
\begin{document}
Jon this is an Org-Mode file which generated a PDF which contains itself.
\attachfile{orginorg.org}
\end{document}

2 thoughts on “Org-Mode Documents Can Generate PDFs Which Include Any Data Including Themselves”

Leave a Reply

Your email address will not be published. Required fields are marked *