2017-05-13 10 views
0

私はLinkedinからダウンロードしたCVのPDFを解析するツールを構築しています。しかし、文書を解析すると、は目に何も存在しない空白の行を見つけます。Ruby pdf-readerは空白の行を追加しますが、PDFの解析時には空白の行はありません

これがPDFまたはPDFリーダーに問題があるのでしょうか?

スクリプト

require 'pdf-reader' 

reader = PDF::Reader.new("CV.pdf") 

reader.pages.each_with_index do |page, page_num| 
    bits = page.text.split("\n") 

    bits.each_with_index do |bit, index| 
     puts bit 
    end 
end 

CVのスナップショット

enter image description here

解析された出力

Senior Analyst 
September 2013 - August 2015 (1 year 11 months) 
    - Managed a team of analysts to drive operational improvement across all departments of a subsidiary 

    company, including a 33% increase in conversions on their e-commerce platform and a 8% decrease in 
    logistics costs within my first year 

出力されたテキストには、文の途中に空白行が追加されています。

PDFのスクリーンショットを見ると、pdfリーダーが見つけた空白行が表示されないため、奇妙に思えます。

これを引き起こす可能性のある人はいますか?

答えて

0

他のライブラリを試した後、問題はで、PDFでは表示されないようです。

だから私はYomuと呼ばれる別の宝石(参照:https://github.com/Erol/yomuを)を決めた問題を避け、。

出力の予測可能性が高いほど、少し遅くなりますが許容されます。

関連する問題