Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

Commit

Permalink
Improved code formatting quality
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmaron committed Aug 22, 2017
1 parent 8fb62d6 commit 65e61bd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 39 deletions.
4 changes: 0 additions & 4 deletions demo/convert-document.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@
$binaryData = $reportingCloud->convertDocument($sourceFilename, 'PDF');

if ($binaryData) {

var_dump("{$sourceFilename} was converted");

file_put_contents($destinationFilename, $binaryData);

var_dump("And written to {$destinationFilename}");
} else {

var_dump("Error converting {$sourceFilename}");
}

Expand Down
19 changes: 8 additions & 11 deletions demo/find-and-replace-document.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,18 @@
];

$mergeSettings = [

'creation_date' => time(),
'last_modification_date' => time(),

'author' => 'James Henry Trotter',
'creation_date' => time(),
'creator_application' => 'The Giant Peach',
'document_subject' => 'The Old Green Grasshopper',
'document_title' => 'James and the Giant Peach',
'last_modification_date' => time(),
'merge_html' => false,
'remove_empty_blocks' => true,
'remove_empty_fields' => true,
'remove_empty_images' => true,
'remove_trailing_whitespace' => true,

'author' => 'James Henry Trotter',
'creator_application' => 'The Giant Peach',
'document_subject' => 'The Old Green Grasshopper',
'document_title' => 'James and the Giant Peach',

'user_password' => '1',
'user_password' => '1',
];

$binaryData = $reportingCloud->findAndReplaceDocument($findAndReplaceData, 'PDF', null, $sourceFilename, $mergeSettings);
Expand Down
25 changes: 11 additions & 14 deletions demo/merge-document-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ---------------------------------------------------------------------------------------------------------------------

$mergeData = [
0 => [
[
'yourcompany_companyname' => 'Text Control, LLC',
'yourcompany_zip' => '28226',
'yourcompany_city' => 'Charlotte',
Expand Down Expand Up @@ -44,15 +44,15 @@
'recipient_street' => '1 Washington Dr',
'recipient_phone' => '887 267 3356',
'item' => [
0 => [
[
'qty' => '1',
'item_no' => '1',
'item_description' => 'Item description 1',
'item_unitprice' => '2663',
'item_discount' => '20',
'item_total' => '2130.40',
],
1 => [
[
'qty' => '1',
'item_no' => '2',
'item_description' => 'Item description 2',
Expand Down Expand Up @@ -110,21 +110,18 @@
// mergeSettings are set

$mergeSettings = [

'creation_date' => time(),
'last_modification_date' => time(),

'author' => 'James Henry Trotter',
'creation_date' => time(),
'creator_application' => 'The Giant Peach',
'document_subject' => 'The Old Green Grasshopper',
'document_title' => 'James and the Giant Peach',
'last_modification_date' => time(),
'merge_html' => false,
'remove_empty_blocks' => true,
'remove_empty_fields' => true,
'remove_empty_images' => true,
'remove_trailing_whitespace' => true,

'author' => 'James Henry Trotter',
'creator_application' => 'The Giant Peach',
'document_subject' => 'The Old Green Grasshopper',
'document_title' => 'James and the Giant Peach',

'user_password' => '1',
'user_password' => '1',
];

$sourceFilename = REPORTING_CLOUD_DEMO_MEDIA_PATH . '/test_template.tx';
Expand Down
10 changes: 0 additions & 10 deletions demo/template-management.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@
// Uploaded, if it is not

if (!$reportingCloud->templateExists($templateName)) {

var_dump("{$templateName} is not in template storage");

if ($reportingCloud->uploadTemplate($sourceFilename)) {

var_dump("Uploaded {$sourceFilename}");
} else {

var_dump("Error uploading {$sourceFilename}");
}
}
Expand All @@ -50,14 +46,10 @@
$binaryData = $reportingCloud->downloadTemplate($templateName);

if ($binaryData) {

var_dump("{$templateName} was downloaded");

file_put_contents($destinationFilename, $binaryData);

var_dump("{$templateName} was written to {$destinationFilename}");
} else {

var_dump("Error downloading {$templateName}");
}

Expand Down Expand Up @@ -90,10 +82,8 @@
// Delete a template in template storage

if ($reportingCloud->deleteTemplate($templateName)) {

var_dump("{$templateName} was deleted");
} else {

var_dump("Error deleting {$templateName}");
}

Expand Down

0 comments on commit 65e61bd

Please sign in to comment.