Add a DocumentBuilder class
awakenweb opened this issue · 0 comments
awakenweb commented
Add a DocumentBuilder class to create documents with a fluent style
...
$docbuilder= new Awakenweb\Livedocx\DocumentBuilder($soapClient);
$docbuilder->createNewPdfDocument('myResume.pdf')
->fromRemoteTemplate('ResumeTemplate.docx')
->withImages([
'photo' => '/home/John/images/my-face.jpg',
...
])
->withBlocks([
'scholarship' => [
['school' => 'MIT', 'year' => '2010' ],
['school' => 'Berkley', 'year' => '2009'],
...
],
'previous jobs' => [
...
]
])
->withValues([
'first_name' => 'John',
'last_name' => 'Doe',
'birth_date' => '12-29-1981',
'city' => 'New York',
...
])
->generate()
->save('/path/to/the/folder/you/want');