Laravel Snappy PDF

Related tags

PDF laravel-snappy
Overview

Snappy PDF/Image Wrapper for Laravel 5 and Lumen 5.1

This package is a ServiceProvider for Snappy: https://github.com/KnpLabs/snappy.

Wkhtmltopdf Installation

Choose one of the following options to install wkhtmltopdf/wkhtmltoimage.

  1. Download wkhtmltopdf from here;
  2. Or install as a composer dependency. See wkhtmltopdf binary as composer dependencies for more information.

Attention! Please note that some dependencies (libXrender for example) may not be present on your system and may require manual installation.

Testing the wkhtmltopdf installation

After installing you should be able to run wkhtmltopdf from the command line / shell.

If you went for the second option the binaries will be at /vendor/h4cc/wkhtmltoimage-amd64/bin and /vendor/h4cc/wkhtmltopdf-amd64/bin.

Attention vagrant users!

Move the binaries to a path that is not in a synced folder, for example:

cp vendor/h4cc/wkhtmltoimage-amd64/bin/wkhtmltoimage-amd64 /usr/local/bin/
cp vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 /usr/local/bin/

and make it executable:

chmod +x /usr/local/bin/wkhtmltoimage-amd64 
chmod +x /usr/local/bin/wkhtmltopdf-amd64

This will prevent the error 126.

Package Installation

Require this package in your composer.json and update composer.

composer require barryvdh/laravel-snappy

Laravel

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider/Facade. If you also use laravel-dompdf, watch out for conflicts. It could be better to manually register the Facade.

After updating composer, add the ServiceProvider to the providers array in config/app.php

Barryvdh\Snappy\ServiceProvider::class,

Optionally you can use the Facade for shorter code. Add this to your facades:

'PDF' => Barryvdh\Snappy\Facades\SnappyPdf::class,
'SnappyImage' => Barryvdh\Snappy\Facades\SnappyImage::class,

Finally you can publish the config file:

php artisan vendor:publish --provider="Barryvdh\Snappy\ServiceProvider"

Snappy config file

The main change to this config file (config/snappy.php) will be the path to the binaries.

For example, when loaded with composer, the line should look like:

'binary' => base_path('vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64'),

If you followed the vagrant steps, the line should look like:

'binary'  => '/usr/local/bin/wkhtmltopdf-amd64',

For windows users you'll have to add double quotes to the bin path for wkhtmltopdf:

'binary' => '"C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf"'

Lumen

In bootstrap/app.php add:

class_alias('Barryvdh\Snappy\Facades\SnappyPdf', 'PDF');
$app->register(Barryvdh\Snappy\LumenServiceProvider::class);

Optionally, add the facades like so:

class_alias(Barryvdh\Snappy\Facades\SnappyPdf::class, 'PDF');
class_alias(Barryvdh\Snappy\Facades\SnappyImage::class, 'SnappyImage');

To customise the configuration file, copy the file /vendor/barryvdh/laravel-snappy/config/snappy.php to the /config folder.

Usage

You can create a new Snappy PDF/Image instance and load a HTML string, file or view name. You can save it to a file, or inline (show in browser) or download.

Using the App container:

$snappy = App::make('snappy.pdf');
//To file
$html = '<h1>Bill</h1><p>You owe me money, dude.</p>';
$snappy->generateFromHtml($html, '/tmp/bill-123.pdf');
$snappy->generate('http://www.github.com', '/tmp/github.pdf');
//Or output:
return new Response(
    $snappy->getOutputFromHtml($html),
    200,
    array(
        'Content-Type'          => 'application/pdf',
        'Content-Disposition'   => 'attachment; filename="file.pdf"'
    )
);

Using the wrapper:

$pdf = App::make('snappy.pdf.wrapper');
$pdf->loadHTML('<h1>Test</h1>');
return $pdf->inline();

Or use the facade:

$pdf = PDF::loadView('pdf.invoice', $data);
return $pdf->download('invoice.pdf');

You can chain the methods:

return PDF::loadFile('http://www.github.com')->inline('github.pdf');

You can change the orientation and paper size

PDF::loadHTML($html)->setPaper('a4')->setOrientation('landscape')->setOption('margin-bottom', 0)->save('myfile.pdf')

If you need the output as a string, you can get the rendered PDF with the output() function, so you can save/output it yourself.

See the wkhtmltopdf manual for more information/settings.

Testing - PDF fake

As an alternative to mocking, you may use the PDF facade's fake method. When using fakes, assertions are made after the code under test is executed:

<?php

namespace Tests\Feature;

use Tests\TestCase;
use PDF;

class ExampleTest extends TestCase
{
    public function testPrintOrderShipping()
    {
        PDF::fake();
        
        // Perform order shipping...
        
        PDF::assertViewIs('view-pdf-order-shipping');
        PDF::assertSee('Name');
    }
}

Other available assertions:

PDF::assertViewIs($value);
PDF::assertViewHas($key, $value = null);
PDF::assertViewHasAll(array $bindings);
PDF::assertViewMissing($key);
PDF::assertSee($value);
PDF::assertSeeText($value);
PDF::assertDontSee($value);
PDF::assertDontSeeText($value);
PDF::assertFileNameIs($value);

License

This Snappy Wrapper for Laravel is open-sourced software licensed under the MIT license

Comments
  • exceeded the timeout of 60 seconds ?

    exceeded the timeout of 60 seconds ?

    Hi, I'm having a hard time making this work and don't know what to check.

    Symfony \ Component \ Process \ Exception \ ProcessTimedOutException The process "/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf --lowquality '/tmp/knp_snappy539a1b5171a923.27143750.html' '/tmp/knp_snappy539a1b5171b010.24930374.pdf'" exceeded the timeout of 60 seconds.

    Thats been thrown.

    Any ideas? I already check that the bin is working

    Thanks for any help =)

    opened by joruzani 38
  • The exit status code '126'

    The exit status code '126'

    Hi,

    I have some strange exception related with wkhtmltopdf driver premissions.

    The exit status code '126' says something went wrong: stderr: "sh: 1: /vendor/project_name/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64: Permission denied " stdout: "" command: /opt/project_name/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality '/tmp/knp_snappy53bc0f6b50a847.44217361.html' '/opt/project_name/app/storage/tmp/bill-123.pdf'.

    Example code I'm using: $snappy = \App::make('snappy.pdf'); $snappy->generateFromHtml('<h1>Bill</h1><p>You owe me money, dude.</p>', storage_path().'/tmp/bill-123.pdf');

    Thank you for any guidance.

    stale 
    opened by mintaras 36
  • SSL resources not loading

    SSL resources not loading

    I am trying to load a view which generates charts and bars using google charts library, because the chart library is hosted on google server with an SSL, I get the following error :

    (1/1) RuntimeException

    The exit status code '1' says something went wrong: stderr: "Loading pages (1/6) [> ] 0% [======> ] 10% QSslSocket: cannot resolve CRYPTO_num_locks QSslSocket: cannot resolve CRYPTO_set_id_callback QSslSocket: cannot resolve CRYPTO_set_locking_callback QSslSocket: cannot resolve sk_free QSslSocket: cannot resolve sk_num QSslSocket: cannot resolve sk_pop_free QSslSocket: cannot resolve sk_value QSslSocket: cannot resolve SSL_library_init QSslSocket: cannot resolve SSL_load_error_strings QSslSocket: cannot resolve SSLv3_client_method QSslSocket: cannot resolve SSLv23_client_method QSslSocket: cannot resolve SSLv3_server_method QSslSocket: cannot resolve SSLv23_server_method QSslSocket: cannot resolve X509_STORE_CTX_get_chain QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf QSslSocket: cannot resolve SSLeay QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function sk_num [===============> ] 25% [=====================> ] 36% [=========================> ] 43% QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init Warning: Failed to load https://www.gstatic.com/charts/45.2/loader.js (ignore) [============================================================] 100% Counting pages (2/6) [============================================================] Object 1 of 1 Resolving links (4/6) [============================================================] Object 1 of 1 Loading headers and footers (5/6) Printing pages (6/6) [> ] Preparing [===================> ] Page 1 of 3 [=======================================> ] Page 2 of 3 [============================================================] Page 3 of 3 Done Exit with code 1 due to network error: ContentNotFoundError QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback " stdout: "" command: /usr/local/bin/wkhtmltopdf-amd64 --lowquality '/tmp/knp_snappy59719aad573823.86128540.html' '/tmp/knp_snappy59719aad573c74.43593591.pdf'.

    Just so you know, following is my code which I have tried

    //return view('pdf.reports', compact('merged', 'request', 'marketplaces', 'brands', 'title', 'type'));
            //$pdf = App::make('snappy.pdf');
            return SnappyPdf::loadView('pdf.reports', ['merged' => $merged, 'request' => $request, 'marketplaces' => $marketplaces, 'brands' => $brands, 'title' => $title, 'type' => $title])->inline('page.pdf');
            //$pdf = SnappyPdf::loadView('pdf.reports', compact('merged', 'request', 'marketplaces', 'brands', 'title', 'type'));
            //return $pdf->download();
    

    and the error is because of SSL is my wild guess, I just tried to load a simple view which also didnt work

    opened by khanof89 32
  • The exit status code '1' says something went wrong: stderr:

    The exit status code '1' says something went wrong: stderr: "The system cannot find the path specified. "

    I m using this code in controller but i m facing this error

    public function getPDF()
    {
        $pdf = PDF::loadView('ab');
        return $pdf->download('invoice.pdf');
    }
    

    error

    The exit status code '1' says something went wrong: stderr: "The system cannot find the path specified. " stdout: "" command: /usr/local/bin/wkhtmltopdf --lowquality "C:\Users\Admin\AppData\Local\Temp\knp_snappy552137b1a973a8.95135225.html" "C:\Users\Admin\AppData\Local\Temp\knp_snappy552137b1aa4969.49985920.pdf".

    capture

    stale 
    opened by umairali 32
  • The exit status code '127' says something went wrong: stderr:

    The exit status code '127' says something went wrong: stderr: "sh: 1: /usr/local/bin/wkhtmltopdf: not found

    I am using laravel-snappy in Laravel 5.0 on Ubuntu 14.04. I installed laravel-snappy and wkhtmltopdf via composer. But when I tried to use it in one of the method, this is the error i am getting:

    RuntimeException in AbstractGenerator.php line 336: The exit status code '127' says something went wrong: stderr: "sh: 1: /usr/local/bin/wkhtmltopdf: not found " stdout: "" command: /usr/local/bin/wkhtmltopdf --lowquality --orientation 'portrait' --page-size 'a4' '/tmp/knp_snappy55fbeb8b97a097.69359150.html' '/tmp/knp_snappy55fbeb8b97a8d0.78089447.pdf'.

    I need to change the path? How can I change the path? I can't find any section of code referring to laravel snappy or wkhtmltopdf. I need help. Thank you.

    stale 
    opened by aacsssh 31
  • The process has been signaled with signal

    The process has been signaled with signal "11"

    OS: CentOS Linux 7.0.1406 Laravel 5.1

    Hi,

    I have installed wkhtmltopdf directly and it runs fine from the command line.

    However, when using this package I get the following error (truncated to the first few lines):

    RuntimeException in Process.php line 367:
    The process has been signaled with signal "11".
    
    1. in Process.php line 367
    2. at Process->wait() in Process.php line 210
    3. at Process->run() in AbstractGenerator.php line 475
    4. at AbstractGenerator->executeCommand('/usr/local/bin/wkhtmltopdf --lowquality '/tmp/knp_snappy559fd7e4d812d7.68804302.html' '/tmp/knp_snappy559fd7e4d827b6.83747916.pdf'')  in AbstractGenerator.php line 147
    5. at AbstractGenerator->generate(array('/tmp/knp_snappy559fd7e4d812d7.68804302.html'), '/tmp/knp_snappy559fd7e4d827b6.83747916.pdf', array(), false) in Pdf.php line 57
    6. at Pdf->generate(array('/tmp/knp_snappy559fd7e4d812d7.68804302.html'), '/tmp/knp_snappy559fd7e4d827b6.83747916.pdf', array()) in AbstractGenerator.php line 177
    7. at AbstractGenerator->getOutput(array('/tmp/knp_snappy559fd7e4d812d7.68804302.html'), array()) in AbstractGenerator.php line 198
    ...
    

    These files are never written to the /tmp/ directory - it has drwxrwxrwt permissions, and I can write to this directory from the command line with wkhtmltopdf.

    The controller function is set up very simply, and the correct variables are being passed according to the error logs:

    public function pdf($vars)
        {
            $pdf = PDF::loadView('pdf', compact('vars'));
            return $pdf->download('example.pdf');
        }
    

    The snappy.php config file is pointing correctly to usr/local/bin/wkhtmltopdf.

    Any help or guidance would be greatly appreciated!

    stale 
    opened by samdiamond 24
  • Google charts not rendering in PDF

    Google charts not rendering in PDF

    I could not figure out how to make Google Visualization Charts load in my pdf.

    I tried with a high javascript-delay but still not working. Rendering the view works fine though.

    Thanks

        $pdf = \PDF::loadView('invoice', compact('data'));
    
        $pdf->setOptions([
                'enable-javascript' => true,
                'javascript-delay' => 10000,
                'images' => true,
                'enable-smart-shrinking' => true,
                'no-stop-slow-scripts' => true
            ]);
    
        return $pdf->download('invoice.pdf');
    
    stale 
    opened by davidnathanael 22
  • Problem to download/save PDF with assets

    Problem to download/save PDF with assets

    Hi guys,

    I got a problem when I want to download a PDF from view.

    When I remove the assets its works fine, but when I use them I got this error... he exit status code '1' says something went wrong: stderr: "Loading pages (1/6) [> ] 0% [======> ] 10% QSslSocket: cannot resolve CRYPTO_num_locks QSslSocket: cannot resolve CRYPTO_set_id_callback QSslSocket: cannot resolve CRYPTO_set_locking_callback QSslSocket: cannot resolve sk_free QSslSocket: cannot resolve sk_num QSslSocket: cannot resolve sk_pop_free QSslSocket: cannot resolve sk_value QSslSocket: cannot resolve SSL_library_init QSslSocket: cannot resolve SSL_load_error_strings QSslSocket: cannot resolve SSLv3_client_method QSslSocket: cannot resolve SSLv23_client_method QSslSocket: cannot resolve SSLv3_server_method QSslSocket: cannot resolve SSLv23_server_method QSslSocket: cannot resolve X509_STORE_CTX_get_chain QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf QSslSocket: cannot resolve SSLeay QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function sk_num [==========> ] 18% [===============> ] 25% [==================> ] 31% [======================> ] 38% [=========================> ] 43% QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init [============================================================] 100% Counting pages (2/6) [============================================================] Object 1 of 1 Resolving links (4/6) [============================================================] Object 1 of 1 Loading headers and footers (5/6) Printing pages (6/6) [> ] Preparing [==============================> ] Page 1 of 2 [============================================================] Page 2 of 2 Done Exit with code 1 due to network error: UnknownNetworkError QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback " stdout: "" command: /usr/local/bin/wkhtmltopdf-amd64 --lowquality --page-size 'letter' --enable-javascript --javascript-delay '4000' --viewport-size '1366x1024' '/tmp/knp_snappy5991c1b4cb1a41.29456871.html' '/tmp/knp_snappy5991c1b4cb2446.10870121.pdf'.

    I have two assets (css and js). <link rel="stylesheet" href="{{ url('/').mix('css/pdf.css') }}"> and <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js"></script> The view render without problem.

    Can you help me pls, this problem repeats in Homestead (Windows) and Forge (Ubuntu Server).

    Regards.

    stale 
    opened by mdeorue 21
  • PDF header and footer

    PDF header and footer

    Hello!

    I need to repeat my header and footer on every page, looking at the documentation I realized that I can not include pure HTML in the 'header-html' option (without a doctype).

    I did some tests and I can not divide my files (header.blade, content.blade, footer.html), this creates a giant error, can help me or how to proceed in this case?

    Thanks! laravel-snappy is amazing!

    opened by mprandot 21
  • wkhtmltopdf not including Bootstrap 4 Styling At All

    wkhtmltopdf not including Bootstrap 4 Styling At All

    Hey there,

    Not sure if it's because Bootstrap 4 uses flexbox or what, but even after copying bootstrap.min.css to a local file and including it that way the PDF shows no sign of using the correct styles

    My end result is this: Resume (47).pdf

    The photo and the text should be on the same row, using styling, but it treats each column as separate, here's the HTML I use

    <div class="row">
              <div class="col" style="padding-bottom: 24px;">
                @if(Auth::user()->GetPhotos(Auth::user()->id) != null && Auth::user()->GetPrimaryPhoto(Auth::user()->id) != null)
                  <?php $Photo = Auth::user()->GetPrimaryPhoto(Auth::user()->id) ?>
                  <a href="{{'https://theareel.com/photos/'.Auth::user()->id.'/'.$Photo->photo_name}}" data-fancybox="images">
                    <img class="img-responsive" style="display:inline-block; max-width: 15em; width: 100%; height: auto; box-shadow: 6px 6px 6px black; background: rgba(0,0,0,0.05)" id="{{$Photo->photo_name}}" src="{{'https://theareel.com/photos/'.Auth::user()->id.'/'.$Photo->photo_name}}">
                  </a>
                @endif
              </div>
              <div class="col">
                  <br>
                  <p>Email: {{Auth::user()->email}}</p>
                  <p>Age: {{Auth::user()->getAge()}} Height: {{floor((Auth::user()->height)/12)}}' {{Auth::user()->height - (floor((Auth::user()->height)/12)*12)}}"</p>
                  <p>Eye Color: {{ucfirst(Auth::user()->eyecolor)}}</p>
                  <p>Hair Color: {{ucfirst(Auth::user()->haircolor)}}</p>
                  <p>Ethnicity: {{ucfirst(Auth::user()->ethnicity)}}</p>
              </div>
            </div>
    

    Also, the Special Skills is supposed to be 4 columns each of the row, so 1/3 of the size each

                      <div class="col-4"><li class="list-group-item">{{$specialskill}}</li></div>
    

    Thanks

    stale 
    opened by ZachHandley 20
  • chart.js Chart does not show up in pdf

    chart.js Chart does not show up in pdf

    This has been mentioned a few times already (#145 / #73) and I've tried all the given possibilities, but just can't get the chart in my view to print to the PDF snappy generates. I'm on Laravel 5.4 and would appreciate some help from anyone who's got this working.

    Here's my code: In my controller, I pull in data from an API call and the chart is generated with the Fx3costa\LaravelChartJs package:

    `$chartjs = app()->chartjs ->name('lineChartTest') ->type('line') ->labels(['January', 'February', 'March', 'April', 'May', 'June', 'July']) ->datasets([ [ "label" => "My First dataset", 'backgroundColor' => "rgba(38, 185, 154, 0.31)", 'borderColor' => "rgba(38, 185, 154, 0.7)", "pointBorderColor" => "rgba(38, 185, 154, 0.7)", "pointBackgroundColor" => "rgba(38, 185, 154, 0.7)", "pointHoverBackgroundColor" => "#fff", "pointHoverBorderColor" => "rgba(220,220,220,1)", 'data' => $pageViews, ]

        ])
        ->options([]);`
    

    I then try to generate the PDF like this:

    ` $data = array('chartjs'=> $chartjs, 'user'=> $user, 'pageViews'=> $pageViews);

        return $pdf = PDF::loadHTML(view('admin.analytics.show', $data))
                            ->setOption('enable-javascript', true)
                            ->setOption('images', true)
                            ->setOption('javascript-delay', 13000)
                            ->setOption('enable-smart-shrinking', true)
                            ->setOption('no-stop-slow-scripts', true)
                            ->download('test.pdf');`
    

    In my view, I call the Chartjs script via cdn in the header and render the chart in a div: <div style = "width: 600px; height: 400px;"> {!! $chartjs->render() !!} </div>

    Thanks in advance.

    stale 
    opened by martinval 19
  • SVG base64 image is all white or all black in adobe reader

    SVG base64 image is all white or all black in adobe reader

    Hi

    I am generated PDF which contains lots of charts, so through JavaScript i am converting charts into SVG images to be later on use for PDF export. Everything went well with no errors but if i open the PDF in adobe reader in any operating system images are all black or white. If i open PDF with XD or in Chrome browser it open fine with normal images.

    I am not able to trace the problem, why dompdf generated PDF with SVG images are broken in adobe reader.

    opened by sidrafarooq 0
  • Rotated text in <thead> cells not visible after first page.

    Rotated text in cells not visible after first page.

    Hey! thanks for this extremely useful package. ❤

    I'm having issue when trying to create pdf with rotated texts in table headers. The text is visible on first page but from second page it disappear from all pages. have a look at below screenshot to understand better: First Page: image

    Second Page image

    for further information I'm using below CSS to rotate the texts in cell:

          thead { display: table-header-group; }
          tr { page-break-inside: avoid; }
          th.rotate,
          td.rotate{
              padding: 5px;
              text-align: center;
              white-space: nowrap;
              vertical-align: middle;
              width: 1.5em;
          }
          th.rotate div,
          td.rotate div {
              -moz-transform: rotate(-90.0deg);  /* FF3.5+ */
              -o-transform: rotate(-90.0deg);  /* Opera 10.5 */
              -webkit-transform: rotate(-90.0deg);  /* Saf3.1+, Chrome */
              filter:  progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083);  /* IE6,IE7 */
              -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)"; /* IE8 */
              margin-left: -10em;
              margin-right: -10em;
          }
    
        <table>
                <thead>
                          <th class="rotate" rowspan="3">
                                <div>
                                    Certified Surgeons <br>
                                    Certificate No.
                                </div>
                           </th>
                </thead>
        </table>
    

    Please let me know if need any other information. Thanks in advance! Happy new year... 😊

    opened by souravdutt 0
  • generating the raw text in pdf files

    generating the raw text in pdf files

    PHPWord content="Marta Binkiewicz"/>

    ProfessionalDevelopment

    Company Policy

     

    OBJECTIVE

    ELIGIBILITY

    FORTHE PROFESSIONALDEVELOPMENTREIMBURSEMENT

    ELIGIBLE EXPENSES

    PROCEDURE

    REIMBURSEMENT

    PROFESSIONALDEVELOPMENT LEAVE

    PROFESSIONALDEVELOPMENT

    ALLOWANCE

    TRACKINGYOURALLOWANCE

     

    Objective

     

    The purpose ofthis policy is to provideemployees with ProfessionalDevelopment opportunities that increasetheir skillsand enhance theircontributions to the organization. An employee’s work performanceis vitalto thesuccess

    opened by abbas-mastan 0
  • Link in footer broken(ish) link exists but few pixels above the text

    Link in footer broken(ish) link exists but few pixels above the text

    Version: "barryvdh/laravel-snappy": "^1.0" Using the facade PDF2::loadView. Adding footer: $footer = '<!doctype html> <html> <head><meta charset="UTF-8"></head> <body style="font-size: 85%; text-align: center">Generated with <a style="text-decoration: none" href="https://example.com" target="_blank">Example.com</a> </body> </html>'; $pdf->setOption('footer-html', $footer);

    Also added some margins $pdf->setOption('margin-top', 10); $pdf->setOption('margin-right', 15); $pdf->setOption('margin-bottom', 10); $pdf->setOption('margin-left', 10);

    Makes the text appear where it should be, but the actual ancher to click is about 50 px above the text.

    I've played around with all those values but none made it work.

    Not a huge deal, but it would be nice to have it working properly.

    Thank you so much for all your contributions!

    Captura

    opened by asntcrz 0
Releases(v1.0.0)
Owner
Barry vd. Heuvel
Barry vd. Heuvel
Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2

Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2. If you have an enabled template and a default template for the store you need your template the system will print the pdf template.

EAdesign 64 Oct 18, 2021
A Laravel package for creating PDF files using LaTeX

LaraTeX A laravel package to generate PDFs using LaTeX · Report Bug · Request Feature For better visualization you can find a small Demo and the HTML

Ismael Wismann 67 Dec 28, 2022
Generate PDF invoices for your customers in laravel

What is Invoices? Invoices is a Laravel library that generates a PDF invoice for your customers. The PDF can be either downloaded or streamed in the b

Erik C. Forés 399 Jan 2, 2023
Rapidly Generate Simple Pdf, CSV, & Excel Report Package on Laravel

Laravel Report Generators (PDF, CSV & Excel) Rapidly Generate Simple Pdf Report on Laravel (Using barryvdh/laravel-dompdf or barryvdh/laravel-snappy)

Jimmy Setiawan 513 Dec 31, 2022
Laravel package to convert HTML to PDF, supporting multiple drivers.

eve/pdf-converter A Laravel package to help convert HTML to PDF. Supports multiple drivers. Requirements and Installation eve/pdf-converter requires L

eve.io 11 Feb 15, 2022
Convert HTML to PDF using Webkit (QtWebKit)

wkhtmltopdf and wkhtmltoimage wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF and various image formats using the QT Webk

wkhtmltopdf 13k Jan 4, 2023
HTML to PDF converter for PHP

Dompdf Dompdf is an HTML to PDF converter At its heart, dompdf is (mostly) a CSS 2.1 compliant HTML layout and rendering engine written in PHP. It is

null 9.3k Jan 1, 2023
PHP library generating PDF files from UTF-8 encoded HTML

mPDF is a PHP library which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF (see CREDITS), with a number of enhancement

null 3.8k Jan 2, 2023
PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage

Snappy Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. It uses the excellent webkit-based wkhtmltopd

KNP Labs 4.1k Dec 30, 2022
Official clone of PHP library to generate PDF documents and barcodes

TCPDF PHP PDF Library Please consider supporting this project by making a donation via PayPal category Library author Nicola Asuni [email protected] co

Tecnick.com LTD 3.6k Jan 6, 2023
TCPDF - PHP PDF Library - https://tcpdf.org

tc-lib-pdf PHP PDF Library UNDER DEVELOPMENT (NOT READY) UPDATE: CURRENTLY ALL THE DEPENDENCY LIBRARIES ARE ALMOST COMPLETE BUT THE CORE LIBRARY STILL

Tecnick.com LTD 1.3k Dec 30, 2022
Pdf and graphic files generator library written in php

Information Examples Sample documents are in the "examples" directory. "index.php" file is the web interface to browse examples, "cli.php" is a consol

Piotr Śliwa 335 Nov 26, 2022
PdfParser, a standalone PHP library, provides various tools to extract data from a PDF file.

PdfParser Pdf Parser, a standalone PHP library, provides various tools to extract data from a PDF file. Website : https://www.pdfparser.org Test the A

Sebastien MALOT 1.9k Jan 2, 2023
Convert html to an image, pdf or string

Convert a webpage to an image or pdf using headless Chrome The package can convert a webpage to an image or pdf. The conversion is done behind the sce

Spatie 4.1k Jan 1, 2023
A PHP tool that helps you write eBooks in markdown and convert to PDF.

Artwork by Eric L. Barnes and Caneco from Laravel News ❤️ . This PHP tool helps you write eBooks in markdown. Run ibis build and an eBook will be gene

Mohamed Said 1.6k Jan 2, 2023
Sign PDF files with valid x509 certificate

Sign PDF files with valid x509 certificate Require this package in your composer.json and update composer. This will download the package and the depe

Lucas Nepomuceno 175 Jan 2, 2023
Generate simple PDF invoices with PHP

InvoiScript Generate simple PDF invoices with PHP. Installation Run: composer require mzur/invoiscript Usage Example use Mzur\InvoiScript\Invoice; re

Martin Zurowietz 16 Aug 24, 2022
Convert a pdf to an image

Convert a pdf to an image This package provides an easy to work with class to convert PDF's to images. Spatie is a webdesign agency in Antwerp, Belgiu

Spatie 1.1k Dec 29, 2022
PHP library allowing PDF generation or snapshot from an URL or an HTML page. Wrapper for Kozea/WeasyPrint

PhpWeasyPrint PhpWeasyPrint is a PHP library allowing PDF generation from an URL or an HTML page. It's a wrapper for WeasyPrint, a smart solution help

Pontedilana 23 Oct 28, 2022