lib/combine_pdf.rb in combine_pdf-0.0.12 vs lib/combine_pdf.rb in combine_pdf-0.1.0
- old
+ new
@@ -30,16 +30,14 @@
-# This is a pure ruby library to merge PDF files.
+# This is a pure ruby library to combine/merge, stmap/overlay and number PDF files.
#
-# In the future, this library will also allow stamping and watermarking PDFs (it allows this now, only with some issues).
+# You can also use this library for writing basic text content into new or existing PDF files (For authoring new PDF files look at the Prawn ruby library).
#
-# PDF objects can be used to combine or to inject data.
-#
# here is the most basic application for the library, a one-liner that combines the PDF files and saves them:
# (CombinePDF.new("file1.pdf") << CombinePDF.new("file2.pdf") << CombinePDF.new("file3.pdf")).save("combined.pdf")
#
# == Loading PDF data
# Loading PDF data can be done from file system or directly from the memory.
@@ -57,11 +55,11 @@
# pdf << CombinePDF.new("file1.pdf")
# pdf << CombinePDF.new("file2.pdf")
# pdf.save "combined.pdf"
# as demonstrated above, these can be chained for into a one-liner.
#
-# you can also only selected pages.
+# you can also choose to add only specific pages.
#
# in this example, only even pages will be added:
# pdf = CombinePDF.new
# i = 0
# CombinePDF.new("file.pdf").pages.each do |page|
@@ -75,18 +73,17 @@
# after that, add the content to each of the pages in your existing PDF.
#
# in this example, a company logo will be stamped over each page:
# company_logo = CombinePDF.new("company_logo.pdf").pages[0]
# pdf = CombinePDF.new "content_file.pdf"
-# pdf.pages.each {|page| page << company_logo} # notice the << operator is on a page and not a PDF object.
+# pdf.pages.each {|page| page << company_logo}
# pdf.save "content_with_logo.pdf"
# Notice the << operator is on a page and not a PDF object. The << operator acts differently on PDF objects and on Pages.
#
-# The << operator defaults to secure injection by renaming references to avoid conflics. For overlaying pages using compressed data that might not be editable (due to limited filter support), you can use:
-# pdf.pages(nil, false).each {|page| page << stamp_page}
+# The << operator defaults to secure injection by renaming references to avoid conflics.
#
-#
-# Notice that page objects are Hash class objects and the << operator was added to the Page instances without altering the class.
+# Less recommended, but available - for overlaying pages using compressed data that might not be editable (due to limited filter support), you can use:
+# pdf.pages(nil, false).each {|page| page << stamp_page}
#
# == Page Numbering
# adding page numbers to a PDF object or file is as simple as can be:
# pdf = CombinePDF.new "file_to_number.pdf"
# pdf.number_pages