承接 zafarjonovich/application-filler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zafarjonovich/application-filler

Composer 安装命令:

composer require zafarjonovich/application-filler

包简介

Image application filler

README 文档

README

Assalomu aleykum, this package helps to you fill applications wia php

For example

You have application likely this

Application form

You must fill it programmatically

  • Always the coordinate head is at the top left and the coordinates are measured in pixels
  • Each text is grouped together and the group consists of rows that can be written
  • Each group can be given different fonts, and it merges into a font object. The font object covers the absolute location of the font and the size of the text
  • Each row consists of lines, and the lines consist of starting and ending points
  • Each point is equal to the number of vertical and horizontal pixels counted from the origin

I suggest the following site to calculate the coordinates

require_once 'vendor/autoload.php';

use zafarjonovich\ApplicationFiller\element\Font;
use zafarjonovich\ApplicationFiller\element\Group;
use zafarjonovich\ApplicationFiller\element\Groups;
use zafarjonovich\ApplicationFiller\element\Line;
use zafarjonovich\ApplicationFiller\element\Lines;
use zafarjonovich\ApplicationFiller\element\Point;
use zafarjonovich\ApplicationFiller\element\Text;
use zafarjonovich\ApplicationFiller\ApplicationFiller;

try {
    $groups = new Groups();

    $groups->add(
        new Group(
            new Text('x',new Font('ubuntu.ttf',18)),
            (new Lines())
                ->add(
                    new Line(new Point(493,127),new Point(510,127))
                )
        )
    );

    $groups->add(
        new Group(
            new Text('English, Russian, Uzbek',new Font('ubuntu.ttf',16)),
            (new Lines())
                ->add(
                    new Line(new Point(280,196),new Point(640,196))
                )
        )
    );

    $groups->add(
        new Group(
            new Text('x',new Font('ubuntu.ttf',18)),
            (new Lines())
                ->add(
                    new Line(new Point(548,265),new Point(650,265))
                )
        )
    );

    $groups->add(
        new Group(
            new Text('x',new Font('ubuntu.ttf',18)),
            (new Lines())
                ->add(
                    new Line(new Point(548,265),new Point(650,265))
                )
        )
    );

    $groups->add(
        new Group(
            new Text('x',new Font('ubuntu.ttf',18)),
            (new Lines())
                ->add(
                    new Line(new Point(548,335),new Point(650,335))
                )
        )
    );

    $groups->add(
        new Group(
            new Text('x',new Font('ubuntu.ttf',18)),
            (new Lines())
                ->add(
                    new Line(new Point(490,402),new Point(510,402))
                )
        )
    );

    $largeText = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";

    $groups->add(
        new Group(
            new Text($largeText,new Font('ubuntu.ttf',12)),
            (new Lines())
                ->add(
                    new Line(new Point(120,558),new Point(650,558))
                )
                ->add(
                    new Line(new Point(120,608),new Point(650,608))
                )
                ->add(
                    new Line(new Point(120,665),new Point(650,665))
                )
                ->add(
                    new Line(new Point(120,715),new Point(650,715))
                )
                ->add(
                    new Line(new Point(120,770),new Point(650,770))
                )
                ->add(
                    new Line(new Point(120,820),new Point(650,820))
                )
        )
    );

    $filler = new ApplicationFiller('application-form.jpg',$groups);

    $filler->draw();

    $filler->image->save('temp.jpg');

} catch (Exception $exception) {
    echo $exception->getMessage();
}

Result:

Result application form

You can change the text alignment

$text = new Text("Hello world !",new Font('ubuntu.ttf',12));
$text->setAlignment(Text::ALIGNMENT_MODE_CENTER);

$groups->add(
    new Group(
        $text,
        (new Lines())
            ->add(
                new Line(new Point(490,402),new Point(510,402))
            )
    )
);

统计信息

  • 总下载量: 4.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-09-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固