
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
PuppetPdf is a lib that wraps Google Puppeteer pdf generation method to be used with Rails.
Add this line to your application's Gemfile:
gem 'puppet_pdf'
And then execute:
$ bundle
Or install it yourself as:
$ gem install puppet_pdf
Run this task to install some dependencies:
$ rails puppet_pdf:install_dependencies
class TasksController < ApplicationController
def pdf
render_pdf
end
end
You can pass some options to render_pdf
like template, layout and the output filename. The available options are:
{
template: String, # The template to be rendered. Default: 'controller_path/action_name'
layout: String, # Default: 'application'
filename: String, # Default: 'action_name.pdf'
header: String, # The header of the pdf. Default: '<header></header>'
footer: String, # The header of the pdf. Default: '<footer></footer>'
margins: Hash, # The margins of the pdf. Default: { top: 36, right: 36, bottom: 45, left: 36 }
loading_delay: Integer, # Time to load the page javascript in ms. Default: 1000
output_path: String # The output path of the pdf. Default: generated by Tempfile
}
In you views you need to replace stylesheet_link_tag
with puppet_stylesheet_link_tag
, and javascript_include_tag
with puppet_javascript_script_tag
<!DOCTYPE html>
<html>
<head>
<title>PuppetPdfExample</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= puppet_stylesheet_link_tag('application.css') %>
<%= puppet_javascript_script_tag('application.js') %>
</head>
<body>
<%= yield %>
</body>
</html>
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/puppet_pdf. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the PuppetPdf project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that puppet_pdf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.