Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Clubphp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Clubphp
Commits
28ca50c7
Commit
28ca50c7
authored
May 23, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdf
parent
bcd98b65
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
Dockerfile
Dockerfile
+10
-0
export_pdf.php
app/Modules/Tutorials/Views/export_pdf.php
+1
-1
PdfExportService.php
app/Shared/Services/PdfExportService.php
+11
-3
No files found.
Dockerfile
View file @
28ca50c7
...
@@ -13,6 +13,16 @@ RUN apt-get update && apt-get install -y \
...
@@ -13,6 +13,16 @@ RUN apt-get update && apt-get install -y \
default-mysql-client
\
default-mysql-client
\
dos2unix
\
dos2unix
\
git
\
git
\
wkhtmltopdf
\
xvfb
\
libxrender1
\
libfontconfig1
\
fonts-noto
\
fonts-noto-core
\
fonts-noto-extra
\
fonts-arabeyes
\
fontconfig
\
&&
fc-cache
-fv
\
&&
rm
-rf
/var/lib/apt/lists/
*
&&
rm
-rf
/var/lib/apt/lists/
*
# ── Install Composer ──
# ── Install Composer ──
...
...
app/Modules/Tutorials/Views/export_pdf.php
View file @
28ca50c7
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
}
}
*
{
box-sizing
:
border-box
;
margin
:
0
;
padding
:
0
;
}
*
{
box-sizing
:
border-box
;
margin
:
0
;
padding
:
0
;
}
body
{
body
{
font-family
:
'Segoe UI'
,
Tahoma
,
Arial
,
sans-serif
;
font-family
:
'
Noto Sans Arabic'
,
'Noto Sans'
,
'
Segoe UI'
,
Tahoma
,
Arial
,
sans-serif
;
font-size
:
13px
;
font-size
:
13px
;
line-height
:
1.7
;
line-height
:
1.7
;
color
:
#1A1A2E
;
color
:
#1A1A2E
;
...
...
app/Shared/Services/PdfExportService.php
View file @
28ca50c7
...
@@ -40,15 +40,23 @@ final class PdfExportService
...
@@ -40,15 +40,23 @@ final class PdfExportService
file_put_contents
(
$tmpInput
,
$html
);
file_put_contents
(
$tmpInput
,
$html
);
$cmd
=
escapeshellarg
(
$wkhtmltopdf
)
$cmd
=
escapeshellarg
(
$wkhtmltopdf
)
.
' --encoding utf-8 --page-size A4 --margin-top 10 --margin-bottom 10'
.
' --encoding utf-8'
.
' --page-size A4'
.
' --margin-top 15 --margin-bottom 15 --margin-left 12 --margin-right 12'
.
' --enable-local-file-access'
.
' --no-stop-slow-scripts'
.
' --javascript-delay 500'
.
' --image-quality 85'
.
' --print-media-type'
.
' '
.
escapeshellarg
(
$tmpInput
)
.
' '
.
escapeshellarg
(
$tmpInput
)
.
' '
.
escapeshellarg
(
$tmpOutput
);
.
' '
.
escapeshellarg
(
$tmpOutput
)
.
' 2>&1'
;
exec
(
$cmd
,
$output
,
$returnCode
);
exec
(
$cmd
,
$output
,
$returnCode
);
@
unlink
(
$tmpInput
);
@
unlink
(
$tmpInput
);
if
(
$returnCode
===
0
&&
file_exists
(
$tmpOutput
)
)
{
if
(
(
$returnCode
===
0
||
$returnCode
===
1
)
&&
file_exists
(
$tmpOutput
)
&&
filesize
(
$tmpOutput
)
>
0
)
{
$pdfContent
=
file_get_contents
(
$tmpOutput
);
$pdfContent
=
file_get_contents
(
$tmpOutput
);
@
unlink
(
$tmpOutput
);
@
unlink
(
$tmpOutput
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment