Free Support Forum -

Upload PDF to fill form fields in Salesforce with Aspose.PDF REST API

I’m continuing to work on a perspective add-on for my client, Kenandy - a Salesforce-based ERP. We’ve made some good use of the cloud API for PDFs so far, but I’ve run into an issue I can’t debug from my side. We’re trying to use Aspose to bulk-generate some documents dynamically.

We have a PDF generated using Adobe inDesign (see attached broken.pdf) that we’re trying to use Aspose Cloud to fill form fields in. The PDF opens fine in every PDF reader/editor I can get my hands on. I’ve uploaded that file into Aspose storage using your web interface, and using the REST API I made a duplicate of the document and then download it back using the REST API (I’ve removed the field-fill-in step and upload through API step to try to simplify and debug things).

The file I get back registers as around the same size as the original, but nothing can read/open it.

Now, I took the original file and ran it through, an online PDF editor (see working.pdf). I exported it and replaced the file I uploaded earlier using Aspose’s web-based storage interface. Run the code to copy and download the file and everything works perfectly. With no code change.

I’m confused about why the first PDF is seemingly corrupted. What specifically causes documents to be incompatible with Aspose’s cloud offerings?

I’ve also noticed that the second PDF (working.pdf) loses its background image after I do a PUT to update its fields. Not sure if that would happen with the original since I can’t get that to copy/download yet.

Hi Curtis,

I was not able to reproduce this issue in .NET, Java and PHP. I will try with Salesforce and let you know once done. Can you please also share your code to make sure we are on the same page?

Best Regards,

Sure, I can send the code over. What email address can I send it to?

Hi Curtis,

You can send at

Best Regards,

The issue ended up being on our end with how we were dealing with saving the download into a document within Sales Force. A casting issue was causing corruption that seems to selectively corrupt documents.

Hi Curtis,

Thank you for this information. It is nice to hear from you that the problem has been solved. Please feel free to ask if you have any question regarding Aspose products, we will be happy to help you.