Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сan't convert large file (~100k rows in HTML) #79

Open
YuraAfanasyev opened this issue May 15, 2019 · 2 comments
Open

Сan't convert large file (~100k rows in HTML) #79

YuraAfanasyev opened this issue May 15, 2019 · 2 comments

Comments

@YuraAfanasyev
Copy link

When I try to convert a large file (~100k rows in HTML), I get an error:
stack level too deep
my code is:

respond_to do |format|
  format.docx do
    render docx: 'report', filename: "report.docx"
  end
end

Small files are generated perfectly.

If I change the code to this:

respond_to do |format|
  format.docx do
    html = render_to_string template: 'report', formats: :docx
    result = Htmltoword::Document.create(html)
    send_data result, type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", filename: "report.docx"
  end
end

then the rails server is stopped with error:

/Users/developer/.rvm/gems/ruby-2.5.1@plutus/gems/htmltoword-1.1.0/lib/htmltoword/document.rb:104: [BUG] Illegal instruction at 0x00007fff7164f5e2
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:                    
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.     

-- Control frame information -----------------------------------------------
c:0112 p:---- s:0851 e:000850 CFUNC  :transform
...

I tried using different versions of rails and ruby, but this does not work. Other gems, such as pandoc-ruby, convert such large files, but text formatting does not work in them.

@JenniferSpry
Copy link

We have the same issue. @YuraAfanasyev have you found a solution yet?

@JenniferSpry
Copy link

Just found a workaround in this issue: #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants