Skip to content

Conversation

@shekohex
Copy link

@shekohex shekohex commented Jun 1, 2025

This pull request introduces updates to dependencies, configuration files, and functionality to improve Arabic text rendering in PDFs, enhance security settings, and modernize configurations. The most important changes include upgrading the laravel-dompdf dependency, adding Arabic text handling via ar-php, modernizing the dompdf configuration, and implementing a utility function for Arabic text correction.

Dependency Updates:

  • composer.json: Upgraded barryvdh/laravel-dompdf to ^3.1 and added khaled.alshamaa/ar-php for Arabic text processing. [1] [2]

Configuration Modernization:

  • server/config/dompdf.php: Modernized the configuration by updating syntax (e.g., single quotes), adding new options like allowed_protocols and artifactPathValidation, and changing defaults such as pdf_backend to CPDF. Security-related settings like enable_remote were set to false by default. [1] [2] [3] [4] [5] [6] [7] [8]

Arabic Text Rendering Enhancements:

  • server/src/Support/Utils.php: Added fixArabicInHTML method to correct Arabic glyphs in HTML content for accurate rendering.
  • server/src/Models/Entity.php, server/src/Models/Order.php, server/src/Models/Waypoint.php: Updated pdfLabel methods to use Utils::fixArabicInHTML for Arabic text correction in PDFs. [1] [2] [3]

Styling Updates:

  • server/resources/views/labels/default.php, server/resources/views/labels/waypoint-label.php: Added font-family: DejaVu Sans, serif and font-optical-sizing: auto for better font rendering in PDF labels. [1] [2]

Before
before the fix

After
after the fix

@shekohex shekohex marked this pull request as ready for review June 1, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant