Skip to content

Commit

Permalink
Insert description for attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
marceloandrioni committed Apr 29, 2022
1 parent b4725d6 commit 1e9a947
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/topics/attachments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ to one of its test files.

In [1]: pdf = Pdf.open('../tests/resources/fourpages.pdf')

In [1]: filespec = AttachedFileSpec.from_filepath(pdf, Path('../README.md'))
In [1]: filespec = AttachedFileSpec.from_filepath(
...: pdf,
...: Path('../README.md'),
...: description='This is the file description')

In [1]: pdf.attachments['README.md'] = filespec

Expand Down Expand Up @@ -104,6 +107,7 @@ prompt the user to view the attached document. Valid icons and their relative si
...: Name=Name.PushPin,
...: FS=filespec.obj,
...: Rect=icon_location,
...: Contents='This is the file description',
...: )

In [1]: pdf.pages[0].Annots = pdf.make_indirect(Array([
Expand Down

0 comments on commit 1e9a947

Please sign in to comment.