Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.process(working_path, pdf_name)
- pdf_path = "#{working_path}\/#{pdf_name}"
- pdf_text = PdfUtils.pdf_text(pdf_path)
- # split off PDF for people one by one until we have no pages left
- page_num = 1
- person_num = 1
- while PdfUtils.pdf_page_count(pdf_path)>0
- # are we at the end of the person's PDF?
- if PageNumMatcher.matches_page_n_of_n?(pdf_text, page_num)
- puts "Splitting off PDF #{person_num}"
- # pull off the person's PDF into a new one, with sequential numbering
- PdfUtils.split_pdfs(pdf_path, 1, page_num+1, "#{working_path}\/{person_num}.pdf")
- person_num += 1
- end
- page_num += 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement