Code
// View file
stardocs.viewer.createView(documentUrl)
.done(function(response) {
var viewerUrl = response.url;
// Load viewerUrl
// Example: $("#view-frame").attr('src', viewerUrl);
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Merge shortlisted files
Code
// Merge files
stardocs.docOperations.merge(documentUrls)
.done(function(response) {
// response.documents[0] contains the merged file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Split selected file at pages 1, 2, rest of the document
Code
// Split PDF file at given page ranges
stardocs.docOperations.splitRange(documentUrl, null, [{range: "1"}, {range: "2"}, {range: "3-"}])
.done(function(response) {
// response.documents array contains the generated file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Split selected file at blank pages
Code
// Split file at every blank page
stardocs.docOperations.splitSeparatorPage(documentUrl)
.done(function(response) {
// response.documents array contains the generated file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Convert shortlisted files to BMP format
Code
// Convert files to BMP image format
stardocs.docOperations.convertToBMP(documentUrls)
.done(function(response) {
// response.documents array contains the converted file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Convert shortlisted files to GIF format
Code
// Convert files to GIF image format
stardocs.docOperations.convertToGIF(documentUrls)
.done(function(response) {
// response.documents array contains the converted file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Convert shortlisted files to JPEG format
Code
// Convert files to JPEG image format
stardocs.docOperations.convertToJPEG(documentUrls)
.done(function(response) {
// response.documents array contains the converted file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Convert shortlisted files to PNG format
Code
// Convert files to PNG image format
stardocs.docOperations.convertToPNG(documentUrls)
.done(function(response) {
// response.documents array contains the converted file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Convert shortlisted files to TIFF format
Code
// Convert files to single-page TIFF image format
stardocs.docOperations.convertToTIFF(documentUrls)
.done(function(response) {
// response.documents array contains the converted file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Convert shortlisted files to multi-page TIFF format
Code
// Convert files to multi-page TIFF image format
stardocs.docOperations.convertToMTIFF("convertToSingleFile", documentUrls)
.done(function(response) {
// response.documents array contains the converted file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Convert shortlisted files to PDF format
Code
// Convert files to PDF format
stardocs.docOperations.convertToPDF("convertToSingleFile", documentUrls)
.done(function(response) {
// response.documents array contains the converted file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Encrypt the selected file
Code
// Encrypt (password protect) PDF file
stardocs.docOperations.encrypt(documentUrl, "existingPassword", "AES_128bit", "newOpenPassword", "newPermissionsPassword")
.done(function(response) {
// response.documents[0] contains the encrypted file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });
Redact text from the selected file
Code
// Redact text from PDF file
stardocs.docOperations.redactText(documentUrl, null, null, "literal", [{ text: "sensitive", caseSensitive: false, wholeWord: true }])
.done(function(response) {
// response.documents[0] contains the modified file details (url, fileName, ...)
})
.fail(function(httpStatusCode, httpErrorMessage, response) { /* Handle error */ });