Laravel automatically generated data dictionary

Source: Internet
Author: User
Tags wkhtmltopdf

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.