<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DomPDF Archives - Codeplaners</title>
	<atom:link href="https://codeplaners.com/tag/dompdf/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/tag/dompdf/</link>
	<description>Code Solution</description>
	<lastBuildDate>Wed, 01 Jan 2025 06:40:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>

<image>
	<url>https://codeplaners.com/wp-content/uploads/2020/09/cropped-favicon-social-32x32.png</url>
	<title>DomPDF Archives - Codeplaners</title>
	<link>https://codeplaners.com/tag/dompdf/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Add DomPDF Add QR Code to PDF in Laravel</title>
		<link>https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/</link>
					<comments>https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 09 Nov 2024 03:43:45 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<category><![CDATA[DomPDF]]></category>
		<category><![CDATA[DomPDF in laravel]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1653</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:40 amHi dev, Today, i show you how to add DomPDF add QR Code to PDF in laravel. In this article will tell you how to add DomPDF add QR Code to PDF in laravel. you will how to add DomPDF add QR Code to &#8230; <a href="https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/" class="more-link">Continue reading<span class="screen-reader-text"> "How to Add DomPDF Add QR Code to PDF in Laravel"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/">How to Add DomPDF Add QR Code to PDF in Laravel</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:40 am</p><p>Hi dev,</p>
<p>Today, i show you how to add DomPDF add QR Code to PDF in laravel. In this article will tell you how to add DomPDF add QR Code to PDF in laravel. you will how to add DomPDF add QR Code to PDF in laravel. I will show in this example how to integrate QR code PDF. For this we will use two composer packages.</p>
<p>You can also use this example with Laravel 6, Laravel 7, Laravel 8, Laravel 9 and Laravel 10 versions.</p>
<p>So, let’s follow few steps to create example of how to add DomPDF add QR Code to PDF in laravel.</p>
<h3 class="step_code">Step 1: Install Laravel App</h3>
<pre class="brush: php; title: ; notranslate">
composer create-project laravel/laravel example-qrcode
</pre>
<h3 class="step_code">Step 2: Install DomPDF Package</h3>
<pre class="brush: php; title: ; notranslate">
composer require barryvdh/laravel-dompdf
</pre>
<pre class="brush: php; title: ; notranslate">
composer require simplesoftwareio/simple-qrcode
</pre>
<h3 class="step_code">Step 3: Create Controller</h3>
<pre class="brush: php; title: ; notranslate">
php artisan make:controller PDFController
</pre>
<p><strong>app/Http/Controllers/PDFController.php</strong></p>
<pre class="brush: php; title: ; notranslate">
namespace App\Http\Controllers;
    
use Illuminate\Http\Request;
use PDF;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
    
class PDFController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function generatePDF()
    {
        $qrcode = base64_encode(QrCode::format('svg')-&gt;size(200)-&gt;errorCorrection('H')-&gt;generate('string'));
        $data = &#x5B;
            'title' =&gt; 'Welcome to Codeplaners.com',
            'qrcode' =&gt; $qrcode
        ]; 
              
        $pdf = PDF::loadView('myPDF', $data);
  
        return $pdf-&gt;download('codeplaners.pdf');
    }
}
</pre>
<h3 class="step_code">Step 4: Add Route</h3>
<p><strong>routes/web.php</strong></p>
<pre class="brush: php; title: ; notranslate">
use Illuminate\Support\Facades\Route;
  
use App\Http\Controllers\PDFController;

  
Route::get('generate-pdf', &#x5B;PDFController::class, 'generatePDF']);
</pre>
<h3 class="step_code">Step 5: Create View File</h3>
<p><strong>resources/views/myPDF.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;How to Add DomPDF Add QR Code to PDF in Laravel - codeplaners.com&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
  
&lt;div&gt;
    &lt;h1&gt;How to Add DomPDF Add QR Code to PDF in Laravel&lt;/h1&gt;
      
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

Ezoic
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
  
    &lt;img src=&quot;data:image/png;base64,{{ $qrcode }}&quot; alt=&quot;&quot;&gt;
    
&lt;/div&gt;
    
&lt;/body&gt;
&lt;/html&gt;	
</pre>
<h3 class="step_code">Run Laravel App:</h3>
<p><strong>routes/web.php</strong></p>
<pre class="brush: php; title: ; notranslate">
php artisan serve
</pre>
<pre class="brush: php; title: ; notranslate">
http://localhost:8000/generate-pdf
</pre>
<p><strong>I hope it will assist you…</strong></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/">How to Add DomPDF Add QR Code to PDF in Laravel</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/how-to-add-dompdf-add-qr-code-to-pdf-in-laravel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
