Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section


Panel
titleExport


Panel
titlesaveAs


Note
iconfalse

The saveAs operation will allow you to generate and display a PDF or PNG image file of the currently displayed document. This is useful for exporting displayed data or saving completed forms. This request returns the file path to the resulting PDF (default) or PNG image.  In the below example we return image file path. The extension of the filename does NOT not determine the format of the resulting file.


Code Block
languagejs
themeConfluence
var request = { 
	"type" : "saveAs",
	"data" : { 
				"filename" : "demo.png", // required -- the filename of the created file
				"displayresult" : 0,      // optional -- this is a number, positive to display the file, 0 to simply return data, default is 0
				"format" : "image",  // optional -- this is a string, either "image" or "pdf"-- default is "pdf" 
				"imageformat" : "png" // optional -- this is a string, either "png" or "jpg" -- default is "png"
			}
};

bridge.sendRequest(request, function (results) {
	console.log('Javascript got its response: ' + str(results));
	if (results.type === "saveasResponse")	{
		var imageFilePath = results.data.FilePath;  // the resulting contains the file path to the file
		//do something with the data
	} else if (results.type == 'error') {
		errStr = results.data;
		alert('A problem occurred:\n' + errStr);
	}
});
    



Panel
titleprint


Note
iconfalse

The print operation will allow you to print the currently displayed document using the available system printing resources. This is useful for printing displayed data or saving completed forms (for example, printing to a file, if the option is available)


Code Block
languagejs
var request = { 
	"type" : "print",
	"data" : { 
				// data is empty
			 }
};

bridge.sendRequest(request, function (results) {
   console.log('Javascript got its response: ' + str(results));
   if (results.type === "printResponse")	{
      // success case
   } else if (results.type == 'error') {
         errStr = results.data;
         alert('A problem occurred:\n' + errStr);
   }
});
    




Panel
titleCommunication


Panel
titlemail


Note
iconfalse

The mail API allows you to open a pre-populated draft email composer window. The user can then make any necessary edits and send the email. The user will then be returned to the App running in Pulsar. This API is currently only supported on the iOS Pulsar platform.


Code Block
languagejs
var request = {
	"type" : "mail",
    "data" : { 
                "to"     : [ "list_of@emails.com" ],    // array of emails, optional
                "cc"     : [ "list_of_cc@emails.com" ], // array of emails, optional
                "attach" : [ "/list/of/file/paths" ],   // array of file paths to attach, optional
                "subject": "subject of this email",     // email subject text, optional
                "body"   : "body of the email ",        // body text, optional
            }
}
bridge.sendRequest(request, function (results) {
   console.log('Javascript got its response: ' + str(results));
});
    




...