Comments (11)
I'm sorry; I have neither tried it on Windows, nor do I have access to Vista.
from wicked_pdf.
I have a virtual Windows XP, Windows Server 2003 64-bit & Windows 7 Ultimate 64-bit - all running wkhtmltopdf just - fine - but I would go to wkhtmltopdf google group to ask more info about your problem - you will probably get more help there.
from wicked_pdf.
I just posted my solution to a similar problem here:
http://code.google.com/p/wkhtmltopdf/issues/detail?id=162#c5
It seems to be an issue related to some wicked_pdf code after all. Maybe the suggested adjustment can be made within the main code accordingly.
from wicked_pdf.
Actually I discovered an additional bug related to this. Standard Open3 gem doesn't implement fork(), and that error kept coming up. Fixed it by changing require from 'open3' to 'popen4' ( a wrapper from codeforpeople). Also as suggested above by adding "b" option in line 21 of wicked_pdf.rb. Hope that helps
from wicked_pdf.
fixed same problem with windows 7 64bit by installing:
gem install win32-open3
and changing the require 'open3' to require 'win32/open3' (wicked_pdf.rb in plugin-dir/lib)
I am developing on windows, but running the production server at linux. how to make this require-line for both plattform individual?
from wicked_pdf.
Stueck you can check against a global called RUBY_PLATFORM - windows system will spit out something like win32 or mingw32 - depending on how it was compiled .
Check out this little helper I wrote: http://github.com/konung/santas_little_helper/blob/master/lib/santas_little_helper.rb
from wicked_pdf.
Great, thank you very much.
from wicked_pdf.
Hi I am developing in windows, but my server is linux.
I did try generating a pdf with image for windows but without any lucky, however it is working fine for linux... (it doesn't matter if you are using relative path or full path)
I'd like to give my contribution to this plugin and to this thread.
I'm not quite sure how to do it, so I will just put it here, hopefull somebody can get this and add to the main branch.
First, Use konung and create a file in the lib directory, mine is platform.rb
Secondly, it is necessary to install the gem win32-open for windows
Thirdly, Change the file wicked_pdf, in the plugins lib directory
do the following:
a) Add the lines in the beging of the file, remember to remove require 'open3', it just works for linux ...
require 'platform'
if linux? || mac?
require 'open3'
else
require 'win32/open3'
end
b) add a new method for the class WickedPdf
def popen3(command_for_stdin_stdout,type, &block)
if linux? || mac?
Open3.popen3(command_for_stdin_stdout, &block)
else
Open3.popen3(command_for_stdin_stdout, type, &block)
end
end
c) Change the Open3.popen3 to use the new method created, so the pdf_to_string will be as:
def pdf_from_string(string, options=nil)
command_for_stdin_stdout = "#{@exe_path} #{options} --ignore-load-errors - - -q"
p "_"15 + command_for_stdin_stdout + ""_15 if RAILS_ENV == 'development'
popen3(command_for_stdin_stdout, 'b') do |stdin, stdout, stderr|
stdin.write(string)
stdin.close
pdf = stdout.read
raise "PDF could not be generated!\n#{stderr.read}" if pdf.length == 0
pdf
end
end
from wicked_pdf.
If you've used the one-click installer to install ruby on windows, you may need to read this to get win32/open3 to work:
http://groups.google.com/group/ruby-talk-google/browse_thread/thread/b18e36aa7de46cfd?pli=1
from wicked_pdf.
Could you try https://github.com/soorajb/wicked_pdf
It worked on my windows xp.
from wicked_pdf.
The latest versions use branching logic to figure out whether to load open3 or win32/open3 when on windows.
from wicked_pdf.
Related Issues (20)
- Add support for --load-error-handling and --load-media-error-handling
- Remote asset returning non-200 response does not trigger an error
- Greek Character "𝛼" not showing correctly within PDF generated by Wicked PDF HOT 7
- Images won't load from Active Storage using Amazon S3 Bucket HOT 2
- version 2.7.0 breaks with webpacker
- Content is getting cropped in PDF
- ActionView::Template::Error uninitialized constant WickedPdf::WickedPdfHelper::Assets::SprocketsEnvironment::Sprockets HOT 3
- Feature Request: PDF/A-1
- pdf_from_url CSS not working HOT 1
- Raw PDF being rendered. HOT 1
- OpenStruct causes NameError in Rake13.2.0
- PDF is being rendered with raw ERB code HOT 4
- Content overlaps with the header layout
- RuntimeError on PDf Generation HOT 1
- wicked_pdf due to wkhtmltopdf not finding OpenSSL 1.1 despite installing over OpenSSL 3 HOT 7
- Remove usage of `OpenStruct` or add `ostruct` as dependency
- v2.8.0 causing ActionView::Template::Error: no implicit conversion of nil into String for first time in years HOT 7
- ArgumentError when changing the WickedPdf.config={...} to the new WickedPdf.configure.do |c| ... end HOT 1
- Error: PDF could not be generated! HOT 1
- Public assets not getting loaded after upgrade to Rails 7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wicked_pdf.