Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

PDF Binary stream's REST response is corrupted

SA-86126

Summary



A REST Connector is used to receive a binary stream with a PDF document in the response. While converting the stream to PDF, a blank document is generated.


Error Messages



Not Applicable


Steps to Reproduce

  1. Create a REST Connector.
  2. Configure the POST method to receive the binary stream of the PDF in the response and map it to a Text property.
  3. Use the out-of-the-box base64encode function to generate the base64 string.
  4. Generate a PDF from the generated string.


Root Cause



Incorrect headers were sent with the response.


Resolution



Perform the following local-change:

Modify the headers to be sent as below:

Content-Typeapplication/octet-stream; charset=UTF-8

Content-Dispositionattachment; filename=some_name.pdf

Published August 15, 2019 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us