rails-ckeditor and thumbnails - ruby-on-rails

as i see - rails-ckeditor plugin inserting full images when user edit text. Could you tell me please - how to enable thumbnail inserting with link to original image.

rails-ckeditor does not support thumbnails. Thumbnail support in ckeditor comes from a supplementary package called CKFinder. This package is currently only available for php, java, coldfusion and ASP.
This means you are out of luck and will have to create the solution yourself. You could try to use any of the standard Rails thumbnailing plugins such as Paperclip or Carrierwave; and re-write ckeditor to make use of those thumbnails instead of trying to use ckfinder. But it's not going to be an easy task.

Related

Mixed orientations in wicked pdf

Currently I am using wicked_pdf gem to create pdf in my ROR (ruby on rails application).
My pdf have 4 pages. In which 1 is chart. I need that page alone to be landscape dynamically.
Is it possible using wicked_pdf or any other gem?
PS: I tried to generated each pdf and combining them but the image
changes pages based on the content of the previous pages.
wicked_pdf is a plugin that relies on the wkhtmltopdf project to generate the actual PDFs. wkhtmltopdf does not yet implement this feature, so until that is complete there is no easy way to get mixed-orientation PDF files.
There is an outstanding feature request to implement this, so watch that issue for any updates. It appears that at this time there is some work being done on this issue but it will take time for it to both make it into wkhtmltopdf and be picked up by wicked_pdf.
In the meantime there is a workaround that some people have attempted involving CSS rotations and media selection stylesheets.
Others have attempted to generate multiple PDFs separately and stitch them together with some programs like ghostscript. See the above workaround page for more details.

How can I inject a dynamically generated image (barcode, as it happens) into a PDF document (I'm in rails if that matters)?

I'm aware of pdf-stamper, but I'm trying to avoid switching everything to jruby right now.
I just need to "stamp" an image that I generate within the rails app (a PDF417 barcode) into a form field in the PDF document (there's an FDF; it's a document template kinda thing).
I'm filling out the text-based fields by just shelling out to pdftk, so if there's a way to do it using pdftk, I'd be fine with that, but I've looked high and low for one without any luck.
How about using a barcode font? some alternatives too. I haven't used that one but there may be others available too
I know I'm late to the party, but the PDF417 Rubygem should do what you need. https://rubygems.org/gems/pdf417 will generate it and if you have chunky_png installed you can easily write out PNGs to a file.

WYSIWYG image uploads in Rails App

Can anyone recommend a way of creating a view where users can upload images to my app through a WYSIWYG editor?
I've tried solving this using CK Editor and Paperclip but am having lots of trouble... Maybe I'm going about this the wrong way.
If someone's done this before I'd really like to know how! I don't have a editor or file storage mechanism preference so fire away...
This is all dependent on the WYSIWYG's file upload API. From there, just build an ImagesController to handle requests from that API, use whatever system (Paperclip is good) to handle those files internally, and you should be good to go. You won't find a plug-and-play solution; you'll have to hand-roll it.
Turns out that, with more targeted Google searching, you can find a preexisting solution. Here's one for TinyMCE and Rails. You may, however, end up finding that it doesn't meet your needs, in which case I would not be surprised to find that creating your own solution would be simpler than you expect :)
You could try Bootsy. It's a WYSIWYG editor with image upload capability. Includes a (rather simple) image manager as well.
https://github.com/volmer/bootsy
There is an other solution for rails out there:
https://github.com/spohlenz/tinymce-rails
You can load it as gem and configure it via a yml file. And it comes with an extra language gem.

Help with rails and tinyMce

I have been using tinyMce_hammer plugin to use tinymce in my rails app... but right now I also want a way for my users to upload photos and insert them into their wysiwyg editor.... is there a simple way to get this done??.. is there any other wysiwyg editor that works with rails and comes with this feature built in??... what do you reccomend?
These two plugins claim to offer it - Rails 2.3 - https://github.com/andreferraro/rails_tiny_mce
Rails 3 - https://github.com/sandipransing/rails_tiny_mce
I don't think there's an easy way to do this in any of the common rich text editors. I usually have a separate section where users can upload photos and then choose from a variety of layout options.
TinyMCE has a couple of commercial image and file management plugins, but they are based on PHP and .Net. However, I haven't seen a Rails version. It's not particularly hard to build your own image manager using a plugin like paperclip and hook into TinyMCE.

Rails: attachment_fu plugin, convert PDF uploads to image

Yo,
I've got attachment_fu set up on my server, and it works just fine. My goal, however, is to be able to upload PDFs and have them convert to image (then use all the pre-built attachment_fu options like resize and thumb produce the desired images). What currently happens is that PDFs upload and remain PDFs, whereas images go through all the motions of resizing and whatnot.
How can I get the functionality I want? Is there a simple way to go about doing this using the tools I already have, or should I just manually invoke RMagick to do the initial conversion? If so, how can I do that and then pass off the file to attachment_fu for handling?
Thanks,
--Matchu
For the oldest unanswered rails question: https://stackoverflow.com/a/69804/156561 his answer is probably very similar to get you in the door to use Attachment_fu which I'm sure you've by now migrated off.

Resources