I am using the Prune Mani (V 0.12.0, we do not use 2.0.0 due to compatibility issues A user in Ruby on Rail Project has uploaded a PDF, which he has received directly from an official government website, so it is a PDF that we have to handle for other users, but it is corrupt and crashed Gone, when Zico St Wants to present in the form of credit. You can find PDFs on the "Payment of paid payment" link.
I get the error with this PDF:
NoMethodError - the undefined method 'size' for zero: NilClass:
And this is coming in our prone gem by this method:
def finalada if dictionary.data [Contents] .is_a? (Array) Dictionary. Data [: Content] .each do | Stream | Stream.compress_stream if document.compression_enabled? Stream.data [: length] = stream.stream.size # this line !!! Content.compress_stream at end.com if document.compression_enabled? Content.data [: length] = content.stream.size # It does not get this ending end
I'm stuck. To "correct" PDF, I can find only one tool Adobe Acrobat and PDF through my searches. PDFTK can be used in a server, but it is only for Windows and our server is running on a Linux server. I can not find any gems or any other way around it. I was able to "fix" PDFs on Mac by "saving as PDF" from Google Chrome (v41) (neither Windows nor Ubuntu Google Chrome worked). I want to be able to "fix" the PDF inside my Rail project. Any ideas / suggestions?
[edit] command line worked for me to use Ghostscript this line: GS-o Ripared PDF -sdiaiviii = Peedifaiarti-Deepeedifistitiijis = / Preepres CRP_14PDF
, PDF "Fixed" view now in RGHost Mani to see if I can do the same thing from within an administrator or model.
After leaving support for shrimp templates, I wrote a Ruby country gem.
I can not test it with your file, but you may be able to load the PDF using the gem, can render it in a string (or within the temporary file) and shrimp Reload. Or, maybe this can help you move on shrimp 2.0 (you can make new PDF data with shrimp and ticket it with an existing file).
It's just a thought, do not kill me if it does not work; -)
Good luck!
No comments:
Post a Comment