Add fonts
This commit is contained in:
@@ -4,7 +4,8 @@
|
|||||||
"type": "project",
|
"type": "project",
|
||||||
"require": {
|
"require": {
|
||||||
"phpoffice/phpword": "dev-master",
|
"phpoffice/phpword": "dev-master",
|
||||||
"symfony/console": "7.2.x-dev"
|
"symfony/console": "7.2.x-dev",
|
||||||
|
"symfony/process": "7.2.x-dev"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@@ -20,4 +21,4 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"minimum-stability": "dev"
|
"minimum-stability": "dev"
|
||||||
}
|
}
|
||||||
|
|||||||
66
composer.lock
generated
66
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "10a32976ced7d2c583fbadf2b55e4ca8",
|
"content-hash": "78a7f322da01fab9bc676d318e0f7a03",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "phpoffice/math",
|
"name": "phpoffice/math",
|
||||||
@@ -705,6 +705,67 @@
|
|||||||
],
|
],
|
||||||
"time": "2024-06-20T08:18:00+00:00"
|
"time": "2024-06-20T08:18:00+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/process",
|
||||||
|
"version": "7.2.x-dev",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/process.git",
|
||||||
|
"reference": "bb0a8b7772610211c2cd7d6e4e36acfcbadcb613"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/process/zipball/bb0a8b7772610211c2cd7d6e4e36acfcbadcb613",
|
||||||
|
"reference": "bb0a8b7772610211c2cd7d6e4e36acfcbadcb613",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.2"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\Process\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Executes commands in sub-processes",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/process/tree/7.2"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2024-07-29T06:33:22+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/service-contracts",
|
"name": "symfony/service-contracts",
|
||||||
"version": "dev-main",
|
"version": "dev-main",
|
||||||
@@ -881,7 +942,8 @@
|
|||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"stability-flags": {
|
"stability-flags": {
|
||||||
"phpoffice/phpword": 20
|
"phpoffice/phpword": 20,
|
||||||
|
"symfony/console": 20
|
||||||
},
|
},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
|
|||||||
@@ -1,13 +1,23 @@
|
|||||||
FROM php:8.2-cli
|
FROM php:8.2-cli
|
||||||
|
|
||||||
# Install dependencies needed for Composer and PHP zip extension
|
# Install dependencies needed for Composer and PHP zip extension
|
||||||
|
RUN echo "deb http://deb.debian.org/debian bookworm contrib non-free" > /etc/apt/sources.list.d/contrib.list
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
unzip \
|
unzip \
|
||||||
libzip-dev \
|
libzip-dev \
|
||||||
|
libreoffice \
|
||||||
|
fontconfig \
|
||||||
|
ttf-mscorefonts-installer \
|
||||||
&& docker-php-ext-install zip \
|
&& docker-php-ext-install zip \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install fonts
|
||||||
|
RUN mkdir -p /usr/share/fonts/truetype/custom
|
||||||
|
COPY ./fonts/gilroy/* /usr/share/fonts/truetype/custom
|
||||||
|
COPY ./fonts/lexend/* /usr/share/fonts/truetype/custom
|
||||||
|
RUN fc-cache -f -v
|
||||||
|
|
||||||
# Download and install Composer
|
# Download and install Composer
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Black.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Black.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-BlackItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-BlackItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Bold.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Bold.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-BoldItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-ExtraBold.ttf
Normal file
BIN
fonts/gilroy/Gilroy-ExtraBold.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-ExtraBoldItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-ExtraBoldItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Heavy.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Heavy.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-HeavyItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-HeavyItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Light.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Light.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-LightItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-LightItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Medium.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Medium.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-MediumItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-MediumItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Regular.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Regular.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-RegularItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-RegularItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-SemiBold.ttf
Normal file
BIN
fonts/gilroy/Gilroy-SemiBold.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-SemiBoldItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-SemiBoldItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Thin.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Thin.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-ThinItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-ThinItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-UltraLight.ttf
Normal file
BIN
fonts/gilroy/Gilroy-UltraLight.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-UltraLightItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-UltraLightItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Black.ttf
Normal file
BIN
fonts/lexend/Lexend-Black.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Bold.ttf
Normal file
BIN
fonts/lexend/Lexend-Bold.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-ExtraBold.ttf
Normal file
BIN
fonts/lexend/Lexend-ExtraBold.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-ExtraLight.ttf
Normal file
BIN
fonts/lexend/Lexend-ExtraLight.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Light.ttf
Normal file
BIN
fonts/lexend/Lexend-Light.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Medium.ttf
Normal file
BIN
fonts/lexend/Lexend-Medium.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Regular.ttf
Normal file
BIN
fonts/lexend/Lexend-Regular.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-SemiBold.ttf
Normal file
BIN
fonts/lexend/Lexend-SemiBold.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Thin.ttf
Normal file
BIN
fonts/lexend/Lexend-Thin.ttf
Normal file
Binary file not shown.
BIN
src/.DS_Store
vendored
BIN
src/.DS_Store
vendored
Binary file not shown.
@@ -7,6 +7,8 @@ use Symfony\Component\Console\Command\Command;
|
|||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Symfony\Component\Process\Process;
|
||||||
|
use Symfony\Component\Process\Exception\ProcessFailedException;
|
||||||
|
|
||||||
class Generate extends Command
|
class Generate extends Command
|
||||||
{
|
{
|
||||||
@@ -23,13 +25,28 @@ class Generate extends Command
|
|||||||
{
|
{
|
||||||
$inPath = $input->getArgument("input");
|
$inPath = $input->getArgument("input");
|
||||||
|
|
||||||
$output->writeln(rootPath($inPath));
|
|
||||||
|
|
||||||
$doc = new Ebook($inPath);
|
$doc = new Ebook($inPath);
|
||||||
|
|
||||||
$path = $doc->compile();
|
$path = $doc->compile();
|
||||||
|
|
||||||
// $output->writeln($path);
|
$cmd = new Process([
|
||||||
|
"soffice",
|
||||||
|
"--headless",
|
||||||
|
"--convert-to",
|
||||||
|
"pdf",
|
||||||
|
"--outdir",
|
||||||
|
"storage/",
|
||||||
|
$path
|
||||||
|
]);
|
||||||
|
|
||||||
|
$cmd->run();
|
||||||
|
|
||||||
|
if (!$cmd->isSuccessful()) {
|
||||||
|
throw new ProcessFailedException($cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
$output->writeln($cmd->getOutput());
|
||||||
|
|
||||||
return Command::SUCCESS;
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace MenulisAi\Pdfgen\Converter;
|
|
||||||
|
|
||||||
class Converter {}
|
|
||||||
@@ -24,8 +24,8 @@ class Ebook implements Document
|
|||||||
$proc = new TemplateProcessor($this->templateSource());
|
$proc = new TemplateProcessor($this->templateSource());
|
||||||
|
|
||||||
$proc->setValues([
|
$proc->setValues([
|
||||||
'material' => $this->object->user_input->category,
|
'material' => strtoupper($this->object->user_input->category),
|
||||||
'chapter_name' => $this->object->user_input->material,
|
'chapter_name' => strtoupper($this->object->user_input->material),
|
||||||
'chapter' => '01',
|
'chapter' => '01',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -111,9 +111,7 @@ class Ebook implements Document
|
|||||||
$proc->cloneBlock('block_reflection#' . $ci, 0, true, false, $reflects);
|
$proc->cloneBlock('block_reflection#' . $ci, 0, true, false, $reflects);
|
||||||
}
|
}
|
||||||
|
|
||||||
$proc->saveAs("./examples/ebook_hasil.docx");
|
return $proc->save();
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function openFile(string $path)
|
protected function openFile(string $path)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
,pande,pandewidya.local,15.08.2024 07:34,file:///Users/pande/Library/Application%20Support/LibreOffice/4;
|
,pande,pandewidya.local,15.08.2024 10:30,file:///Users/pande/Library/Application%20Support/LibreOffice/4;
|
||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user