diff --git a/php/classes/Floorplanner/Project.php b/php/classes/Floorplanner/Project.php index 7a8ed43..9bb98b8 100644 --- a/php/classes/Floorplanner/Project.php +++ b/php/classes/Floorplanner/Project.php @@ -52,6 +52,31 @@ public function embedScript($div, $token = null, $state = null) { $javascript .= "fp.embed('${div}');\n"; return $javascript; } + + /** + * resolution[width] - The width of the image(s) in pixels (or millimeters for PDF) + * resolution[height] - The height of the image(s) in pixels (or millimeters for PDF) + + Optional: + * send_to - result will be sent to given email address + * callback - After all design images have been exported, the callback URL will receive a POST request containing XML result message + * type - MIME type of requested export format + * paper_scale - Number between 0.002 and 0.02 (PDF only, see design export) + * scaling - if set to 'constant', all designs will be scaled by the same ratio + * scalebar - set to 1 or “true” to include a scale bar in the output image + * black_white - Boolean value (true/false) of whether the output should be in grayscale + */ + public function render($width, $height, $send_to="nobody@example.com") { + $response = $this->apiCall($this->path() . '/render', 'POST', + array('resolution' => array('width'=>$width, 'height'=>$height), + 'send_to' => $send_to) + ); + if (Floorplanner::success($response)) { + var_dump($response); + } else { + throw new Floorplanner_Exception($response); + } + } } diff --git a/php/render_test/config.php b/php/render_test/config.php new file mode 100644 index 0000000..87ffaed --- /dev/null +++ b/php/render_test/config.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/php/render_test/render.php b/php/render_test/render.php new file mode 100644 index 0000000..4aebca2 --- /dev/null +++ b/php/render_test/render.php @@ -0,0 +1,14 @@ +getProject($project_id); + +$renderResponse = $project->render(400, 600); + +var_dump($renderResponse); \ No newline at end of file diff --git a/php/render_test/upload_fml.php b/php/render_test/upload_fml.php new file mode 100644 index 0000000..cbe33b9 --- /dev/null +++ b/php/render_test/upload_fml.php @@ -0,0 +1,12 @@ +createProject($xml); +var_dump($project);