Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass command line args to wkhtmltopdf to enable better formatting #84

Merged

Conversation

danielklim
Copy link
Contributor

Added 3 options to PdfCommand:

  • The first 2 options are variants of keeping the interim HTML that gets passed to wkhtmltopdf instead of removing it. This is useful for debugging (e.g. CSS issues that aren't transparent when only viewing the final PDF).
  • The third option is to pass arguments through to wkhtmltopdf which enables better control of PDF generation (e.g. margins, media type).

Copy link
Contributor

@craig-davis craig-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change, this looks like a nice addition to have!

I hope you're getting some Hacktoberfest credit for it!

@@ -82,11 +104,24 @@ protected function execute(InputInterface $input, OutputInterface $output)
// Save to a temp destination for the pdf renderer to use
file_put_contents($pdfSource, $rendered);

$cmd = "wkhtmltopdf $pdfargs $pdfSource $destFilename";
// $output->writeln($cmd);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// $output->writeln($cmd);

Was this commented out line left over from debugging? If so, can we please remove it?

@danielklim
Copy link
Contributor Author

Removed unnecessary comment. Wasn't aware of Hacktoberfest -- thanks for mentioning it!

@craig-davis craig-davis merged commit d4cfc4c into there4:master Oct 22, 2018
@danielklim danielklim deleted the danielklim/pdfcommand-arg-passthrough branch October 22, 2018 20:16
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.

None yet

2 participants