Ubuntu :: Generate Pdf Documents Programmatically Using Ruby
Apr 1, 2011
I need to generate pdf documents programmatically using Ruby. i.e. I don't want a GUI interface but an API interface. The bulk of my document is text but there are images included as well. I've looked at this thread: [URL] and it's 2 main recommendations PDFEdit and ImageMagik. PDFEdit has scripting available but I can't get my head round how to call this using Ruby. ImageMagik has a number of Ruby wrappers and is the kind of thing I want but as far as I can tell it only deals with Images and my stuff is mainly text.
I've been using rubyripper quite happily on Karmic, now I've moved to Lucid and discovered a bit of an issue. rubyripper will pause for several minutes between tracks with ruby 1.8. If I upgrade to ruby 1.9.1 the gui client won't run due to an issue with libgtk2-ruby not being available for 1.9.1.
The cli version of rubyripper under 1.9.1 is blazingly fast, so that is what I'm using at the moment, but I do prefer the gui.
Anyone have any insight into this? Googling suggests there may be a bug in ruby 1.8.7 that caused the long pauses, but it was supposed to have been fixed in 1.8.7.249 i.e. the default Lucid version.
There are a few things not working properly. Ruby version manager seems ok but untill i get working with ruby i don't know if it is working properly. One thing that is not there is irb Interactive ruby is not available according the the message i get.
Well i have no idea what readline is but i did everything that is on that webpage referance page [url]. I have got a lot of progress and learned heaps about linux shell and bash terminal. The thing is i need to get this going and have tried feenode but it is very foreign and how it works i do not have a clue. I have got 2 things resolved so far through this forum but using other threads in it. i need to get irb going before i can progress to using ruby on Rails properly.
I am using a Eeepc running ubuntu easy peasy its version 9.04 of ubuntu. I need the whole of rails to work and want to get a handle on using ruby version manager along with the apache stack with mysql/phpmyadmin and am using this as a dummy run for setting up a development system.
I can access my windows my documentsmusic by mounting my windows drive and browsing to it. I can then playwatch my movies and pics in Ubuntu.But what I really want to be able to do is re-map the Ubunbu docs folder like so:
Ubuntu Pics = Windows My Documents pics. Ubuntu Videos = Windows My Documents Videos.
I'm not very unix savy so I've been using Ubuntu tweak PersonalDefault Folder Locations setting and browsing to my Windows folders. But it doesn't work.I have managed to make a desktop 'short cut' and that works but I'd rather set the system wide default document folders.
How can I change the mountpoint of my partition /media/documents to /documents.This is a partition of sdb and a fixed disk.The reason is that /media/ sometimes creates ghostdirectories while /Windows/C never does so, programmes writing/reading from this partition therfore don't work if a ghostdir_ exists.(BTW Suse is on sdb5 and sdb6. on sda is windows and used to be Ubuntu, the Suse-swap is sda5. Windows is out of use.)
I am writing an Air application and I would like to have the app use the font indicated in Appearance Preferences.
A similar problem to this one :
[URL]
I do not have Gtk::Settings and I have looked in ~/.gconf/desktop/gnome/ but I do not have an interface folder and none of the others I opened have any font details.
I have tried simply not setting a font within my application but it is using a font not specified in the Appearance Preferences at all. It looks like Times.
Ideally I would like to be able to get this information from Ubuntu using a native process :
[URL]
get the font name of the Application font or would I have to write a script and call that from inside Air?
I have a default installation of Ubuntu 10.4 with Unity running on top of Gnome. (I think this is correct. I certainly can get Nautilus running quite easily and as I mentioned earlier I have ~/.gconf/desktop/gnome/ folders).
The brief is to get the application working on the default installation so I cannot install anything but the target machine I am using has got 'gconftool'.
My system doesn't reacts at writing values below 255 to /sys/class/hwmon/hwmon0/device/pwm(2,3) which correspond to 3-wire case fans connected via M/B (ga-890gpa-ud3h) headers. The idea was taken from [url]
ls /sys/class/hwmon/hwmon0/device/
It indeed shows the actual speed:
But refuses to write to fanX_input: permission denied (even for root).
More specs: kernel 2.6.38.4, sensors output is:
I do not run any daemons for fan control, but suppose the speed may be set by CPU in-kernel governor. How to stop a fan under this conditions without doing hardware tricks?
Upd: part of pwmconfig's output:
Devices:
Found the following PWM controls:
hwmon0/device/pwm2 is currently setup for automatic speed control. In general, automatic mode is preferred over manual mode, as it is more efficient and it reacts faster. Are you sure that you want to setup this output for manual control? (n) y hwmon0/device/pwm3 hwmon0/device/pwm3 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as it is more efficient and it reacts faster. Are you sure that you want to setup this output for manual control? (n) y
Test:
Warning! This program will stop your fans, one at a time, for approximately 5 seconds each! This may cause your processor temperature to rise! If you do not want to do this hit control-C now!
Hit return to continue:
Would you like to generate a detailed correlation (y)? y
I have a USB modem and a large C++ application that needs to detect whether that device is present or not. I was hoping to get advice for what the best method to do so would be. The only solution I've thought of is to parse the output of lsusb and look for the vendor and product ID of my device, but that seems a little hack-ish and inefficient. Is there a command or program that I can provide it a vendor/product ID for a USB device and it can tell me whether or not such a device is present in the system? Or another, better way to detect the device than parsing the lsusb output that I've been thinking
Is it possible to do the following in C/C++ in Linux:Without direct linking (my program should NOT depend on Qt or GTK), display a GTK or Qt based file dialog.The behaviour should be something like this when my program runs, when you want to open a file:The program scans whether you have Qt installed. If so, it somehow manages to link itself to Qt (e.g. dynamically loading the .so file) and display its file dialog and get the path from it. If Qt wasn't found, it tries the same with GTK. If that also wasn't found, it displays a less powerful replacement dialog instead (better than nothing).
Or is there any other simple way in Linux to get a standard file dialog somehow (similar to when compiling for Windows you can very easily get its standard file dialog, no matter what version of Windows, in your code, even if your program doesn't use any other Windows GUI at all).
I am writing an application that has a web service client on a Windows PC that needs to call a web service on a Linux server. In order to create the client, I need to be able to programmatically read the WSDL on the server and use it to create the client. I'm using the web tools in MyEclipse to build the client.
The Linux server is running Red Hat, I believe, with ssh enabled. I can connect from Linux to Windows with no problem, but I can't reach the Linux box from Windows. I get one of three errors when I try: no path to host, connection reset, or unknown error number, depending on the port I use. I've googled for an answer, but haven't found anything yet.Is there some way to add the Windows IP to a permission file on the Linux machine so it will be recognized when it queries for the WSDL?
I wonder if there's a way to capture the same information I can get from nethogs to a file. All I need it per process (rather than per interface) what is the sent/received traffic.
Given a matrix with 0,1 entries, how can I create a graphic in linux such that we have a black square or pixel if the entry is one and white otherwise?
For example, if the matrix is:
0001000 0011100 0111110 0000000
then I want a graphic that looks like:
[code]....
I will be working with many large matrices, e.g. 1000x1000, or 5000x1000 so I need to do this automatically.
I know the tool system-config-display can tell me all about my display but it's not available on all systems and so I'm looking for alternative ways to get my monitor type. Ideally, I could just look in /proc but I don't see anything there and I would like to be able to do so from a script perhaps written in bash or perl. Is there some place to get this info, say in a config file somewhere?
I am developing a application in which i have to show the name of default browser and mail client. i want to run this application on RedHat, SuSE, Mandriva, and Ubuntu. I have checked similar threads but not found any useful information.
Terminal, I type ruby, I hit enter, and nothing happens. I'm given a blank line that I can type and enter, and again, nothing happens. I'm stuck, is there a way to fix this without closing the terminal window?
The site that used to host the language spec file for .erb/.rhtml for ruby/rails syntax highlighting is no more.If someone could attach the file for gtksourceview-2.It's located in /usr/share/gtksourceview-2.0/ language-specs/ and probably called rhtml.lang
how do I start a ruby on rails application when my Ubuntu server starts up/is rebooted? I start the application by cd-ing into the ruby application's root directory(the application I'm using is Bibapp) and execute the command;
I'm trying to install ruby on rails on Ubuntu 9.10. I'm following the instructions on this site: http://castilho.biz/blog/2009/11/05/...-karmic-koala/
However, when I try to install Rails I get an error code...
It seems like gem can't access http://gems.rubyforge.org/gems/rake-0.8.7.gem for some reason, but when I try to go directly to that address I get the option to download it. Any ideas how to get around this problem?
I'm thinking if I can somehow tell gem to look for the file locally I can download it and install rails that way.
I have set up a subversion server and on top of that redmine which is a webinterface sort of like trac.For every boot I have to run a script so that redmine will listen to port 8080. I have tried to make the system run this script by it self at start using
Code: # update-rc.d -f start_servers start 99 2 3 4 5 . using this guide http://embraceubuntu.com/2005/09/07/...run-at-bootup/
==========NOTE: subsequent to posting, I attempted to use the gem 'mysql' and it worked. This is odd considering all the errors that were emitted below. Anyway, I can proceed with my study.==========
Environment: Running 10.04 MySQL version: mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1
I'm trying to install Rubyripper into Maverick using these guidelines: [URL]
But I get this error message in terminal:
Code: W: Failed to fetch http://ppa.launchpad.net/aheck/ppa/ubuntu/dists/maverick/main/source/Sources.gz 404 Not Found W: Failed to fetch http://ppa.launchpad.net/aheck/ppa/ubuntu/dists/maverick/main/binary-i386/Packages.gz 404 Not Found
E: Some index files failed to download, they have been ignored, or old ones used instead. Presumably because it can't find the package. But what do I do next? or is there an alternative way to install?
Everytime I tru to install that gem with gem install mysql I get this output :
[CODE] Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb checking for mysql_ssl_set()... no
I would like to install the rmagick gem under ruby ree-1.8.7. Like every time, the installation routine does complain about two different version being installed which are actually the same. I have every, really every imagemagick package installed:
(Using Archlinux) I downloaded Ruby 1.8.7-174 a while ago and installed it via the tarball (not pacman). I was trying to update to 1.8.7-299, but I can't get it to work. Per the readme, I do the following steps, all of which complete without error:
./configure make make install
After install finishes however, I still have -174 installed instead of -299.