Convert PDF Form to Blob, Base64 URL, or Raw PDF

Edit in →

Besides being able to download fillable survey forms as document files in a traditional PDF format, you can get them in other formats as well. These formats are mainly used to display PDF content in HTML inline, transfer PDF forms over the web, or store them in a database. This example shows how to get raw PDF content or convert it to Blob or a Base64-encoded data URL. Read more...

Sorry, we can't retrieve the data from server. Please comeback later.

Besides being able to download fillable survey forms as document files in a traditional PDF format, you can get them in other formats as well. These formats are mainly used to display PDF content in HTML inline, transfer PDF forms over the web, or store them in a database. This example shows how to get raw PDF content or convert it to Blob or a Base64-encoded data URL.

Get Raw PDF Content

You can get a string value that includes document metadata and content according to the PDF specification. To do this, call the raw(type) method without arguments:

surveyPDF.raw().then((rawcontent) => {
  // ...
});

Convert PDF to Blob

A Blob (or Binary Large Object) is an array of binary data. The Blob format is designed primarily to store images, video, and other multimedia content. To export a PDF document as a Blob or Blob URL, pass "blob" or "bloburl" to the raw(type) method of a SurveyPDF instance:

surveyPDF.raw("blob").then((blob) => {
  // ...
});
surveyPDF.raw("bloburl").then((bloburl) => {
  // ...
});

This demo shows how you can save an editable PDF document directly (by calling the save() method) or by getting a Blob URL first.

Convert PDF to Base64 Data URL

A Base64 Data URL is a string that contains Base64-encoded binary data preceded by the word data, an MIME type that indicates the data type, and an optional base64 prefix for non-textual data. Data URLs are mostly used to insert media content into HTML inline. Refer to the following MDN article for more information: Data URLs.

To get a survey PDF file as a data URL, pass "dataurlstring" to the raw(type) method:

surveyPDF.raw("dataurlstring").then((dataurlstring) => {
  // ...
});

This demo uses a data URL to display a preview of a survey PDF file.

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.