定制 kibi/lanyardpendant 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kibi/lanyardpendant

最新稳定版本:1.0.5

Composer 安装命令:

composer require kibi/lanyardpendant

包简介

LanyardPendant is a PHP class for generating PDF lanyard pendants

README 文档

README

LanyardPendant is a PHP class for generating PDF lanyard pendants

Installation

with Composer

composer require kibi/lanyardpendant

via require (download current release manually)

require_once('path/to/src/LanyardPendant.class.php');

Sample usage

require_once('vendor/autoload.php');

$pdfName = 'Namensschild.pdf';

$pdf = LanyardPendant($pdfName);

$pdf->SetCreator("Creator name");
$pdf->SetAuthor("Author name");

//Nur zu Testzwecken
$pdf->setPDFBackgroundDocumentPath(dirname(__FILE__).'/LanyardPendantBackground-sample.pdf'); 
	
$pdf->AddPage();

$pdf->drawHolePunch(); //Nur zu Testzwecken

$pdf->writeName('Max');
$pdf->writeName('Mustermann');
//$pdf->writeName('Mustermann von Musterhausenstein'); //Automatische Anpassung der Schriftgröße an Textlänge (-> Immer nur eine Zeile)

$pdf->writePersonalCompany('Meine Musterfirma');
$pdf->writePersonalPosition('Event Manager');

$pdf->writePersonalTextField('<b>Sprich mich an, wenn...</b><br>du dich für Co-Workingspaces, Events, Hackathons & Networking interessierst');

$pdf->writePersonalQRCode('https://example.com/link/to/my/profile');

//PDF DIREKT AUSGEBEN
$pdf->Output($pdfName.'.pdf', 'I');

Print lanyard pendants using Druckerwolke (Cloud Printing Service)

Setup your Account

  1. Create your account at https://druckerwolke.de
  2. Create your API username and password in the login area at https://durckerwolke.de.
  3. Request your API key at support@druckerwolke.de

Install Druckerwolke

with Composer

composer require kibi/druckerwolke

via require (download current release manually)

require_once('path/to/src/Druckerwolke.class.php');

Then add the following section to your code:

$file_content = $pdf->Output($pdfName.'.pdf', 'S');

$username = 'XXX';
$password = 'XXXXXXXXXX';
$api_key = 'XXXXXXXX-XXXX-MXXX-NXXX-XXXXXXXXXXXX';

$druckerwolke = Druckerwolke($username, $password, $api_key);

$printers = $druckerwolke->printers();

// SELECT THE PRINTER
$printer_id = $printers[0]->Id; //we are using the first printer

$data = [
	'FileName' => $pdfName,
	'MimeType' => 'application/pdf',
	'FileDataBase64' => base64_encode($file_content),
	'JobName' => 'Printing: '.$pdfName,
	'DocumentVersion' => 0,
	'InputQueueId' => $printer_id,
	'FileSize' => 0,
	'JobSettings' => [
		'PageOrientation' => 0
	],
	'AdditionalParameters' => []
];

$result = $druckerwolke->add_document($data);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: mit
  • 更新时间: 2022-06-05