Skip to content

CONV-144: Implement JPG to PDF driver#138

Merged
menvil merged 1 commit into
developfrom
feature/CONV-144-implement-jpg-to-pdf-driver
Jun 1, 2026
Merged

CONV-144: Implement JPG to PDF driver#138
menvil merged 1 commit into
developfrom
feature/CONV-144-implement-jpg-to-pdf-driver

Conversation

@menvil

@menvil menvil commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements JpgToPdfDriver at app/Conversion/Drivers/Image/JpgToPdfDriver.php
  • Extracts shared PDF rendering logic into RendersSingleImagePdf trait to avoid duplication between PNG and JPG drivers
  • Refactors PngToPdfDriver to use the same trait (same behaviour, less code)
  • Both drivers embed source image as base64 data URI, render via dompdf, support all page/margin/fit options

Test plan

  • JpgToPdfDriverTest passes (file exists, extension=pdf, mime=application/pdf, size>0)
  • PngToPdfDriverTest still passes after refactor
  • composer test passes (264 tests)
  • composer lint passes

🤖 Generated with Claude Code


Summary by cubic

Adds JPG→PDF conversion and unifies image-to-PDF rendering in a shared trait, reducing duplication while keeping PNG behavior unchanged. Fulfills CONV-144 and supports page size, orientation (including auto), margins, and fit options.

  • New Features

    • Implemented JpgToPdfDriver that embeds the image as a base64 data URI and renders via barryvdh/laravel-dompdf.
  • Refactors

    • Extracted RendersSingleImagePdf trait for shared rendering logic; updated PngToPdfDriver to use it with no behavior changes.

Written for commit 756770b. Summary will update on new commits.

Review in cubic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 355b807f-a6b2-445f-9160-3914c9a8b32b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/CONV-144-implement-jpg-to-pdf-driver

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@menvil menvil merged commit 972ac5b into develop Jun 1, 2026
3 checks passed
@menvil menvil deleted the feature/CONV-144-implement-jpg-to-pdf-driver branch June 1, 2026 17:30
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