'Embed a file inside the PDF.
:param str fname: The filename to display.
:param str fdata: The data in the file.
Reference:
https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf
Section 7.11.3'

def addAttachment(self, fname, fdata):

    '    Sample:\n                                8    0    obj\n                                <<\n                                    /Length    12\n                                    /Type    /EmbeddedFile\n                                >>\n                                stream\n                                Hello    world!\n                                endstream\n                                endobj                                \n                                '
    file_entry = DecodedStreamObject()
    file_entry.setData(fdata)
    file_entry.update({NameObject('/Type'): NameObject('/EmbeddedFile')})
    '    Sample:\n                                7    0    obj\n                                <<\n                                    /Type    /Filespec\n                                    /F    (hello.txt)\n                                    /EF    <<    /F    8    0    R    >>\n                                >>\n                                '
    efEntry = DictionaryObject()
    efEntry.update({NameObject('/F'): file_entry})
    filespec = DictionaryObject()
    filespec.update({NameObject('/Type'): NameObject('/Filespec'), NameObject('/F'): createStringObject(fname), NameObject('/EF'): efEntry})
    '    Sample:\n                                1    0    obj\n                                <<\n                                    /Type    /Catalog\n                                    /Outlines    2    0    R\n                                    /Pages    3    0    R\n                                    /Names    <<    /EmbeddedFiles    <<    /Names    [(hello.txt)    7    0    R]    >>    >>\n                                >>\n                                endobj\n                                \n                                '
    embeddedFilesNamesDictionary = DictionaryObject()
    embeddedFilesNamesDictionary.update({NameObject('/Names'): ArrayObject([createStringObject(fname), filespec])})
    embeddedFilesDictionary = DictionaryObject()
    embeddedFilesDictionary.update({NameObject('/EmbeddedFiles'): embeddedFilesNamesDictionary})
    self._root_object.update({NameObject('/Names'): embeddedFilesDictionary})
