mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Implement embed documents on pdf
This commit is contained in:
parent
e5997128d6
commit
b25f58db6f
@ -12,21 +12,22 @@
|
||||
|
||||
namespace App\Utils;
|
||||
|
||||
use App\Helpers\Epc\EpcQrGenerator;
|
||||
use App\Helpers\SwissQr\SwissQrGenerator;
|
||||
use App\Models\Country;
|
||||
use App\Models\CreditInvitation;
|
||||
use App\Models\GatewayType;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use App\Models\QuoteInvitation;
|
||||
use App\Models\RecurringInvoiceInvitation;
|
||||
use App\Utils\Traits\AppSetup;
|
||||
use App\Utils\Traits\DesignCalculator;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Exception;
|
||||
use App\Models\Account;
|
||||
use App\Models\Country;
|
||||
use App\Models\GatewayType;
|
||||
use App\Utils\Traits\AppSetup;
|
||||
use App\Models\QuoteInvitation;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Models\CreditInvitation;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use App\Helpers\Epc\EpcQrGenerator;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use App\Utils\Traits\DesignCalculator;
|
||||
use App\Helpers\SwissQr\SwissQrGenerator;
|
||||
use App\Models\RecurringInvoiceInvitation;
|
||||
|
||||
class HtmlEngine
|
||||
{
|
||||
@ -1013,14 +1014,14 @@ html {
|
||||
*/
|
||||
protected function generateEntityImagesMarkup()
|
||||
{
|
||||
// if ($this->client->getSetting('embed_documents') === false) {
|
||||
// if (!$this->client->getSetting('embed_documents') && !$this->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
|
||||
$container = $dom->createElement('div');
|
||||
$container->setAttribute('style', 'display:grid; grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr);');
|
||||
$container->setAttribute('style', 'display:grid; grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr);justify-items: center;');
|
||||
|
||||
foreach ($this->entity->documents as $document) {
|
||||
if (!$document->isImage()) {
|
||||
@ -1030,7 +1031,7 @@ html {
|
||||
$image = $dom->createElement('img');
|
||||
|
||||
$image->setAttribute('src', "data:image/png;base64,".base64_encode($document->getFile()));
|
||||
$image->setAttribute('style', 'max-height: 100px; margin-top: 20px;');
|
||||
$image->setAttribute('style', 'max-width: 50%; margin-top: 20px;');
|
||||
|
||||
$container->appendChild($image);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user