Skip to content

CONV-142: Implement PNG to PDF driver#136

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

CONV-142: Implement PNG to PDF driver#136
menvil merged 1 commit into
developfrom
feature/CONV-142-implement-png-to-pdf-driver

Conversation

@menvil

@menvil menvil commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements PngToPdfDriver at app/Conversion/Drivers/Image/PngToPdfDriver.php
  • Embeds PNG as base64 data URI in a Blade HTML template, renders to PDF via barryvdh/laravel-dompdf
  • Supports page_size (a4/letter/a3), orientation (portrait/landscape/auto), margin (none/small/medium/large), fit_mode (contain/fill/original)
  • orientation: auto determines from image dimensions (landscape if width > height)
  • Returns ConversionResult with %PDF header verified in tests; does not mutate models
  • Shared Blade template at resources/views/pdf/single-image.blade.php (reused by CONV-144)

Test plan

  • PngToPdfDriverTest passes (file exists, extension=pdf, mime=application/pdf, size>0, starts with %PDF)
  • composer test passes (263 tests)
  • composer lint passes

🤖 Generated with Claude Code


Summary by cubic

Adds a PNG→PDF conversion driver that renders a single image to PDF via barryvdh/laravel-dompdf. Fulfills CONV-142 with options for page size, orientation (auto), margins, and fit.

  • New Features
    • New PngToPdfDriver (png_to_pdf) using shared Blade view pdf/single-image.
    • Auto orientation chooses landscape when width > height; margins map to CSS mm values.
    • Supports fit_mode: contain, fill, original.
    • Writes result.pdf to the output directory and returns a ConversionResult with PDF metadata.

Written for commit 2ebe496. 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: 608b3efb-9dd9-4255-a42f-1f09cdeb3ece

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-142-implement-png-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 2436a63 into develop Jun 1, 2026
1 check was pending
@menvil menvil deleted the feature/CONV-142-implement-png-to-pdf-driver branch June 1, 2026 17:29
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