# Compressed object is corrupt

**URL:** <https://pdfjs.community/t/compressed-object-is-corrupt/1233>\
**Category:** Technical Support\
**Created:** [December 9, 2021, 9:57am UTC](https://pdfjs.community/t/compressed-object-is-corrupt/1233 "2021-12-09T09:57:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user37](https://avatars.discourse-cdn.com/v4/letter/u/e19b73/32.png) [@user37](https://pdfjs.community/u/user37)\
**Post date:** [December 9, 2021, 9:57am UTC](https://pdfjs.community/t/compressed-object-is-corrupt/1233/1 "2021-12-09T09:57:37Z")

</div>

**Which product are you using?**  
PDF.js Express Plus

**PDF.js Express Version**  
8.1.1

**Detailed description of issue**  
I have a password protected pdf file, in which I am adding a custom stamp annotation and saving to a local path. For merging the annotation i am using [https://api.pdfjs.express/xfdf/merge](https://api.pdfjs.express/xfdf/merge) and the saved file is coming as corrupted.  
getting below error,

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/0fe27856f5af4f1652d06ebffb497b396abc0f76.png)

**Expected behaviour**  
I should be able to open/read the output pdf file with added stamp annotation and password protected as original file.

**Does your issue happen with every document, or just one?**  
Issue only for coming for annotating password protected file.

**Link to document**  
{Provide a link to the document in question if possible}

**Code snippet**  
{Provide a relevant code snippet}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [December 9, 2021, 9:57am UTC](https://pdfjs.community/t/compressed-object-is-corrupt/1233/3 "2021-12-09T09:57:42Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [Create image stamp annotations in PDF.js Express - Other examples](https://pdfjs.express/documentation/annotation/create-annotation-stamp#other-examples)
- [Create free text annotations in PDF.js Express - Other examples](https://pdfjs.express/documentation/annotation/create-annotation-free-text#other-examples)
- [Create rectangle annotations in PDF.js Express - Other examples](https://pdfjs.express/documentation/annotation/create-annotation-rectangle#other-examples)

APIs:
- [Core.Annotations.StampAnnotation - addCustomAppearance(doc [, options])](https://pdfjs.express/api/Core.Annotations.StampAnnotation.html#addCustomAppearance__anchor)
- [Core.Tools.RubberStampCreateTool - drawCustomStamp(options)](https://pdfjs.express/api/Core.Tools.RubberStampCreateTool.html#drawCustomStamp__anchor)
- [Core.Annotations.CustomAnnotation - new CustomAnnotation(type [, initializer])](https://pdfjs.express/api/Core.Annotations.CustomAnnotation.html#CustomAnnotation__anchor)

Forums:
- [Create image stamp annotations getting internal server error](https://pdfjs.community/t/create-image-stamp-annotations-getting-internal-server-error/115/1)
- [Anotastion color chnaged when used merge api](https://pdfjs.community/t/anotastion-color-chnaged-when-used-merge-api/799/1)
- [Sometimes rubber stamps aren’t getting loaded on webviewer](https://pdfjs.community/t/sometimes-rubber-stamps-arent-getting-loaded-on-webviewer/260/1)

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [December 9, 2021, 4:17pm UTC](https://pdfjs.community/t/compressed-object-is-corrupt/1233/4 "2021-12-09T16:17:51Z")

</div>

Hey there!

Are you able to send the document to me for testing?

Thanks,  
Logan
