3

I'm receiving a PDF in Base64 from an external web service, the PDF is received in JSON along with some other details. Is there anything I can do to avoid the Heap size being blown when converting the JSON to a string? I've already tried using a @future method to increase the Heap to 12MB but the requirements state that a larger PDF may be sent. Without using an external service to deserialize I'm not sure if this is possible. Also, a second PDF may be included within the same payload.

JSON Example:

{
    ID:"xxxx",
    Info: {
      contract: "xxxx",
      Location: "xxxx",
      Code: "xxxx",
      form: "xxxx",
      Action:"xxxx", 
      DateTime: "xxxx",
      Description:"xxxx", 
      PDF1:  "xxxx",
      PDF2: "xxxx"
     }
    }
2

The governor limits are (mostly) absolute. You especially cannot violate the 6MB/12MB limits for callouts. You would need to use an external service (e.g. Heroku, Amazon AWS).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.