Skip to content

Commit

Permalink
Docs (I need help with YARD)
Browse files Browse the repository at this point in the history
  • Loading branch information
Myst authored and Myst committed Sep 12, 2014
1 parent eb6b8b8 commit b232c02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
17 changes: 7 additions & 10 deletions lib/combine_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@



# 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).
#
# PDF objects can be used to combine or to inject data.
# 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).
#
# 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")
Expand All @@ -59,7 +57,7 @@
# 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
Expand All @@ -77,15 +75,14 @@
# 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:
Expand Down
8 changes: 4 additions & 4 deletions lib/combine_pdf/combine_pdf_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ module CombinePDF
# 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}
#
#
# Notice that page objects are Hash class objects and the << operator was added to the Page instances without altering the class.
#
# == Page Numbering
# adding page numbers to a PDF object or file is as simple as can be:
# pdf = CombinePDF.new "file_to_number.pdf"
Expand Down Expand Up @@ -281,8 +278,11 @@ def << (obj)
return self #return self object for injection chaining (pdf << page << page << page)
end

# LATIN ONLY - NO UNICODE SUPPORT YET
# add page numbers to the PDF
#
# For unicode text, a unicode font(s) must first be registered. the registered font(s) must supply the
# subset of characters used in the text. UNICODE IS AN ISSUE WITH THE PDF FORMAT - USE CAUSION.
#
# options:: a Hash of options setting the behavior and format of the page numbers:
# - :number_format a string representing the format for page number. defaults to ' - %s - ' (allows for letter numbering as well, such as "a", "b"...).
# - :number_location an Array containing the location for the page numbers, can be :top, :buttom, :top_left, :top_right, :bottom_left, :bottom_right. defaults to [:top, :buttom].
Expand Down

0 comments on commit b232c02

Please sign in to comment.