Skip to content

Instantly share code, notes, and snippets.

@juanhuttemann
Created November 15, 2019 14:31
Show Gist options
  • Save juanhuttemann/edf55f62447b384d4c278d0a204642bd to your computer and use it in GitHub Desktop.
Save juanhuttemann/edf55f62447b384d4c278d0a204642bd to your computer and use it in GitHub Desktop.
Combinar 2 pdf
require 'combine_pdf'
company_logo = CombinePDF.load("file1.pdf").pages[0]
pdf = CombinePDF.load "file2.pdf"
pdf.pages.each {|page| page << company_logo} # notice the << operator is on a page and not a PDF object.
pdf.save "content_with_logo.pdf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment