Skip to content

Commit

Permalink
Build file method
Browse files Browse the repository at this point in the history
  • Loading branch information
shadz3rg authored May 9, 2017
1 parent dc9a2ec commit 8f1c7bf
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/PHPStamp/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,18 @@ public function download($fileName = null)
exit;
}
}
}

public function buildFile()
{
$tempArchive = tempnam(sys_get_temp_dir(), 'doc');
if (copy($this->document->getDocumentPath(), $tempArchive) === true) {
$zip = new \ZipArchive();
$zip->open($tempArchive);
$zip->addFromString($this->document->getContentPath(), $this->output->saveXML());
$zip->close();
return $tempArchive;
}

return false;
}
}

0 comments on commit 8f1c7bf

Please sign in to comment.