Every time you develop a project, you will always be asked to provide a data dictionary, each time you manually write a document too tired, so write this extension, automatically read the database information and display on the Web page, support export Html and PDF files. Export Html is actually a compressed package that generates and exports an offline version. Export PDF uses the Laravel-snappy expansion pack to install the installation package files
$ composer require Jormin/laravel-ddoc
Configuration
1. Registration serviceprovider:
Jormin\ddoc\ddocserviceprovider::class,
2. To create a configuration file:
PHP Artisan Vendor:publish
After executing the command, two files are generated in the Config directory: laravel-ddoc.php: This extension profile, used to configure the document at the bottom of the Copyright copy and link. Snappy.php:laravel-snappy configuration file that configures the options for exporting PDFs.
Pdf.binary configuration wkhtmltopdf The directory where the files are executed
Linux/unix/mac system execution files are stored in the project directory/vendor/h4cc/wkhtmltopdf-[amd64|i386]/bin/directory
WUNDIWS system execution files are stored in the project directory/vendor/wemersonjanuario/wkhtmltopdf-windows/bin/[64bit|32bit]/directory use
After installing the extension, the browser accesses the [Http|https]://[your domain or Ip]/ddoc
Reference QuestionsQ: The exported PDF file is not displayed or garbled in Chinese.
A: The problem is caused by the fact that the Chinese font is not installed on the machine and is resolved as follows
1, first from the local computer or network download the required Chinese font
2, modify the permissions of the font file, so that users outside the root user can also use
$ cd/usr/share/fonts/chinese/
3, build font cache
$ sudo Mkfontscale
$ # If prompted Mkfontscale:command not found, you will need to install # sudo apt-get install ttf-mscorefonts-installer
$ sudo m Kfontdir
$ sudo fc-cache-fv
$ # If prompted Fc-cache:command not found, you need to install # sudo apt-get install Fontconfig
Reference Diagram
Reprinted from: Laravel China
Author: jormin