test/automated in combine_pdf-0.2.34 vs test/automated in combine_pdf-0.2.35

- old
+ new

@@ -55,19 +55,40 @@ CombinePDF.load("./Ruby/test\ pdfs/Scribus-unknown_err2.pdf").save '08_2-unknown-err-empty-str.pdf' CombinePDF.load("./Ruby/test\ pdfs/Scribus-unknown_err3.pdf").save '08_3-unknown-err-empty-str.pdf' CombinePDF.load("/Users/2Be/Ruby/test\ pdfs/nil_object.pdf").save('09_nil_in_parsed_array.pdf') +encrypted = [ "./Ruby/test\ pdfs/pdf-reader/encrypted_version4_revision4_128bit_aes_user_pass_apples_enc_metadata.pdf", + "./Ruby/test\ pdfs/AESv2\ encrypted.pdf", + "./Ruby/test\ pdfs/pdf-reader/encrypted_version2_revision3_128bit_rc4_blank_user_pass.pdf", + "./Ruby/test\ pdfs/AES\ enc.pdf", + "./Ruby/test\ pdfs/RC4\ enc.pdf"] + +encrypted.length.times do |i| + fname = File.basename encrypted[i] + begin + CombinePDF.load(encrypted[i]).save "10_#{i}_#{fname}" + rescue => e + puts e.class.name, e.message + if(i == 0) + puts "CombinePDF expected to fail to read AESv2 #{fname}" + else + puts "ERROR: CombinePDF failed to open #{fname}" + end + end +end + require 'prawn' -IO.binwrite '10_prawn.pdf', (Prawn::Document.new { text 'Hello World!' }).render +IO.binwrite '11_prawn.pdf', (Prawn::Document.new { text 'Hello World!' }).render page = CombinePDF.parse((Prawn::Document.new { text 'Hello World!' }).render) pdf = CombinePDF.new pdf << page -pdf.save '10_parsed_from_prawn.pdf' +pdf.save '11_parsed_from_prawn.pdf' pdf = CombinePDF.new pdf << page << page -pdf.save('10_AcrobatReader_is_unique_page.pdf') +pdf.save('11_AcrobatReader_is_unique_page.pdf') +puts GC.stat.inspect # unify = [ # "./Ruby/test\ pdfs/AESv2\ encrypted.pdf", # "./Ruby/test\ pdfs/data-in-comment.pdf", # "./Ruby/test\ pdfs/file_name.pdf", # "./Ruby/test\ pdfs/garbage_after_eof.pdf",