{"route":"/en-US-v0.13.1/reference/pdf/embed/","title":"Embed","description":"Documentation for the `embed` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"notes","name":"Notes","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-path","name":"path","children":[]},{"id":"parameters-data","name":"data","children":[]},{"id":"parameters-relationship","name":"relationship","children":[]},{"id":"parameters-mime-type","name":"mime-type","children":[]},{"id":"parameters-description","name":"description","children":[]}]}],"body":{"kind":"func","content":{"path":["pdf"],"name":"embed","title":"Embed","keywords":[],"oneliner":"A file that will be embedded into the output PDF.","element":true,"contextual":false,"deprecation":null,"details":"<p>A file that will be embedded into the output PDF.</p>\n<p>This can be used to distribute additional files that are related to the PDF\nwithin it. PDF readers will display the files in a file listing.</p>\n<p>Some international standards use this mechanism to embed machine-readable\ndata (e.g., ZUGFeRD/Factur-X for invoices) that mirrors the visual content\nof the PDF.</p>\n<h2 id=\"example\">Example</h2>\n<pre><code><span class=\"typ-pol\">#</span><span class=\"typ-pol\">pdf</span><span class=\"typ-punct\">.</span><span class=\"typ-func\">embed</span><span class=\"typ-punct\">(</span>\n  <span class=\"typ-str\">&quot;experiment.csv&quot;</span><span class=\"typ-punct\">,</span>\n  relationship<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;supplement&quot;</span><span class=\"typ-punct\">,</span>\n  mime-type<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;text/csv&quot;</span><span class=\"typ-punct\">,</span>\n  description<span class=\"typ-punct\">:</span> <span class=\"typ-str\">&quot;Raw Oxygen readings from the Arctic experiment&quot;</span><span class=\"typ-punct\">,</span>\n<span class=\"typ-punct\">)</span>\n</code></pre>\n<h2 id=\"notes\">Notes</h2>\n<ul>\n<li>This element is ignored if exporting to a format other than PDF.</li>\n<li>File embeddings are not currently supported for PDF/A-2, even if the\nembedded file conforms to PDF/A-1 or PDF/A-2.</li>\n</ul>","example":null,"self":false,"params":[{"name":"path","details":"<p>The <a href=\"/en-US-v0.13.1/reference/syntax/#paths\">path</a> of the file to be embedded.</p>\n<p>Must always be specified, but is only read from if no data is provided\nin the following argument.</p>","example":null,"types":["str"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false},{"name":"data","details":"<p>Raw file data, optionally.</p>\n<p>If omitted, the data is read from the specified path.</p>","example":null,"types":["bytes"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false},{"name":"relationship","details":"<p>The relationship of the embedded file to the document.</p>\n<p>Ignored if export doesn't target PDF/A-3.</p>","example":null,"types":["none","str"],"strings":[{"string":"source","details":"<p>The PDF document was created from the source file.</p>"},{"string":"data","details":"<p>The file was used to derive a visual presentation in the PDF.</p>"},{"string":"alternative","details":"<p>An alternative representation of the document.</p>"},{"string":"supplement","details":"<p>Additional resources for the document.</p>"}],"default":"<code><span class=\"typ-key\">none</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"mime-type","details":"<p>The MIME type of the embedded file.</p>","example":null,"types":["none","str"],"strings":[],"default":"<code><span class=\"typ-key\">none</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"description","details":"<p>A description for the embedded file.</p>","example":null,"types":["none","str"],"strings":[],"default":"<code><span class=\"typ-key\">none</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true}],"returns":["content"],"scope":[]}}}