# Widget to embed document

**URL:** <https://discuss.tryton.org/t/widget-to-embed-document/3894>\
**Category:** Feature\
**Created:** [March 5, 2021, 12:43pm UTC](https://discuss.tryton.org/t/widget-to-embed-document/3894 "2021-03-05T12:43:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [March 5, 2021, 12:43pm UTC](https://discuss.tryton.org/t/widget-to-embed-document/3894/1 "2021-03-05T12:43:19Z")

</div>

## Rational

The `Binary` field can be displayed with the `image` widget but sometimes the content that we want to display is not an image but a document like a PDF.

## Proposal

We add a new type `document` of widget for `<form/>`. It tries to display the content of a `Binary` field without any edition.  
For sao we could use the [`<object/>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object) tag which support many types (depending of the browser).  
For tryton we could use the [Evince](https://wiki.gnome.org/Apps/Evince)[View](https://developer.gnome.org/libevview/stable/) (which is not very well documented).

This widget would be used for the attachment instead of the `image`.

## Implementation

- [Add document widget (#10173) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue10173)

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [April 24, 2021, 4:00pm UTC](https://discuss.tryton.org/t/widget-to-embed-document/3894/2 "2021-04-24T16:00:04Z")

</div>

Closed on April 24, 2021, 4:00pm UTC

This topic was automatically closed after 14 days. New replies are no longer allowed.
