# Get Content Using Postmessage

**URL:** <https://forum.collaboraonline.com/t/get-content-using-postmessage/1861>\
**Category:** Writer\
**Created:** [June 7, 2023, 1:45am UTC](https://forum.collaboraonline.com/t/get-content-using-postmessage/1861 "2023-06-07T01:45:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fawwazid](https://avatars.discourse-cdn.com/v4/letter/f/ad7895/32.png) [@fawwazid](https://forum.collaboraonline.com/u/fawwazid)\
**Post date:** [June 7, 2023, 1:45am UTC](https://forum.collaboraonline.com/t/get-content-using-postmessage/1861/1 "2023-06-07T01:45:04Z")

</div>

Hello,

How to get current contents (e.g. docx, doc, pdf) using PostMessage API?

---

<div class="post-metadata">

**Author:** ![Tex](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@Tex](https://forum.collaboraonline.com/u/Tex)\
**Post date:** [June 8, 2023, 2:45am UTC](https://forum.collaboraonline.com/t/get-content-using-postmessage/1861/2 "2023-06-08T02:45:56Z")

</div>

Hello @fawwazid ,

Thanks for the question + welcome to the forum. 🙂

Did you see the sample programs in the:

- [“Simple Examples” (sdk.collaboraonline.com)](https://sdk.collaboraonline.com/docs/examples.html)

and read through the documentation at:

- [“PostMessage API” (sdk.collaboraonline.com)](https://sdk.collaboraonline.com/docs/postmessage_api.html)

---

<div class="post-metadata">

**Author:** ![fawwazid](https://avatars.discourse-cdn.com/v4/letter/f/ad7895/32.png) [@fawwazid](https://forum.collaboraonline.com/u/fawwazid)\
**Post date:** [June 8, 2023, 4:59am UTC](https://forum.collaboraonline.com/t/get-content-using-postmessage/1861/3 "2023-06-08T04:59:01Z")

</div>

hello @Tex,

I’ve looked at it, but I haven’t found the answer yet.

I mean, I get the content directly and store it in a JavaScript variable.

thank you.

---

<div class="post-metadata">

**Author:** ![Tex](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@Tex](https://forum.collaboraonline.com/u/Tex)\
**Post date:** [June 8, 2023, 10:58am UTC](https://forum.collaboraonline.com/t/get-content-using-postmessage/1861/4 "2023-06-08T10:58:00Z")

</div>

> I get the content directly and store it in a JavaScript variable.

Can you describe a little more of what you’re trying to accomplish?

- You are trying to read in a document (DOCX / ODT / PDF / …) using the API.
- Then you are trying to stick it all into a Javascript variable.
- Then you are ???

Maybe if you describe the goal you are trying to aim for with your program, maybe there’s an alternate way to help or tackle the problem.

* * *

**Side Note:** You may be interested in this article:

- [https://xyproblem.info/](https://xyproblem.info/)

or this funny comic:

- [xkcd: The General Problem](https://xkcd.com/974/)
