PHP code example of michaeld555 / nfe-parser

1. Go to this page and download the library: Download michaeld555/nfe-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

michaeld555 / nfe-parser example snippets


    use Michaeld555\Danfe;

    Danfe::simple('path_to_file/nfe.xml', 'path_to_file/danfe.pdf');

    if (file_exists('path_to_file/danfe.pdf')) {

        echo "the file was generated successfully";

    } else {

        echo "an error occurred during the file generation";

    }



    Danfe::custom('path_to_file/nfe.xml', 'path_to_file/danfe.pdf', 'path_to_logo/logo.png');