Hi,
When I export pdf, it doesn't include any image and there is no error in console. The wonder part is when I reprocess the json file again using same code, it includes images in exported pdf.
Does surveyJs store errors somewhere in this case or what can be the real issue here? How can I fix it?
I would appreciate your help.
Thanks,
Payal
Hello Payal,
How do you store your images? Are they embedded into JSON?
We can embedded images if they embedded as base64 string. Here is the example.
Thank you,
Andrew
SurveyJS Team
Hi Andrew,
Thank you for quick response.
We decode base64 image and store in S3 bucket and before pdf generation we encode the image to base64.
As I mentioned earlier, export pdf works fine with images after reprocessing it again. We use the same code to generate pdf first time and reprocess again.
Also images are not that big. It is just a logo and signature.
Any update on - Does surveyJs store errors somewhere in this case or what can be the real issue here?
Thanks,
Payal
Hello Payal,
If something went wrong during document generation, errors should appear in a browser console. If you don't see any errors in the browser console, this likely means that there were no problems creating a document. However, as you mentioned that you cannot see images, it is possible that the images were unavailable for some reason.
I would suggest ensuring that your images are available in the survey before generating a PDF document.
If you require further assistance, please feel free to share a sample that reproduces the issue.
Thank you.
Hi Jane,
I coudn't reproduce it on my local environment. But I'll double check the order of processing json data.
Thank you for your help!
Payal
No problem, Payal. Please feel free to contact us if you have any questions.
Hi Jane,
When we create a pdf first time, we don't convert base64 string to any images. My apologies! I told you we convert base64 string into images and store into s3 buckets.
So here is the process:
We don't do any customization in this process of generating pdf.
It looks like as below screenshot when it doesn't include signature.
Hello Payal,
Thank you for the update. A signature is actually missing in your screenshot.
I created a Plunker demo for your reference: https://plnkr.co/edit/Zv3Qpz1iKc1wLHWH.
A demo survey contains a Signature Pad question. I subscribe to the
onComplete
function and export a survey to PDF. Please research the demo and let me know if it helps. If you require further assistance, please feel free to share a problematic example so that I can check.