Fix errors when rendering PDF output
If you run specs or your application and get an error like:
ActionController::MissingFile in 'ProductsController#show, should render PDF'
Cannot read file /some/file.pdf
You may be missing the
HTMLDOC
Show archive.org snapshot
binary on your system. Install it like this on Debian/Ubuntu:
sudo apt-get install htmldoc
Related cards:
pdfkit/wkhtmltopdf: When a header is invisible
If you're using the :header_html
option in PDFKit (or the corresponding --header-html
option in wkhtmltopdf
), and the header remains invisible, you need to add this to your header HTML:
<!doctype html>
The same applies to footers v...
Fixing errors with state_machine when excluding states
This is for you if you get the following strange error from the state_machine
gem:
undefined method `-' for #<StateMachine::BlacklistMatcher:0x124769b0>
You probably did something like this i...
What we know about PDFKit
What PDFKit is
- PDFKit converts a web page to a PDF document. It uses a Webkit engine under the hood.
- For you as a web developer this means you can keep using the technology you are familar wit...
Jasmine: Fixing common errors during initialization
Due to the way we setup Jasmine tests in our projects, you may run into various errors when Jasmine boots.
Setting jasmineRequire
on undefine...
LibreOffice won't embed most fonts into PDFs (with fix)
- LibreOffice Impress, Writer, etc. doesn't embed most fonts into the PDFs it generates.
- This means if you share a slide show with a font that is not Arial...
Fix external Displays switching not on when plugging notebook in docking station
If your external displays not switching on or showing a weird behavior (for e.g. all displays getting the same configuration all the time) you can fix it by switching off all external displays and re-enabling only one in the first step. Afterwards...
Print large PDFs as a poster
Pdfposter is a Python script that allows to convert large PDFs into a PDF with multiple pages that can be printed and turned into one big poster.
In Ubuntu, you can install it with
sudo apt-get install pdfposter
Scaling to the desired size i...
Setup your terminal to not scroll when there is new output
When you are scrolling up to investigate a test failure it is super annoying when the terminal scrolls back down whenever the running test outputs another line. Luckily you can disable this behavior:
- Gnome terminal: *Edit -> Profile preferences...
How to fix HTML elements being cut off when printing
When you print (or print preview) and elements are cut off (e.g. after 1st page, or "randomly") you should check your CSS rules for these:
- Is there an element with "
display: inline-block
" that surrounds your content? Make sure it has "`displa...
How to fix "unknown role" errors in Capistrano recipes
When you have a complex recipe setup with multistage deployment you may run into this error:
`role_list_from': unknown role `something' (ArgumentError)
Consider this task definition:
namespace :foo do
task :bar, :roles => :somethi...